This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] MIPS/LD/testsuite: Add microMIPS lazy binding stub tests


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d68033ea86780183c2a2a28077fe495acde5887c

commit d68033ea86780183c2a2a28077fe495acde5887c
Author: Maciej W. Rozycki <macro@mips.com>
Date:   Sat Jun 9 01:09:23 2018 +0100

    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:
---
 ld/ChangeLog                                       | 25 +++++++++++
 ld/testsuite/ld-mips-elf/mips-elf.exp              | 51 ++++++++++++----------
 .../ld-mips-elf/stub-dynsym-micromips-1-10000.d    | 17 ++++++++
 .../ld-mips-elf/stub-dynsym-micromips-1-2fe80.d    | 17 ++++++++
 .../ld-mips-elf/stub-dynsym-micromips-1-7fff.d     | 15 +++++++
 .../ld-mips-elf/stub-dynsym-micromips-1-8000.d     | 15 +++++++
 .../ld-mips-elf/stub-dynsym-micromips-1-fff0.d     | 15 +++++++
 .../stub-dynsym-micromips-insn32-1-10000.d         | 18 ++++++++
 .../stub-dynsym-micromips-insn32-1-2fe80.d         | 18 ++++++++
 .../stub-dynsym-micromips-insn32-1-7fff.d          | 16 +++++++
 .../stub-dynsym-micromips-insn32-1-8000.d          | 16 +++++++
 .../stub-dynsym-micromips-insn32-1-fff0.d          | 16 +++++++
 12 files changed, 217 insertions(+), 22 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 6b78e5c..c6bd13f 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,30 @@
 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
 	comment associated with lazy binding stub tests.
 
diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp
index d688867..b8d7882 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 0000000..d2823f3
--- /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 0000000..62faf59
--- /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 0000000..12bb077
--- /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 0000000..82df256
--- /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 0000000..8775bd2
--- /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 0000000..1e01c51
--- /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 0000000..d4609d9
--- /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 0000000..e6c36d5
--- /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 0000000..f7a6f31
--- /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 0000000..4013f89
--- /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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]