This is the mail archive of the binutils@sourceware.org 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: Fix double-counting of MIPS dynamic relocs


David Daney <ddaney@avtrex.com> writes:
> Richard Sandiford wrote:
>> I was updating the GOT patches to work with:
>> 
>> http://sources.redhat.com/ml/binutils/2008-07/msg00350.html
>> 
>> and noticed that that patch double-counted relocations against
>> versioned symbols.  The hash table callback is called for both
>> the indirect and direct definitions, and was reserving relocations
>> for both.
>> 
>> This is just a (small) pessimisation at the moment, but it
>> triggered an assert I added in the GOT patches.
>> 
>> Tested on mips64-linux-gnu (both with GCC and binutils).
>> OK to install?
>> 
>> Richard
>> 
>> 
>> bfd/
>> 	* elfxx-mips.c (allocate_dynrelocs): Ignore indirect and warning
>> 	symbols.
>> 
>> ld/testsuite/
>> 	* ld-mips-elf/reloc-estimate-1.d, ld-mips-elf/reloc-estimate-1.ld,
>> 	ld-mips-elf/reloc-estimate-1a.s, ld-mips-elf/reloc-estimate-1b.s:
>> 	New test.
>> 	* ld-mips-elf/mips-elf.exp: Run it.
>> 
>
> Is this new test expected to pass on a mipsel-linux-gnu cross?
>
> With the binutils-2.18.91 snapshot it is failing for me.
>
> I may be able to look at it in a couple of days, but you might have a
> better idea of what is going wrong.

Thanks for the heads-up.  I checked in this patch as obvious.

Richard


ld/testsuite/
	* ld-mips-elf/reloc-estimate-1.d: Make endian-neutral.

Index: ld/testsuite/ld-mips-elf/reloc-estimate-1.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/reloc-estimate-1.d,v
retrieving revision 1.1
diff -u -p -r1.1 reloc-estimate-1.d
--- ld/testsuite/ld-mips-elf/reloc-estimate-1.d	7 Aug 2008 19:50:05 -0000	1.1
+++ ld/testsuite/ld-mips-elf/reloc-estimate-1.d	20 Sep 2008 09:38:31 -0000
@@ -15,4 +15,4 @@ OFFSET   TYPE              VALUE 
 # The address must be 0x810.  We should only ever allocate one dynamic
 # reloc over and above the first R_MIPS_NONE entry.
 Contents of section \.foo:
- 0810 deadbeef                             ....            
+ 0810 (deadbeef|efbeadde)                             ....            


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