Fix undefined weak symbol reloc tests
authorMatthew Fortune <matthew.fortune@imgtec.com>
Thu, 18 Dec 2014 20:08:38 +0000 (20:08 +0000)
committerMatthew Fortune <matthew.fortune@imgtec.com>
Fri, 19 Dec 2014 14:19:42 +0000 (14:19 +0000)
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.

ld/testsuite/ChangeLog
ld/testsuite/ld-mips-elf/mips-elf.exp
ld/testsuite/ld-mips-elf/undefweak-overflow-n32.d [deleted file]
ld/testsuite/ld-mips-elf/undefweak-overflow-n64.d [deleted file]
ld/testsuite/ld-mips-elf/undefweak-overflow.d
ld/testsuite/ld-mips-elf/undefweak-overflow.s

index bcdcf0b14614372a44439a9c06c93b2459c96c05..944be426f502ce3f534ca936594d80e8e6b8d95e 100644 (file)
@@ -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
index 21c809fafce09d3cb0c3d0f124eb9e4e624178aa..7b901c6f710b7f59c25e24ec30eb77841beb2a3f 100644 (file)
@@ -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 (file)
index 4d965b8..0000000
+++ /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 (file)
index e0d9fda..0000000
+++ /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
index 18b3a900094a0e13e0324de829800d61cd1cf13a..4dc5814e232601bddbf72bd8ddaadfb1b34a0516 100644 (file)
@@ -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
index 525f11b14e6875304381d3b2851492f5b4cb842a..2cec4b9b629b3f0365d6f2e21ac7a7b535b5c7eb 100644 (file)
@@ -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