This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: RFC: using ld 2.14 on irix
- From: "Maciej W. Rozycki" <macro at ds2 dot pg dot gda dot pl>
- To: Richard Sandiford <rsandifo at redhat dot com>, Ralf Baechle <ralf at linux-mips dot org>
- Cc: binutils at sources dot redhat dot com
- Date: Sat, 14 Jun 2003 21:37:23 +0200 (MET DST)
- Subject: Re: RFC: using ld 2.14 on irix
- Organization: Technical University of Gdansk
On 14 Jun 2003, Richard Sandiford wrote:
> > With these changes I was able to successfully bootstrap gcc 3.4
> > using GNU as & ld. There seem to be some problems with the DSOs
> > it created, looking at that now. (The DSOs created by the unpatched
> > linker fail too, so it might not be caused by these patches.)
>
> Hmm, beginning to wish I'd stuck to gcc. ;)
>
> To quote the R_MIPS_REL32 passage again:
>
> > The value EA used by the dynamic linker to relocate an R_MIPS_REL32
> > relocation depends on its r_symndx value. If the relocation entry
> > r_symndx is less than DT_MIPS_GOTSYM, the value of EA is the symbol
> > st_value plus displacement. Otherwise, the value of EA is the
> > value in the GOT entry corresponding to the relocation entry
> > r_symndx.
>
> and the R_MIPS_REL32 equation is:
>
> > A - EA + S
>
> where A is the in-place addend and S is the final symbol value.
> So if a relocation is against a global symbol, the process seems to be:
>
> - subtract the initial contents of the symbol's GOT entry
> - add in the symbol's final value
>
> (Note: I think the passage must mean the initial value of the
> GOT entry since the final value will usually be S.)
;-) The subject of possible interpretations of the definition of the
calculation was already beaten to death here and elsewhere.
> Unfortunately, the patch breaks mipsel-linux-gnu. glibc seems to have
> a very different idea about how to apply R_MIPS_REL32. Looking at
> dl-machine.h (2.2.5 and 2.3.2), it adjusts the GOT before applying any
> relocations, then it adds the (final) GOT entries to the relocation fields.
>
> Am I going insane, or is there really a fundamental difference here?
> If the latter, is it a known problem? I don't see how we can keep
> both glibc and irix rld happy.
There was a discussion on the incompatibilities recently -- see
'http://sources.redhat.com/ml/binutils/2003-02/msg00345.html'. Ralf might
shed additional light on the dependencies. The patch he proposed isn't
that bad in principle.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +