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: Incompatibility between GNU-ld and SUN's ld.so.1


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


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