This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Incompatibility between GNU-ld and SUN's ld.so.1
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Geoff Keating <geoffk at geoffk dot org>
- Cc: Christian Ehrhardt <ehrhardt at mathematik dot uni-ulm dot de>, binutils at sources dot redhat dot com
- Date: Tue, 24 Sep 2002 21:40:29 +0200
- Subject: Re: Incompatibility between GNU-ld and SUN's ld.so.1
- References: <20020924162651.26384.qmail@thales.mathematik.uni-ulm.de> <jmhegfw5v6.fsf@desire.geoffk.org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Sep 24, 2002 at 12:21:49PM -0700, Geoff Keating wrote:
> Beware! IIRC, ld.so on Solaris used (perhaps in 2.5.1?) to always
> compute V+B, ignoring A, for R_SPARC_RELATIVE, exactly as the doc
> above describes. To be backwards compatible, it might be necessary to
> suppress output of DT_RELACOUNT instead if being built for an older
> Solaris system.
Until now binutils were creatiing R_SPARC_RELATIVE with addend in V and A=0
for .rela.got (or .rela.dyn pointing into .got) relocs and R_SPARC_RELATIVE
with addend in A and V=0 for other sections, say:
.data
foo: .word 0, foo
results in:
Relocation section '.rela.dyn' at offset 0x288 contains 1 entries:
Offset Info Type Sym.Value Sym. Name + Addend
0001029c 00000016 R_SPARC_RELATIVE 00010298
Contents of section .data:
10298 00000000 00000000 ........
So if some Solaris ld.so used just V+B and not V+B+A, it wouldn't work with
binutils from the last couple of years. It is a horrible mess anyway, they
should have done it right initially (ie. V+B), but changing it based on
some dynamic tag is really not a good idea.
Jakub