arm questions

Ian Lance Taylor ian@zembu.com
Thu Apr 15 11:47:00 GMT 1999


   Date: Thu, 15 Apr 1999 14:49:16 -0400
   From: Scott Bambrough <scottb@corelcomputer.com>

   Actually Phil is in England, Pat Beirne and I are in Canada.

Oops--sorry.

   We chose REL because we did not need the addend.  In hindsight I
   would choose RELA.

For the benefit of anybody who is considering an ELF port, please
always use RELA relocs rather than REL relocs.  REL relocs work OK for
processors with very simple relocation needs, like an i386 or m68k.
For a RISC processor, they are a real pain.  You always need to
support an addend which can support your entire address space, in
order to handle code like this:
    char a[10000];
    int foo () { return a[9999]; }
This ought to turn into a reference to the symbol a + 9999, so you
need an addend which can hold a value of 9999, or you get inefficient
code.

   > In the meantime, Cygnus implemented ARM ELF, using RELA relocs.

   Something of which we were entirely unaware of at the time, otherwise we would
   have attempted to collaborate in a closer fashion.

I now recall that I dropped the ball on this one.  I saw the request
for the ARM ELF work come in to Cygnus, but I didn't manage to figure
out that it was for a different ABI than the one in H.J.'s snapshots.

Ian



More information about the Bfd mailing list