This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: ELFPPC32 / final link failed: Bad value


On Fri, 19 Jan 2007 14:59:35 +0000
Nick Clifton <nickc@redhat.com> wrote:

> It sounds like Mach-O reloc is broken, since if the reloc is only 
> supposed to change 16 bits, but the offset points to the start of a 
> 32-bit word, how does the linker know which 16-bits to change ?

This is the question : the Mach-O spec is not clear at all on
this topic and does not describe byte arrangement into the storage
units. The only thing that is clear is that those relocations have an
r_type that handles 16 bits, and an r_length (length of the item to be
relocated) indicating it is a 4-byte unit... looking at the actual
instructions, it seems the relocated bits are always the lower ones

> Presumably there is some magic knowledge about the type of thing stored 
> in the 32-bit word and so the correct 16-bits are supposed to be known 
> to the linker.

I guess it is so (that's what PPC ELF seems to do for low24, after all).
I only wish it would have been documented somewhere.

However. As for ld, it seems my next option is to recompile a debug
version -- let's see what this yields.

Simon


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