This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH, MIPS] More meaningful error message on small-data overflow
Thiemo Seufer writes:
> Testcases for both relocations would be a nice addition, but I don't
> insist on them. :-)
Here they are. OK to install?
Adam
* ld-mips-elf/reloc-4.s, ld-mips-elf/reloc-4.d,
ld-mips-elf/reloc-5.s, ld-mips-elf/reloc-5.d: New tests.
Index: ld-mips-elf/mips-elf.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-mips-elf/mips-elf.exp,v
retrieving revision 1.45
diff -F^\([(a-zA-Z0-9_]\|#define\) -u -p -r1.45 mips-elf.exp
--- ld-mips-elf/mips-elf.exp 6 Jul 2007 14:09:44 -0000 1.45
+++ ld-mips-elf/mips-elf.exp 23 Jul 2007 20:26:02 -0000
@@ -114,6 +114,9 @@ run_dump_test "reloc-3"
if {$has_newabi} {
run_dump_test "reloc-3-n32"
}
+run_dump_test "reloc-4"
+run_dump_test "reloc-5"
+
if {$has_newabi && $linux_gnu} {
run_dump_test "eh-frame1-n32"
run_dump_test "eh-frame1-n64"
Index: ld-mips-elf/reloc-4.d
===================================================================
RCS file: ld-mips-elf/reloc-4.d
diff -N ld-mips-elf/reloc-4.d
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ld-mips-elf/reloc-4.d 23 Jul 2007 20:26:02 -0000
@@ -0,0 +1,3 @@
+#source: reloc-4.s
+#ld:
+#error: small-data section exceeds 64KB.*truncated to fit: R_MIPS_LITERAL
Index: ld-mips-elf/reloc-4.s
===================================================================
RCS file: ld-mips-elf/reloc-4.s
diff -N ld-mips-elf/reloc-4.s
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ld-mips-elf/reloc-4.s 23 Jul 2007 20:26:02 -0000
@@ -0,0 +1,7 @@
+ .text
+ .globl _start
+_start:
+ li.d $f2,1.10000000000000000000e0
+
+ .section .sdata
+ .space 0x10000
Index: ld-mips-elf/reloc-5.d
===================================================================
RCS file: ld-mips-elf/reloc-5.d
diff -N ld-mips-elf/reloc-5.d
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ld-mips-elf/reloc-5.d 23 Jul 2007 20:26:02 -0000
@@ -0,0 +1,3 @@
+#source: reloc-5.s
+#ld:
+#error: small-data section exceeds 64KB.*truncated to fit: R_MIPS_GPREL16
Index: ld-mips-elf/reloc-5.s
===================================================================
RCS file: ld-mips-elf/reloc-5.s
diff -N ld-mips-elf/reloc-5.s
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ld-mips-elf/reloc-5.s 23 Jul 2007 20:26:02 -0000
@@ -0,0 +1,11 @@
+ .text
+ .globl _start
+_start:
+ lw $2, %gp_rel(i)($28)
+
+ .section .sdata
+ .space 0x10000
+
+ .section .sbss
+i:
+ .space 4