[cfe-dev] [llvm-dev] RFC: A new ABI for virtual calls, and a change to the virtual call representation in the IR

Joerg Sonnenberger via cfe-dev cfe-dev at lists.llvm.org
Fri Mar 11 18:34:10 PST 2016


On Fri, Mar 11, 2016 at 01:54:36PM -0800, John McCall via cfe-dev wrote:
> I’m sorry, but I didn’t quite get that.  The symbol is defined as protected
> by the dynamic library, but the main executable can’t just use an ordinary
> external symbol reference to it for some reason?

The main program is not position independent. A function call is fine,
the linker will provide a PLT slot for that and the issue is done. The
problems are accessing a variable OR taking the pointer of a function.
With non-PIC code on x86, you get an immediate load. But the linker
can't adjust this into a load from the GOT.

Joerg



More information about the cfe-dev mailing list