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: mips n32 bfd will corrupt relocation addends


On Jan  8, 2003, cgd@broadcom.com wrote:

> At Wed, 8 Jan 2003 21:38:23 +0000 (UTC), "Alexandre Oliva" wrote:
>> Hard to trigger, but with very disruptive results when it
>> does.  Here's a patch that gets it to take the section into account
>> when deciding whether two relocations are combined.

> Doesn't that scream for a testsuite entry?  8-)

Here it is.  Sorry about the long delay.  The test runs only on
mips*-*-linux* and *-*-irix6* because with other triplets we don't get
n32 support in bfd.  Ok to install?

Index: gas/testsuite/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* gas/mips/n32-consec.d: New.
	* gas/mips/n32-consec.s: New.
	* gas/mips/mips.exp (run_list_test_arches): Run it on irix6 and
	mips*-linux* systems.

Index: gas/testsuite/gas/mips/mips.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/mips/mips.exp,v
retrieving revision 1.57
diff -u -p -r1.57 mips.exp
--- gas/testsuite/gas/mips/mips.exp 31 Dec 2002 08:11:17 -0000 1.57
+++ gas/testsuite/gas/mips/mips.exp 26 Jan 2003 03:51:39 -0000
@@ -376,6 +376,7 @@ if { [istarget mips*-*-*] } then {
     set ilocks [istarget mipstx39*-*-*]
     set gpr_ilocks [expr [istarget mipstx39*-*-*]]
     set addr32 [expr [istarget mipstx39*-*-*]]
+    set hasn32 [expr [istarget *-*-irix6*] || [istarget mips*-*-linux*]]
 
     if { [istarget "mips*-*-*linux*"] } then {
 	set tmips "t"
@@ -611,6 +612,10 @@ if { [istarget mips*-*-*] } then {
 	    run_dump_test "${tmips}mips${el}16-f"
 	}
 	run_dump_test "elf-consthilo"
+    }
+
+    if $hasn32 {
+	run_dump_test "n32-consec"
     }
 
     # tests of objdump's ability to disassemble using different
Index: gas/testsuite/gas/mips/n32-consec.d
===================================================================
RCS file: gas/testsuite/gas/mips/n32-consec.d
diff -N gas/testsuite/gas/mips/n32-consec.d
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gas/testsuite/gas/mips/n32-consec.d 26 Jan 2003 03:51:39 -0000
@@ -0,0 +1,14 @@
+#as: -n32
+#objdump: -Dr --prefix-addresses
+#name: n32 consecutive unrelated relocations
+
+.*:     file format .*mips.*
+
+Disassembly of section .text:
+	...
+			0: R_MIPS_32	.text
+Disassembly of section .data:
+	...
+			0: R_MIPS_32	.data\+0x4
+Disassembly of section .reginfo:
+	...
Index: gas/testsuite/gas/mips/n32-consec.s
===================================================================
RCS file: gas/testsuite/gas/mips/n32-consec.s
diff -N gas/testsuite/gas/mips/n32-consec.s
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gas/testsuite/gas/mips/n32-consec.s 26 Jan 2003 03:51:39 -0000
@@ -0,0 +1,4 @@
+.text
+	.long .
+.data
+	.long .+4
-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

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