This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: Reloc changes to bfd/elf32-mips.c
- To: geoffk at ozemail dot com dot au
- Subject: Re: Reloc changes to bfd/elf32-mips.c
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 6 Oct 1999 22:34:47 -0400
- CC: mark at codesourcery dot com, gavin at cygnus dot com, binutils at sourceware dot cygnus dot com, brendan at cygnus dot com
- References: <199909271118.VAA01663@gluttony.geoffk.wattle.id.au> <19990928005956V.mitchell@codesourcery.com> <199909290330.NAA00657@gluttony.geoffk.wattle.id.au> <19990929035539.20417.qmail@daffy.airs.com> <199909290450.OAA00966@gluttony.geoffk.wattle.id.au> <19990929050239.26015.qmail@daffy.airs.com> <199910070151.LAA01021@gluttony.geoffk.wattle.id.au>
Date: Thu, 7 Oct 1999 11:51:21 +1000
From: Geoff Keating <geoffk@ozemail.com.au>
Perhaps you could explain what you think the code should be doing?
This is often much more helpful than simply saying `I think this is
wrong', since the usual response is `well, I think it is right'.
Sorry, I thought I had explained it.
I think that the 32 bit MIPS ELF code should compute a 64 bit reloc by
computing a 32 bit reloc in the least significant 32 bits. The most
significant bit of the result of that computation should then be sign
extended into the most significant 32 bits.
This behaviour is independent of whether BFD64 is defined or not.
BFD64 is a host macro, and I am concerned with target behaviour.
My test case for this is the following:
configure --target=mipstx39-unknown-elf
make
cat > test.s <<EOF
.text
l1:
.dword l1+16
EOF
gas/as-new test.s -o test.o
ld/ld-new -Ttext 0x12345678 test.o -o test.out
binutils/objdump -j .text -s test.out
and without my patch I see
Contents of section .text:
12345678 00000000 12345678 .....4Vx
when I expect to see
Contents of section .text:
12345678 00000000 12345688 .....4V.
I agree that the code should produce what you expect to see. I don't
know whether this build used BFD64 or not.
Your patch changed several different things at once. I don't know
which are necessary to make this result. Most of your patch looked
fine. The odd parts were the two hunks which added #ifndef BFD64 and
#endif, and the last hunk which didn't set howto. I don't understand
all of this code. But especially adding the #ifndef/#endif seems
strange.
As I've tried to say before, if the three hunks I mentioned don't
change what happens, then they are fine. If they do change what
happens, then I would like to understand how they change it. Can you
explain that?
Ian