aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-mips-elf
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-mips-elf')
-rw-r--r--ld/testsuite/ld-mips-elf/mips-elf.exp14
-rw-r--r--ld/testsuite/ld-mips-elf/mips16-pic-4.ver8
-rw-r--r--ld/testsuite/ld-mips-elf/mips16-pic-4a.dd23
-rw-r--r--ld/testsuite/ld-mips-elf/mips16-pic-4a.gd13
-rw-r--r--ld/testsuite/ld-mips-elf/mips16-pic-4a.nd10
-rw-r--r--ld/testsuite/ld-mips-elf/mips16-pic-4a.s33
-rw-r--r--ld/testsuite/ld-mips-elf/mips16-pic-4b.dd35
-rw-r--r--ld/testsuite/ld-mips-elf/mips16-pic-4b.s15
-rw-r--r--ld/testsuite/ld-mips-elf/mips16-pic-4c.s38
9 files changed, 188 insertions, 1 deletions
diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp
index 72964f9..fa098b1 100644
--- a/ld/testsuite/ld-mips-elf/mips-elf.exp
+++ b/ld/testsuite/ld-mips-elf/mips-elf.exp
@@ -84,7 +84,19 @@ if { $linux_gnu } {
{ { objdump -dr mips16-pic-3.dd } \
{ readelf --relocs mips16-pic-3.rd } \
{ readelf -A mips16-pic-3.gd } } \
- "mips16-pic-3"]]
+ "mips16-pic-3"] \
+ [list "MIPS16 PIC test 4 (shared library)" \
+ "-shared -melf32btsmip -T mips16-pic-1.ld --version-script mips16-pic-4.ver" \
+ "-EB -32" { mips16-pic-4a.s mips16-pic-4b.s } \
+ { { objdump -dr mips16-pic-4a.dd } \
+ { readelf --symbols mips16-pic-4a.nd } \
+ { readelf -A mips16-pic-4a.gd } } \
+ "mips16-pic-4.so"] \
+ [list "MIPS16 PIC test 4 (executable)" \
+ "-melf32btsmip -T mips16-pic-1.ld tmpdir/mips16-pic-4.so" \
+ "-EB -32" { mips16-pic-4c.s } \
+ { { objdump -dr mips16-pic-4b.dd } } \
+ "mips16-pic-4"]]
}
if { [istarget mips64*-linux-gnu] } {
diff --git a/ld/testsuite/ld-mips-elf/mips16-pic-4.ver b/ld/testsuite/ld-mips-elf/mips16-pic-4.ver
new file mode 100644
index 0000000..fc7b185
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/mips16-pic-4.ver
@@ -0,0 +1,8 @@
+V1 {
+ global:
+ f1;
+ f2;
+ f3;
+ local:
+ *;
+};
diff --git a/ld/testsuite/ld-mips-elf/mips16-pic-4a.dd b/ld/testsuite/ld-mips-elf/mips16-pic-4a.dd
new file mode 100644
index 0000000..d4e4f22
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/mips16-pic-4a.dd
@@ -0,0 +1,23 @@
+
+.*
+
+
+Disassembly of section \.text:
+
+00040400 <f2>:
+.* jr ra
+.* nop
+
+00040408 <f3>:
+.* jr ra
+.* nop
+
+00040410 <_f1>:
+.* jr ra
+.* nop
+#...
+
+00040420 <f1@@V1>:
+.* lw t9,-32744\(gp\)
+.* jr t9
+.* mfc1 a0,\$f12
diff --git a/ld/testsuite/ld-mips-elf/mips16-pic-4a.gd b/ld/testsuite/ld-mips-elf/mips16-pic-4a.gd
new file mode 100644
index 0000000..1ab835e
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/mips16-pic-4a.gd
@@ -0,0 +1,13 @@
+
+Primary GOT:
+ Canonical gp value: 00057ff0
+
+ Reserved entries:
+ Address Access Initial Purpose
+ 00050000 -32752\(gp\) 00000000 Lazy resolver
+ 00050004 -32748\(gp\) 80000000 Module pointer \(GNU extension\)
+
+ Local entries:
+ Address Access Initial
+ 00050008 -32744\(gp\) 00040411
+
diff --git a/ld/testsuite/ld-mips-elf/mips16-pic-4a.nd b/ld/testsuite/ld-mips-elf/mips16-pic-4a.nd
new file mode 100644
index 0000000..6eca610
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/mips16-pic-4a.nd
@@ -0,0 +1,10 @@
+
+Symbol table '\.dynsym' contains 6 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 00040400 0 SECTION LOCAL DEFAULT .*
+ 2: 00040420 12 FUNC GLOBAL DEFAULT .* f1@@V1
+ 3: 00000000 0 OBJECT GLOBAL DEFAULT ABS V1
+ 4: 00040408 8 FUNC GLOBAL DEFAULT .* f3@@V1
+ 5: 00040400 8 FUNC GLOBAL DEFAULT .* f2@@V1
+#pass
diff --git a/ld/testsuite/ld-mips-elf/mips16-pic-4a.s b/ld/testsuite/ld-mips-elf/mips16-pic-4a.s
new file mode 100644
index 0000000..812d9d7
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/mips16-pic-4a.s
@@ -0,0 +1,33 @@
+ .abicalls
+ .set noreorder
+
+ # Define a stub for f1, which is defined in another file.
+ #
+ # (It's questionable whether defining the stub and real function
+ # in separate files is really valid or useful. However, if we
+ # accept it without error, we should do something useful with it.)
+
+ .section .mips16.fn.f1, "ax", @progbits
+ .ent __fn
+__fn:
+ .reloc 0,R_MIPS_NONE,f1
+ la $25,_f1
+ jr $25
+ mfc1 $4,$f12
+ .end __fn
+
+ # Define dummy functions for the executable to call.
+
+ .macro dummy,name
+ .text
+ .global \name
+ .type \name,@function
+ .ent \name
+\name:
+ jr $31
+ nop
+ .end \name
+ .endm
+
+ dummy f2
+ dummy f3
diff --git a/ld/testsuite/ld-mips-elf/mips16-pic-4b.dd b/ld/testsuite/ld-mips-elf/mips16-pic-4b.dd
new file mode 100644
index 0000000..ddc55c3
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/mips16-pic-4b.dd
@@ -0,0 +1,35 @@
+
+.*
+
+
+Disassembly of section \.text:
+
+00040400 <__start>:
+.* jalx 40410 <__call>
+.* nop
+.* jalx 40420 <__call_fp>
+.* nop
+#...
+
+00040410 <__call>:
+.*0004 lui t9,.*
+.*0460 addiu t9,t9,.*
+.* jr t9
+.* nop
+
+00040420 <__call_fp>:
+.*0004 lui t9,.*
+.*0470 addiu t9,t9,.*
+.* jr t9
+.* nop
+
+Disassembly of section \.plt:
+
+00040440 <_PROCEDURE_LINKAGE_TABLE_>:
+#...
+
+00040460 <f2@plt>:
+#...
+
+00040470 <f3@plt>:
+#...
diff --git a/ld/testsuite/ld-mips-elf/mips16-pic-4b.s b/ld/testsuite/ld-mips-elf/mips16-pic-4b.s
new file mode 100644
index 0000000..9cb5cb4
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/mips16-pic-4b.s
@@ -0,0 +1,15 @@
+ .abicalls
+ .set noreorder
+
+ # Define a MIPS16 function f1@@V1.
+
+ .global _f1
+ .symver _f1,f1@@V1
+
+ .set mips16
+ .type _f1,@function
+ .ent _f1
+_f1:
+ jr $31
+ nop
+ .end _f1
diff --git a/ld/testsuite/ld-mips-elf/mips16-pic-4c.s b/ld/testsuite/ld-mips-elf/mips16-pic-4c.s
new file mode 100644
index 0000000..338d378
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/mips16-pic-4c.s
@@ -0,0 +1,38 @@
+ .abicalls
+ .option pic0
+ .set noreorder
+
+ # Create a call stub for f2. We pretend that f2 takes floating-point
+ # arguments but doesn't return a floating-point value.
+
+ .section .mips16.call.f2, "ax", @progbits
+ .ent __call
+__call:
+ la $25,f2
+ jr $25
+ nop
+ .end __call
+
+ # Create a call stub for f3. We pretend that f3 returns a
+ # floating-point value.
+
+ .section .mips16.call.fp.f3, "ax", @progbits
+ .ent __call_fp
+__call_fp:
+ la $25,f3
+ jr $25
+ nop
+ .end __call_fp
+
+ # Make sure that f2 and f3 are called from MIPS16 code.
+ .set mips16
+ .text
+ .global __start
+ .type __start,@function
+ .ent __start
+__start:
+ jal f2
+ nop
+ jal f3
+ nop
+ .end __start