From mboxrd@z Thu Jan 1 00:00:00 1970 From: hjl@lucon.org (H.J. Lu) To: ian@zembu.com (Ian Lance Taylor) Cc: scottb@corelcomputer.com, bfd@cygnus.com Subject: Re: arm questions Date: Thu, 15 Apr 1999 13:29:00 -0000 Message-id: References: <19990415184652.2787.qmail@daffy.airs.com> X-SW-Source: 1999/msg00089.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. Ok. You are saying RELA is better than REL. Does it make any senses to use RELA for relocatable object and allow REL for excutable and shared objects? > > > 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. > If RELA is really desired, can ARM/Linux switch to RELA with a different soname? Binaries using REL should still run ok, just like what we did to libc 5 on x86. -- H.J. Lu (hjl@gnu.org)