This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Relocation bug
- From: "Maciej W. Rozycki" <macro at ds2 dot pg dot gda dot pl>
- To: Ralf Baechle <ralf at linux-mips dot org>
- Cc: Eric Christopher <echristo at redhat dot com>, "H. J. Lu" <hjl at lucon dot org>, binutils at sources dot redhat dot com, cgd at broadcom dot com, rafal at netbsd dot org, Per Fogelström <pefo at opsycon dot se>
- Date: Mon, 24 Feb 2003 16:13:46 +0100 (MET)
- Subject: Re: Relocation bug
- Organization: Technical University of Gdansk
On Mon, 24 Feb 2003, Ralf Baechle wrote:
> > > [ralf at dea b0rked]$ mips-linux-objdump --full-contents --section=.data s.so
> > >
> > > s.so: file format elf32-tradbigmips
> > >
> > > Contents of section .data:
> > > 40410 00041644 00000000 00000000 00000000 ...D............
> > > ^^^^^^^^
> > >
> > > Which is the address of .data plus 0x1234.
> >
> > Hmm, if you do this then I think you should be using symbol index zero
> > in the relocation too.
>
> I believe you're right, this is a little bug, too.
Note that by using symbol index zero in the relocation you make currently
ld.so magically work out of the box. I've already pointed this case out
to you -- for R_MIPS_REL32 relocations both ones relative to external
symbols and absolute ones are interpreted consistently across
implementations.
> Anyway I think you poked my nose at something interesting. All flavours
> of the GNU libc dynamic linker I know of are properly treating R_MIPS_REL32
> with a symbol index of zero. I've not checked the BSDs but I bet it's the
> same there. That opens an elegant way out of how to fix the relocation
> thing with as little breaking of binaries as possible. Fix binutils to emit
> the relocs with symbol index zero and the difference between old binaries
> and current binaries will eventually fade away - without touching dynamic
> linkers.
Hmm, you weren't interested in this option previously, strange...
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro at ds2 dot pg dot gda dot pl, PGP key available +