MIPS/LD/testsuite: Add microMIPS lazy binding stub tests
authorMaciej W. Rozycki <macro@mips.com>
Sat, 9 Jun 2018 00:09:23 +0000 (01:09 +0100)
committerMaciej W. Rozycki <macro@mips.com>
Sat, 9 Jun 2018 00:09:23 +0000 (01:09 +0100)
Adapt the existing regular MIPS lazy binding stub tests for microMIPS
code verification.  Check both regular and `--insn32' variants.

Correct indentation issues in the conditional updated.

ld/
* testsuite/ld-mips-elf/stub-dynsym-micromips-1-7fff.d: New
test.
* testsuite/ld-mips-elf/stub-dynsym-micromips-1-8000.d: New
test.
* testsuite/ld-mips-elf/stub-dynsym-micromips-1-fff0.d: New
test.
* testsuite/ld-mips-elf/stub-dynsym-micromips-1-10000.d: New
test.
* testsuite/ld-mips-elf/stub-dynsym-micromips-1-2fe80.d: New
test.
* testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-7fff.d:
New test.
* testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-8000.d:
New test.
* testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-fff0.d:
New test.
* testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-10000.d:
New test.
* testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-2fe80.d:
New test.
* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.  Fix
indentation.

12 files changed:
ld/ChangeLog
ld/testsuite/ld-mips-elf/mips-elf.exp
ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-10000.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-2fe80.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-7fff.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-8000.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-fff0.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-10000.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-2fe80.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-7fff.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-8000.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-fff0.d [new file with mode: 0644]

index 6b78e5cc60a8734f2a9f6d6980244b85ea2c4eb2..c6bd13f3c098a60798bdd6085350bffcb539b944 100644 (file)
@@ -1,3 +1,28 @@
+2018-06-09  Maciej W. Rozycki  <macro@mips.com>
+
+       * testsuite/ld-mips-elf/stub-dynsym-micromips-1-7fff.d: New
+       test.
+       * testsuite/ld-mips-elf/stub-dynsym-micromips-1-8000.d: New
+       test.
+       * testsuite/ld-mips-elf/stub-dynsym-micromips-1-fff0.d: New
+       test.
+       * testsuite/ld-mips-elf/stub-dynsym-micromips-1-10000.d: New
+       test.
+       * testsuite/ld-mips-elf/stub-dynsym-micromips-1-2fe80.d: New
+       test.
+       * testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-7fff.d:
+       New test.
+       * testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-8000.d:
+       New test.
+       * testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-fff0.d:
+       New test.
+       * testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-10000.d:
+       New test.
+       * testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-2fe80.d:
+       New test.
+       * testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.  Fix
+       indentation.
+
 2018-06-09  Maciej W. Rozycki  <macro@mips.com>
 
        * testsuite/ld-mips-elf/mips-elf.exp: Update symbol count in the
index d68886724e073ef8f7483162b8dfedc0f5cb07ca..b8d78827e38ccf59e503a0c9101395928fe4d1dd 100644 (file)
@@ -782,28 +782,35 @@ run_dump_test "hash1b"
 run_dump_test "hash1c"
 
 if {[istarget mips*-*-linux*]} {
-     # The number of symbols that are always included in the symbol table
-     # for these tests.  The 2 are:
-     #
-     #     the null symbol entry
-     #     the .MIPS.stubs section symbol
-     set base_syms 2
-     foreach dynsym { 7fff 8000 fff0 10000 2fe80 } {
-        run_ld_link_tests \
-            [list [list \
-                       "Stub for dynsym 0x$dynsym" \
-                       "-shared -melf32btsmip -T stub-dynsym-1.ld" "" \
-                       [concat \
-                            "-EB -march=mips1 -32 -KPIC" \
-                            "--defsym base_syms=$base_syms" \
-                            "--defsym dynsym=0x$dynsym"] \
-                       [list "stub-dynsym-1.s"] \
-                       [list [list \
-                                  "objdump" "-dz" \
-                                  "stub-dynsym-1-$dynsym.d"]] \
-                       "stub-dynsym-1-$dynsym"]]
-     }
- }
+    # The number of symbols that are always included in the symbol table
+    # for these tests.  The 2 are:
+    #
+    #     the null symbol entry
+    #     the .MIPS.stubs section symbol
+    set base_syms 2
+    foreach { isa aflag lflag suffix } \
+       { MIPS -march=mips1 "" "" \
+         microMIPS -mmicromips "" -micromips \
+         "microMIPS insn32" "-mmicromips -minsn32" --insn32 \
+             -micromips-insn32 } {
+       foreach dynsym { 7fff 8000 fff0 10000 2fe80 } {
+           run_ld_link_tests \
+               [list [list \
+                          "Stub for dynsym 0x$dynsym ($isa)" \
+                          "-shared -melf32btsmip -T stub-dynsym-1.ld $lflag" \
+                          "" \
+                          [concat \
+                               "-EB $aflag -32 -KPIC" \
+                               "--defsym base_syms=$base_syms" \
+                               "--defsym dynsym=0x$dynsym"] \
+                          [list "stub-dynsym-1.s"] \
+                          [list [list \
+                                     "objdump" "-dz" \
+                                     "stub-dynsym$suffix-1-$dynsym.d"]] \
+                          "stub-dynsym$suffix-1-$dynsym"]]
+       }
+    }
+}
 
 # For tests which may involve multiple files, use run_ld_link_tests.
 
diff --git a/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-10000.d b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-10000.d
new file mode 100644 (file)
index 0000000..d2823f3
--- /dev/null
@@ -0,0 +1,17 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.MIPS\.stubs:
+
+.* <_MIPS_STUBS_>:
+.*:    ff3c 8010       lw      t9,-32752\(gp\)
+.*:    0dff            move    t7,ra
+.*:    41b8 0001       lui     t8,0x1
+.*:    45d9            jalr    t9
+.*:    5318 0000       ori     t8,t8,0x0
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+
+Disassembly of section \.text:
+#pass
diff --git a/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-2fe80.d b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-2fe80.d
new file mode 100644 (file)
index 0000000..62faf59
--- /dev/null
@@ -0,0 +1,17 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.MIPS\.stubs:
+
+.* <_MIPS_STUBS_>:
+.*:    ff3c 8010       lw      t9,-32752\(gp\)
+.*:    0dff            move    t7,ra
+.*:    41b8 0002       lui     t8,0x2
+.*:    45d9            jalr    t9
+.*:    5318 fe80       ori     t8,t8,0xfe80
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+
+Disassembly of section \.text:
+#pass
diff --git a/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-7fff.d b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-7fff.d
new file mode 100644 (file)
index 0000000..12bb077
--- /dev/null
@@ -0,0 +1,15 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.MIPS\.stubs:
+
+.* <_MIPS_STUBS_>:
+.*:    ff3c 8010       lw      t9,-32752\(gp\)
+.*:    0dff            move    t7,ra
+.*:    45d9            jalr    t9
+.*:    3300 7fff       li      t8,32767
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+
+Disassembly of section \.text:
+#pass
diff --git a/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-8000.d b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-8000.d
new file mode 100644 (file)
index 0000000..82df256
--- /dev/null
@@ -0,0 +1,15 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.MIPS\.stubs:
+
+.* <_MIPS_STUBS_>:
+.*:    ff3c 8010       lw      t9,-32752\(gp\)
+.*:    0dff            move    t7,ra
+.*:    45d9            jalr    t9
+.*:    5300 8000       li      t8,0x8000
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+
+Disassembly of section \.text:
+#pass
diff --git a/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-fff0.d b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-fff0.d
new file mode 100644 (file)
index 0000000..8775bd2
--- /dev/null
@@ -0,0 +1,15 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.MIPS\.stubs:
+
+.* <_MIPS_STUBS_>:
+.*:    ff3c 8010       lw      t9,-32752\(gp\)
+.*:    0dff            move    t7,ra
+.*:    45d9            jalr    t9
+.*:    5300 fff0       li      t8,0xfff0
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+
+Disassembly of section \.text:
+#pass
diff --git a/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-10000.d b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-10000.d
new file mode 100644 (file)
index 0000000..1e01c51
--- /dev/null
@@ -0,0 +1,18 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.MIPS\.stubs:
+
+.* <_MIPS_STUBS_>:
+.*:    ff3c 8010       lw      t9,-32752\(gp\)
+.*:    001f 7a90       move    t7,ra
+.*:    41b8 0001       lui     t8,0x1
+.*:    03f9 0f3c       jalr    t9
+.*:    5318 0000       ori     t8,t8,0x0
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+
+Disassembly of section \.text:
+#pass
diff --git a/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-2fe80.d b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-2fe80.d
new file mode 100644 (file)
index 0000000..d4609d9
--- /dev/null
@@ -0,0 +1,18 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.MIPS\.stubs:
+
+.* <_MIPS_STUBS_>:
+.*:    ff3c 8010       lw      t9,-32752\(gp\)
+.*:    001f 7a90       move    t7,ra
+.*:    41b8 0002       lui     t8,0x2
+.*:    03f9 0f3c       jalr    t9
+.*:    5318 fe80       ori     t8,t8,0xfe80
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+
+Disassembly of section \.text:
+#pass
diff --git a/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-7fff.d b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-7fff.d
new file mode 100644 (file)
index 0000000..e6c36d5
--- /dev/null
@@ -0,0 +1,16 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.MIPS\.stubs:
+
+.* <_MIPS_STUBS_>:
+.*:    ff3c 8010       lw      t9,-32752\(gp\)
+.*:    001f 7a90       move    t7,ra
+.*:    03f9 0f3c       jalr    t9
+.*:    3300 7fff       li      t8,32767
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+
+Disassembly of section \.text:
+#pass
diff --git a/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-8000.d b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-8000.d
new file mode 100644 (file)
index 0000000..f7a6f31
--- /dev/null
@@ -0,0 +1,16 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.MIPS\.stubs:
+
+.* <_MIPS_STUBS_>:
+.*:    ff3c 8010       lw      t9,-32752\(gp\)
+.*:    001f 7a90       move    t7,ra
+.*:    03f9 0f3c       jalr    t9
+.*:    5300 8000       li      t8,0x8000
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+
+Disassembly of section \.text:
+#pass
diff --git a/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-fff0.d b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-fff0.d
new file mode 100644 (file)
index 0000000..4013f89
--- /dev/null
@@ -0,0 +1,16 @@
+.*: +file format .*mips.*
+
+Disassembly of section \.MIPS\.stubs:
+
+.* <_MIPS_STUBS_>:
+.*:    ff3c 8010       lw      t9,-32752\(gp\)
+.*:    001f 7a90       move    t7,ra
+.*:    03f9 0f3c       jalr    t9
+.*:    5300 fff0       li      t8,0xfff0
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+.*:    0000 0000       nop
+
+Disassembly of section \.text:
+#pass