summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-mips-elf
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-mips-elf')
-rw-r--r--ld/testsuite/ld-mips-elf/mips-elf.exp2
-rw-r--r--ld/testsuite/ld-mips-elf/reloc-local-overflow.d7
-rw-r--r--ld/testsuite/ld-mips-elf/reloc-local-overflow.s8
3 files changed, 17 insertions, 0 deletions
diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp
index f9bbcec5dcc..0c2a93b15c7 100644
--- a/ld/testsuite/ld-mips-elf/mips-elf.exp
+++ b/ld/testsuite/ld-mips-elf/mips-elf.exp
@@ -440,6 +440,8 @@ if { $has_newabi } {
"reloc-6b"]]
}
+run_dump_test "reloc-local-overflow" [list [list ld $abi_ldflags(o32)]]
+
if {$has_newabi && $linux_gnu} {
run_dump_test "eh-frame1-n32"
run_dump_test "eh-frame1-n64"
diff --git a/ld/testsuite/ld-mips-elf/reloc-local-overflow.d b/ld/testsuite/ld-mips-elf/reloc-local-overflow.d
new file mode 100644
index 00000000000..b5512eef15a
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/reloc-local-overflow.d
@@ -0,0 +1,7 @@
+#name: MIPS reloc against local symbol overflow
+#source: reloc-local-overflow.s
+#as: -EB -32
+#ld: -EB -Tdata 0x10000 -e 0
+#error: \A[^\n]*:\(\.data\+0x1000\): relocation truncated to fit: R_MIPS_16 against `\.data'\Z
+
+# Verify that the section name (`.data') is printed rather than `no symbol'.
diff --git a/ld/testsuite/ld-mips-elf/reloc-local-overflow.s b/ld/testsuite/ld-mips-elf/reloc-local-overflow.s
new file mode 100644
index 00000000000..a07255c3f78
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/reloc-local-overflow.s
@@ -0,0 +1,8 @@
+ .data
+ .space 0x1000
+
+ .align 2
+ .type bar, @object
+bar:
+ .half bar
+ .size bar, . - bar