[GLIBC][AARCH64]Rewrite elf_machine_load_address using _DYNAMIC symbol

Roland McGrath roland@hack.frob.com
Wed Nov 9 22:02:00 GMT 2016


> On 08/11/16 21:28, Roland McGrath wrote:
> > Show me the code you have in mind using _DYNAMIC.  The scheme using a
> > linker-defined symbol with value 0 is the only one I'm aware of that
> > reduces to the minimal number of assembly instructions, with none of them
> > being a load.
> 
> well the current x86_64 code is already doing what i had in mind.

And it is more costly than using _BASE.

> i assumed GOT[0] is used elsewhere so it has to be computed anyway
> and then doing (_DYNAMIC-GOT[0]) should be the same as _BASE using
> an extra sub.

Of course all the methods that work get the same result!
The point is that the _BASE method does it the most efficiently.



More information about the Libc-alpha mailing list