summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Fortune <matthew.fortune@imgtec.com>2014-12-18 20:08:38 +0000
committerMatthew Fortune <matthew.fortune@imgtec.com>2014-12-19 14:19:42 +0000
commit6e8ec71244d3bb6a1223d07965066b7b9836ab7d (patch)
treea6f18c6ae28d0b75abb8072a506efe3cbdc7ee65 /ld/testsuite
parentMIPS SDE OS ABI support (diff)
downloadbinutils-gdb-6e8ec71244d3bb6a1223d07965066b7b9836ab7d.tar.gz
binutils-gdb-6e8ec71244d3bb6a1223d07965066b7b9836ab7d.tar.bz2
binutils-gdb-6e8ec71244d3bb6a1223d07965066b7b9836ab7d.zip
Fix undefined weak symbol reloc tests
ld/testsuite/ * ld-mips-elf/mips-elf.exp: Update undefweak-overflow tests. * ld-mips-elf/undefweak-overflow-n32.d: Remove. * ld-mips-elf/undefweak-overflow-n64.d: Likewise. * ld-mips-elf/undefweak-overflow.s: Set mips64r6, noreorder and add a label to mark the micromips region. * ld-mips-elf/undefweak-overflow.d: Update expected output.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog9
-rw-r--r--ld/testsuite/ld-mips-elf/mips-elf.exp9
-rw-r--r--ld/testsuite/ld-mips-elf/undefweak-overflow-n32.d23
-rw-r--r--ld/testsuite/ld-mips-elf/undefweak-overflow-n64.d23
-rw-r--r--ld/testsuite/ld-mips-elf/undefweak-overflow.d42
-rw-r--r--ld/testsuite/ld-mips-elf/undefweak-overflow.s27
6 files changed, 55 insertions, 78 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index bcdcf0b1461..944be426f50 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2014-12-19 Matthew Fortune <matthew.fortune@imgtec.com>
+
+ * ld-mips-elf/mips-elf.exp: Update undefweak-overflow tests.
+ * ld-mips-elf/undefweak-overflow-n32.d: Remove.
+ * ld-mips-elf/undefweak-overflow-n64.d: Likewise.
+ * ld-mips-elf/undefweak-overflow.s: Set mips64r6, noreorder and
+ add a label to mark the micromips region.
+ * ld-mips-elf/undefweak-overflow.d: Update expected output.
+
2014-12-13 H.J. Lu <hongjiu.lu@intel.com>
PR ld/17689
diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp
index 21c809fafce..7b901c6f710 100644
--- a/ld/testsuite/ld-mips-elf/mips-elf.exp
+++ b/ld/testsuite/ld-mips-elf/mips-elf.exp
@@ -434,11 +434,14 @@ if {$linux_gnu} {
run_dump_test "jaloverflow"
run_dump_test "jaloverflow-2"
-run_dump_test "undefweak-overflow"
+run_dump_test "undefweak-overflow" [list [list as $abi_asflags(o32)] \
+ [list ld $abi_ldflags(o32)]]
if {$has_newabi} {
- run_dump_test "undefweak-overflow-n32"
- run_dump_test "undefweak-overflow-n64"
+ run_dump_test "undefweak-overflow" [list [list as $abi_asflags(n32)] \
+ [list ld $abi_ldflags(n32)]]
+ run_dump_test "undefweak-overflow" [list [list as $abi_asflags(n64)] \
+ [list ld $abi_ldflags(n64)]]
}
if {$has_newabi} {
diff --git a/ld/testsuite/ld-mips-elf/undefweak-overflow-n32.d b/ld/testsuite/ld-mips-elf/undefweak-overflow-n32.d
deleted file mode 100644
index 4d965b8dcfe..00000000000
--- a/ld/testsuite/ld-mips-elf/undefweak-overflow-n32.d
+++ /dev/null
@@ -1,23 +0,0 @@
-#name: undefined weak symbol overflow (n32)
-#source: undefweak-overflow.s
-#as: -n32 -EB
-#ld: -melf32btsmipn32 -Ttext=0x20000000 -e start
-#objdump: -dr
-#...
-0*20000000: d85fffff.*
-0*20000004: 00000000.*
-0*20000008: f85ffffd.*
-0*2000000c: ec4ffffd.*
-0*20000010: ec5bfffe.*
-0*20000014: cbfffffa.*
-0*20000018: 3c04e000.*
-0*2000001c: 1000fff8.*
-0*20000020: 2484ffe0.*
-0*20000024: 0411fff6.*
-0*20000028: 00000000.*
-0*2000002c: 3c047fd0.*
-0*20000030: 8e670c00.*
-0*20000034: cfe50c00.*
-0*20000038: 9400ffe2.*
-0*2000003c: 0c000c00.*
-#pass
diff --git a/ld/testsuite/ld-mips-elf/undefweak-overflow-n64.d b/ld/testsuite/ld-mips-elf/undefweak-overflow-n64.d
deleted file mode 100644
index e0d9fdade7f..00000000000
--- a/ld/testsuite/ld-mips-elf/undefweak-overflow-n64.d
+++ /dev/null
@@ -1,23 +0,0 @@
-#name: undefined weak symbol overflow (n64)
-#source: undefweak-overflow.s
-#as: -64 -EB
-#ld: -melf64btsmip -Ttext=0x20000000 -e start
-#objdump: -dr
-#...
- 0*20000000: d85fffff.*
- 0*20000004: 00000000.*
- 0*20000008: f85ffffd.*
- 0*2000000c: ec4ffffd.*
- 0*20000010: ec5bfffe.*
- 0*20000014: cbfffffa.*
- 0*20000018: 3c04e000.*
- 0*2000001c: 1000fff8.*
- 0*20000020: 2484ffe0.*
- 0*20000024: 0411fff6.*
- 0*20000028: 00000000.*
- 0*2000002c: 3c047fd0.*
- 0*20000030: 8e670c00.*
- 0*20000034: cfe50c00.*
- 0*20000038: 9400ffe2.*
- 0*2000003c: 0c000c00.*
-#pass
diff --git a/ld/testsuite/ld-mips-elf/undefweak-overflow.d b/ld/testsuite/ld-mips-elf/undefweak-overflow.d
index 18b3a900094..4dc5814e232 100644
--- a/ld/testsuite/ld-mips-elf/undefweak-overflow.d
+++ b/ld/testsuite/ld-mips-elf/undefweak-overflow.d
@@ -1,23 +1,27 @@
#name: undefined weak symbol overflow
#source: undefweak-overflow.s
-#as: -32 -EB
-#ld: -melf32btsmip -Ttext=0x20000000 -e start
-#objdump: -dr
+#ld: -Ttext=0x20000000 -e start
+#objdump: -dr --show-raw-insn
#...
-0*20000000: d85fffff.*
-0*20000004: 00000000.*
-0*20000008: f85ffffd.*
-0*2000000c: ec4ffffd.*
-0*20000010: ec5bfffe.*
-0*20000014: cbfffffa.*
-0*20000018: 3c04e000.*
-0*2000001c: 1000fff8.*
-0*20000020: 2484ffe0.*
-0*20000024: 0411fff6.*
-0*20000028: 00000000.*
-0*2000002c: 3c047fd0.*
-0*20000030: 8e670c00.*
-0*20000034: cfe50c00.*
-0*20000038: 9400ffe2.*
-0*2000003c: 0c000c00.*
+0*20000000 <_ftext>:
+ *20000000: d85fffff beqzc v0,20000000 <_ftext>
+ *20000004: 00000000 nop
+ *20000008: f85ffffd bnezc v0,20000000 <_ftext>
+ *2000000c: ec4ffffd lwpc v0,20000000 <_ftext>
+ *20000010: ec5bfffe ldpc v0,20000000 <_ftext>
+ *20000014: cbfffffa bc 20000000 <_ftext>
+ *20000018: ec9ee000 auipc a0,0xe000
+ *2000001c: 2484ffe8 addiu a0,a0,-24
+ *20000020: 1000fff7 b 20000000 <_ftext>
+ *20000024: 00000000 nop
+ *20000028: 0411fff5 bal 20000000 <_ftext>
+ *2000002c: 3c...... lui a0,0x....
+
+0*20000030 <micro>:
+ *20000030: 8e67 beqz a0,20000000 <_ftext>
+ *20000032: 0c00 nop
+ *20000034: cfe5 b 20000000 <_ftext>
+ *20000036: 0c00 nop
+ *20000038: 9400 ffe2 b 20000000 <_ftext>
+ *2000003c: 0c00 nop
#pass
diff --git a/ld/testsuite/ld-mips-elf/undefweak-overflow.s b/ld/testsuite/ld-mips-elf/undefweak-overflow.s
index 525f11b14e6..2cec4b9b629 100644
--- a/ld/testsuite/ld-mips-elf/undefweak-overflow.s
+++ b/ld/testsuite/ld-mips-elf/undefweak-overflow.s
@@ -1,25 +1,32 @@
# relocs against undefined weak symbols should not be treated as
# overflowing
-
+ .module mips64r6
.globl start
.weak foo
start:
+ .set noreorder
.set mips64r6
beqzc $2, foo
+ nop
bnezc $2, foo
lwpc $2, foo
ldpc $2, foo
bc foo
- lui $4, %pcrel_hi(foo)
- addiu $4, $4, %pcrel_lo(foo)
+ auipc $4, %pcrel_hi(foo)
+ addiu $4, $4, %pcrel_lo(foo+4)
- .set mips32r2
- b foo
- bal foo
- lui $4, %gp_rel(foo)
+ b foo
+ nop
+ bal foo
+ lui $4, %gp_rel(foo)
+ .set mips32r2
.set micromips
- beqz16 $4, foo
- b16 foo
- b foo
+micro:
+ beqz16 $4, foo
+ nop
+ b16 foo
+ nop
+ b foo
+ nop