This is the mail archive of the binutils@sources.redhat.com 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: [PATCH] MIPS bfd: abi 64 ld -r


On Sep  4, 2002, Alan Modra <amodra@bigpond.net.au> wrote:

> If this reloc really is RELA, then that isn't an "in-place addend".
> Rather, it's random garbage in the section contents that should be
> ignored.  At least, that's the way standard RELA relocs work, but
> mips is weird.  ;)

If that's not an in-place addend, then *where* did the addend go?

Most ELF targets have RELA relocs with separate addends, but some,
such as sh-elf, have addends in-place, for compatibility with other
tools (sh-coff, Hitachi tools, who knows?  it was already such a mess
when I got here, counselor :-).  Yeah, that's a nightmare, but that's
the way it is.

However, I must admit that I had failed to consider the possibility
that the IRIX tools might be emitting a REL relocation, and I've just
verified that, in this case, the emitted relocation was indeed a REL
one, that, being REL, had the relocation in place.  Evidently our
linker didn't notice this distinction between REL and RELA, and failed
to apply the REL relocation correctly.  So the bug is entirely
different than the one I described.  Sorry that I jumped to
conclusions.

Unfortunately, it's not that simple.  Assembling that same object file
with GNU as will produce RELA relocations that the IRIX linker can't
cope with.  It says:

ld32: FATAL   11 : Object file format error (t.o): invalid section offset

Eeek.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


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