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: Relocation bug


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        +


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