m68k reloc types
Andreas Schwab
schwab@suse.de
Mon Aug 16 19:49:00 GMT 2004
Roman Zippel <zippel@linux-m68k.org> writes:
> But why does i386 doesn't need the kludgy hack in R_386_GOTPC to setup the
> pic register?
Sorry, I can't parse this sentence.
>> > That R_68K_GOT32O is the same as R_386_GOT32 is not a little confusing?
>>
>> No. Why?
>
> I could live it, if it would be documented somewhere publicly.
Well, they are documented fully in the m68k processor supplement to the
SysV ABI. You may be able to find a copy in some university library.
> Ok, m68k could simply use pc relative addressing to access local symbols,
> but which reloc type should be used to void creating the plt/got entry?
As you already wrote, use pc-relative addressing with any PIC modifier.
> Should both create a got entry?
Sure.
> In what other situation can R_68K_GOT32 be used for?
When you want the pc-relative address of the GOT entry for a symbol.
Ususally only used for _GLOBAL_OFFSET_TABLE_, but can be used for any
other symbol as well (but gcc does not use this).
> E.g. R_386_GOTOFF never creates a got entry.
It is used to simulate the missing pc-relative addressing mode with
pic-register-relative addressing. Thus it is only usable for symbols that
don't need a GOT entry.
> BTW what's the difference between R_68K_PLT32O and R_68K_PLT32? A small
> code example would be useful here. The former isn't generated by binutils.
They are similar to the GOT counterparts, but address the PLT entry
instead of the GOT entry. R_64K_PLT32 is used for function calls. I've
never been able to figure out where R_68K_PLT32O is supposed to be used,
it's maybe only defined for completeness.
> This doesn't really explain, why a reloc type should behave differently
> dependening on the symbol.
Well, such is life. I didn't define the m68k ABI.
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 Binutils
mailing list