From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Lance Taylor To: scottb@corelcomputer.com Cc: bfd@cygnus.com Subject: Re: arm questions Date: Thu, 15 Apr 1999 11:47:00 -0000 Message-id: <19990415184652.2787.qmail@daffy.airs.com> References: <199904151738.KAA02138@canuck.cygnus.com.> <19990415180136.2600.qmail@daffy.airs.com> <371634AC.F67511BF@corelcomputer.com> <371634AC.F67511BF@corelcomputer.com> X-SW-Source: 1999/msg00087.html Date: Thu, 15 Apr 1999 14:49:16 -0400 From: Scott Bambrough 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