This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: elf-machine-dynamic for m68k


"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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]