This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Add test of R_MIPS16_GPREL relocations to ld
- From: Thiemo Seufer <ths at networkno dot de>
- To: binutils at sourceware dot org
- Date: Mon, 18 Sep 2006 19:24:01 +0100
- Subject: [PATCH] Add test of R_MIPS16_GPREL relocations to ld
Hello All,
I applied the appended patch, it tests the proper handling of
R_MIPS16_GPREL relocations.
Thiemo
2006-09-18 Thiemo Seufer <ths@mips.com>
Maciej W. Rozycki <macro@mips.com>
* ld-mips-elf/mips-elf.exp: Add test for R_MIPS16_GPREL relocations.
* ld-mips-elf/reloc-3-n32.d, ld-mips-elf/reloc-3.d: New files.
Index: ld/testsuite/ld-mips-elf/mips-elf.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/mips-elf.exp,v
retrieving revision 1.38
diff -u -p -r1.38 mips-elf.exp
--- ld/testsuite/ld-mips-elf/mips-elf.exp 29 Jul 2006 08:48:15 -0000 1.38
+++ ld/testsuite/ld-mips-elf/mips-elf.exp 18 Sep 2006 17:57:49 -0000
@@ -107,6 +107,10 @@ if $has_newabi {
}
run_dump_test "reloc-2"
run_dump_test "reloc-merge-lo16"
+run_dump_test "reloc-3"
+if {$has_newabi} {
+ run_dump_test "reloc-3-n32"
+}
if {$has_newabi && $linux_gnu} {
run_dump_test "eh-frame1-n32"
run_dump_test "eh-frame1-n64"
Index: ld/testsuite/ld-mips-elf/reloc-3-n32.d
===================================================================
RCS file: ld/testsuite/ld-mips-elf/reloc-3-n32.d
diff -N ld/testsuite/ld-mips-elf/reloc-3-n32.d
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-mips-elf/reloc-3-n32.d 18 Sep 2006 17:57:49 -0000
@@ -0,0 +1,18 @@
+#name: R_MIPS16_GPREL reloc n32
+#source: ../../../gas/testsuite/gas/mips/elf-rel6.s
+#as: -march=mips64 -mabi=n32 -EB
+#objdump: --prefix-addresses -tdr --show-raw-insn
+#ld: -Ttext 0x500000 -e 0x500000 -N -melf32btsmipn32
+
+
+.*: file format elf.*mips.*
+
+#...
+
+Disassembly of section \.text:
+0+500000 <[^>]*> f010 8352 lb v0,-32750\(v1\)
+0+500004 <[^>]*> f010 8353 lb v0,-32749\(v1\)
+0+500008 <[^>]*> f252 8346 lb v0,-28090\(v1\)
+0+50000c <[^>]*> 6500 nop
+0+50000e <[^>]*> 6500 nop
+#pass
Index: ld/testsuite/ld-mips-elf/reloc-3.d
===================================================================
RCS file: ld/testsuite/ld-mips-elf/reloc-3.d
diff -N ld/testsuite/ld-mips-elf/reloc-3.d
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-mips-elf/reloc-3.d 18 Sep 2006 17:57:49 -0000
@@ -0,0 +1,16 @@
+#name: R_MIPS16_GPREL reloc
+#source: ../../../gas/testsuite/gas/mips/elf-rel6.s
+#objdump: --prefix-addresses -tdr --show-raw-insn
+#ld: -Ttext 0x500000 -e 0x500000 -N
+
+.*: file format elf.*mips.*
+
+#...
+
+Disassembly of section \.text:
+0+500000 <[^>]*> f010 8352 lb v0,-32750\(v1\)
+0+500004 <[^>]*> f010 8353 lb v0,-32749\(v1\)
+0+500008 <[^>]*> f252 8346 lb v0,-28090\(v1\)
+0+50000c <[^>]*> 6500 nop
+0+50000e <[^>]*> 6500 nop
+#pass