[U-Boot-Users] .GOT2, PLT and fixups ?
Charles J Gillan
C.Gillan at ecit.qub.ac.uk
Mon Apr 11 17:48:14 CEST 2005
I have been examining the sections in the LD script as used by
U-Boot for the TQM8xx system.
I am puzzled by a few things and wonder if anyone could explain
these. I know that similar, but not identical questions, have turned
up on the list before - but I still cant figure out exactly what's
going on. I have also checked the GNU GCC forums and the EABI documents
without success. It seems possibly that internals of the compiler/linker are
not documented in great detail for PPC ???
I have three questions - all relating to building U-Boot for the TQM8xx:
1. Are .GOT and .GOT1 always going to be empty when compiling
with -fPIC?
The SYS V ABI/EABI mentions the existence of a GOT but I can't
find any mention of the .GOT1 or .GOT2 sections anywhere that I
have searched.
I checked the assembler output for simple C code that I wrote,
and whenever -fPIC is used this always seems to always
generate .GOT2 sections for global data, never .GOT and
never .GOT1
Also, I noted that in u-boot.map the .GOT1 section (which the LD
script places in the "text" section of the executable) is empty;
the .GOT section, which the LD script places in the "reloc"
section, just before the .GOT2) is also empty.
2. How are calls to the position independent C code actually handled?
The .PLT section (which LD script places before the text
section) is also empty in the u-boot.map output.
However on looking at the assembler generated by compiling
tqm8xx.c, I see that function calls (e.g. to upm_config) are
handled using the
upm_config at plt
syntax.
The GOT2 table appears to be the only mechanism for relocation
available, so I assume that the function pointers are in fact
mapped into the GOT2 somehow ?
3. Why does ".fixup" appear twice in the LD script, once in the
"text" section and once in the "reloc" section.
Again, I note that the fixup section appears to be empty.
Thanks in advance for any information you can provide.
Regards,
Charles.
---------------------------------------------------------------------------
Dr Charles J Gillan
The Institute of Electronics, Communications and Information Technology
(ECIT),
Queen's University Belfast,
Titanic Quarter
Queens Road, Queens Island,
Belfast, BT3 9DT
Northern Ireland, UK
---------------------------------------------------------------------------
More information about the U-Boot
mailing list