From: Maciej W. Rozycki Date: Sat, 9 Jun 2018 00:09:23 +0000 (+0100) Subject: MIPS/LD/testsuite: Add microMIPS lazy binding stub tests X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d68033ea86780183c2a2a28077fe495acde5887c;p=binutils-gdb.git MIPS/LD/testsuite: Add microMIPS lazy binding stub tests 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. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 6b78e5cc60a..c6bd13f3c09 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,28 @@ +2018-06-09 Maciej W. Rozycki + + * 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 * testsuite/ld-mips-elf/mips-elf.exp: Update symbol count in the diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp index d68886724e0..b8d78827e38 100644 --- a/ld/testsuite/ld-mips-elf/mips-elf.exp +++ b/ld/testsuite/ld-mips-elf/mips-elf.exp @@ -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 index 00000000000..d2823f39cf7 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-10000.d @@ -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 index 00000000000..62faf59a345 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-2fe80.d @@ -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 index 00000000000..12bb077d07c --- /dev/null +++ b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-7fff.d @@ -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 index 00000000000..82df2567a8f --- /dev/null +++ b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-8000.d @@ -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 index 00000000000..8775bd2d17b --- /dev/null +++ b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-1-fff0.d @@ -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 index 00000000000..1e01c51e3fa --- /dev/null +++ b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-10000.d @@ -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 index 00000000000..d4609d98197 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-2fe80.d @@ -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 index 00000000000..e6c36d54f73 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-7fff.d @@ -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 index 00000000000..f7a6f311b36 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-8000.d @@ -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 index 00000000000..4013f892691 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-fff0.d @@ -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