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
On Sat, Jun 14, 2003 at 09:37:23PM +0200, Maciej W. Rozycki wrote:
> 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.
Yes and no. What we have here is two matching bugs in glibc and binutils.
If none or both are present things are running just fine and both
combinations are out there in the wild. In the end we found that a patch
like http://sources.redhat.com/ml/binutils/2003-02/msg00430.html would
produce binaries that were correctly interpreted by both broken and
correct glibc dynamic linkers for my test case which was:
.data
bar: .word bar + 0x1234
With binutils 2.13.2.1 plus patch from above URL applied this is what I get:
[ralf@dea tmp]$ mips-linux-as -O2 -KPIC -o s.o s.s
[ralf@dea tmp]$ mips-linux-ld -shared -o s.so s.o
[ralf@dea tmp]$ mips-linux-objdump --full-contents --section=.data s.so
s.so: file format elf32-tradbigmips
Contents of section .data:
40400 00041634 00000000 00000000 00000000 ...4............
^^^^^^^^
Which is correct by my interpretation.
IRIX ld doesn't adjust the symbol index to zero but as this is perfectly
ELF gABI compliant their linker should hopefully handle this right. Last
when I was experimenting with GNU ld I ran into various funnies like
their dynamic linker requiring DT_MIPS_BASE_ADDRESS non-zero and a few
others which I never resolved, so I know there's still some work to do.
That did affect all binary format btw.
Ralf