elf-machine-dynamic for m68k

Andreas Schwab schwab@suse.de
Mon Sep 13 09:32:00 GMT 2004


"C Jaiprakash, Noida" <C.Jaiprakash@noida.hcltech.com> writes:

> These functions are using a5 but I am unable to understand where a5 is
> initialized.

It is implicitly initialized to the address of _GLOBAL_OFFSET_TABLE_ in
any function that uses global data.

> I am confused because elf_machine_dynamic function says Return the
> link-time address of _DYNAMIC that means a5 holds _DYNAMIC, but when a
> code is compiled with -fPIC a5 holds GLOBAL_OFFSET_TABLE!!

Look closer.  The return value is loaded from the first entry of the GOT,
as the comment says.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Libc-alpha mailing list