aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog25
-rw-r--r--ld/testsuite/ld-mips-elf/empic1-ln.d27
-rw-r--r--ld/testsuite/ld-mips-elf/empic1-lp.d26
-rw-r--r--ld/testsuite/ld-mips-elf/empic1-mn.d25
-rw-r--r--ld/testsuite/ld-mips-elf/empic1-mp.d25
-rw-r--r--ld/testsuite/ld-mips-elf/empic1-ref.s9
-rw-r--r--ld/testsuite/ld-mips-elf/empic1-sn.d23
-rw-r--r--ld/testsuite/ld-mips-elf/empic1-sp.d23
-rw-r--r--ld/testsuite/ld-mips-elf/empic1-space.s5
-rw-r--r--ld/testsuite/ld-mips-elf/empic1-tgt.s8
-rw-r--r--ld/testsuite/ld-mips-elf/empic2-fwd-0.d20
-rw-r--r--ld/testsuite/ld-mips-elf/empic2-fwd-1.d21
-rw-r--r--ld/testsuite/ld-mips-elf/empic2-fwd-tgt.s7
-rw-r--r--ld/testsuite/ld-mips-elf/empic2-ref.s6
-rw-r--r--ld/testsuite/ld-mips-elf/empic2-rev-0.d22
-rw-r--r--ld/testsuite/ld-mips-elf/empic2-rev-1.d24
-rw-r--r--ld/testsuite/ld-mips-elf/empic2-rev-tgt.s8
-rw-r--r--ld/testsuite/ld-mips-elf/empic2-space.s5
-rw-r--r--ld/testsuite/ld-mips-elf/mips-elf.exp38
19 files changed, 347 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 42a495e..17f8157 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,28 @@
+2002-01-02 Chris Demetriou <cgd@broadcom.com>
+
+ * ld-mips-elf/empic1-ln.d: New file to test basic linking of
+ R_MIPS_GNU_REL_HI16 and R_MIPS_GNU_REL_LO16 relocations.
+ * ld-mips-elf/empic1-lp.d: Likewise.
+ * ld-mips-elf/empic1-mn.d: Likewise.
+ * ld-mips-elf/empic1-mp.d: Likewise.
+ * ld-mips-elf/empic1-sn.d: Likewise.
+ * ld-mips-elf/empic1-sp.d: Likewise.
+ * ld-mips-elf/empic1-ref.s: Likewise.
+ * ld-mips-elf/empic1-space.s: Likewise.
+ * ld-mips-elf/empic1-tgt.s: Likewise.
+ * ld-mips-elf/empic2-fwd-0.d: New file to test
+ R_MIPS_GNU_REL_HI16 and R_MIPS_GNU_REL_LO16 relocation edge
+ cases.
+ * ld-mips-elf/empic2-fwd-1.d: Likewise.
+ * ld-mips-elf/empic2-rev-0.d: Likewise.
+ * ld-mips-elf/empic2-rev-1.d: Likewise.
+ * ld-mips-elf/empic2-ref.s: Likewise.
+ * ld-mips-elf/empic2-space.s: Likewise.
+ * ld-mips-elf/empic2-fwd-tgt.s: Likewise.
+ * ld-mips-elf/empic2-rev-tgt.s: Likewise.
+ * ld-mips-elf/mips-elf.exp: New file to run MIPS 32-bit ELF
+ tests (including those above).
+
2001-11-30 H.J. Lu <hjl@gnu.org>
* ld-elfvers/vers.exp (build_vers_lib): Preserve the library
diff --git a/ld/testsuite/ld-mips-elf/empic1-ln.d b/ld/testsuite/ld-mips-elf/empic1-ln.d
new file mode 100644
index 0000000..eb78478
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/empic1-ln.d
@@ -0,0 +1,27 @@
+#name: MIPS 32-bit ELF embedded-pic relocs #1-ln (large negative)
+#as: -membedded-pic -mips3
+#source: empic1-tgt.s
+#source: empic1-space.s
+#source: empic1-space.s
+#source: empic1-ref.s
+#objdump: --prefix-addresses -tdr --show-raw-insn -mmips:4000
+#ld: -Ttext 0x400000 -e 0x400000
+
+.*: file format elf.*mips.*
+
+SYMBOL TABLE:
+#...
+0+410020 g F .text [0-9a-f]+ foo
+#...
+0+400000 g F .text [0-9a-f]+ bar
+#...
+
+Disassembly of section \.text:
+ ...
+ ...
+ ...
+0+410020 <[^>]*> 00000000 nop
+0+410024 <[^>]*> 3c02ffff lui v0,0xffff
+0+410028 <[^>]*> 6442ffe0 daddiu v0,v0,-32
+ ...
+#pass
diff --git a/ld/testsuite/ld-mips-elf/empic1-lp.d b/ld/testsuite/ld-mips-elf/empic1-lp.d
new file mode 100644
index 0000000..bd11e52
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/empic1-lp.d
@@ -0,0 +1,26 @@
+#name: MIPS 32-bit ELF embedded-pic relocs #1-lp (large positive)
+#as: -membedded-pic -mips3
+#source: empic1-ref.s
+#source: empic1-space.s
+#source: empic1-space.s
+#source: empic1-tgt.s
+#objdump: --prefix-addresses -tdr --show-raw-insn -mmips:4000
+#ld: -Ttext 0x400000 -e 0x400000
+
+.*: file format elf.*mips.*
+
+SYMBOL TABLE:
+#...
+0+400000 g F .text [0-9a-f]+ foo
+#...
+0+410020 g F .text [0-9a-f]+ bar
+#...
+
+Disassembly of section \.text:
+0+400000 <[^>]*> 00000000 nop
+0+400004 <[^>]*> 3c020001 lui v0,0x1
+0+400008 <[^>]*> 64420020 daddiu v0,v0,32
+ ...
+ ...
+ ...
+#pass
diff --git a/ld/testsuite/ld-mips-elf/empic1-mn.d b/ld/testsuite/ld-mips-elf/empic1-mn.d
new file mode 100644
index 0000000..fa43abf
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/empic1-mn.d
@@ -0,0 +1,25 @@
+#name: MIPS 32-bit ELF embedded-pic relocs #1-mn (medium negative)
+#as: -membedded-pic -mips3
+#source: empic1-tgt.s
+#source: empic1-space.s
+#source: empic1-ref.s
+#objdump: --prefix-addresses -tdr --show-raw-insn -mmips:4000
+#ld: -Ttext 0x400000 -e 0x400000
+
+.*: file format elf.*mips.*
+
+SYMBOL TABLE:
+#...
+0+408020 g F .text [0-9a-f]+ foo
+#...
+0+400000 g F .text [0-9a-f]+ bar
+#...
+
+Disassembly of section \.text:
+ ...
+ ...
+0+408020 <[^>]*> 00000000 nop
+0+408024 <[^>]*> 3c02ffff lui v0,0xffff
+0+408028 <[^>]*> 64427fe0 daddiu v0,v0,32736
+ ...
+#pass
diff --git a/ld/testsuite/ld-mips-elf/empic1-mp.d b/ld/testsuite/ld-mips-elf/empic1-mp.d
new file mode 100644
index 0000000..27d1574
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/empic1-mp.d
@@ -0,0 +1,25 @@
+#name: MIPS 32-bit ELF embedded-pic relocs #1-mp (medium positive)
+#as: -membedded-pic -mips3
+#source: empic1-ref.s
+#source: empic1-space.s
+#source: empic1-tgt.s
+#objdump: --prefix-addresses -tdr --show-raw-insn -mmips:4000
+#ld: -Ttext 0x400000 -e 0x400000
+
+.*: file format elf.*mips.*
+
+SYMBOL TABLE:
+#...
+0+400000 g F .text [0-9a-f]+ foo
+#...
+0+408020 g F .text [0-9a-f]+ bar
+#...
+
+Disassembly of section \.text:
+0+400000 <[^>]*> 00000000 nop
+0+400004 <[^>]*> 3c020001 lui v0,0x1
+0+400008 <[^>]*> 64428020 daddiu v0,v0,-32736
+ ...
+ ...
+ ...
+#pass
diff --git a/ld/testsuite/ld-mips-elf/empic1-ref.s b/ld/testsuite/ld-mips-elf/empic1-ref.s
new file mode 100644
index 0000000..dfa345e
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/empic1-ref.s
@@ -0,0 +1,9 @@
+
+ .globl foo
+ .ent foo
+foo:
+ nop
+ la $2, bar - foo
+ .end foo
+
+ .p2align 5
diff --git a/ld/testsuite/ld-mips-elf/empic1-sn.d b/ld/testsuite/ld-mips-elf/empic1-sn.d
new file mode 100644
index 0000000..6d041ed
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/empic1-sn.d
@@ -0,0 +1,23 @@
+#name: MIPS 32-bit ELF embedded-pic relocs #1-sn (small negative)
+#as: -membedded-pic -mips3
+#source: empic1-tgt.s
+#source: empic1-ref.s
+#objdump: --prefix-addresses -tdr --show-raw-insn -mmips:4000
+#ld: -Ttext 0x400000 -e 0x400000
+
+.*: file format elf.*mips.*
+
+SYMBOL TABLE:
+#...
+0+400020 g F .text [0-9a-f]+ foo
+#...
+0+400000 g F .text [0-9a-f]+ bar
+#...
+
+Disassembly of section \.text:
+ ...
+0+400020 <[^>]*> 00000000 nop
+0+400024 <[^>]*> 3c020000 lui v0,0x0
+0+400028 <[^>]*> 6442ffe0 daddiu v0,v0,-32
+ ...
+#pass
diff --git a/ld/testsuite/ld-mips-elf/empic1-sp.d b/ld/testsuite/ld-mips-elf/empic1-sp.d
new file mode 100644
index 0000000..f91d625
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/empic1-sp.d
@@ -0,0 +1,23 @@
+#name: MIPS 32-bit ELF embedded-pic relocs #1-sp (small positive)
+#as: -membedded-pic -mips3
+#source: empic1-ref.s
+#source: empic1-tgt.s
+#objdump: --prefix-addresses -tdr --show-raw-insn -mmips:4000
+#ld: -Ttext 0x400000 -e 0x400000
+
+.*: file format elf.*mips.*
+
+SYMBOL TABLE:
+#...
+0+400000 g F .text [0-9a-f]+ foo
+#...
+0+400020 g F .text [0-9a-f]+ bar
+#...
+
+Disassembly of section \.text:
+0+400000 <[^>]*> 00000000 nop
+0+400004 <[^>]*> 3c020000 lui v0,0x0
+0+400008 <[^>]*> 64420020 daddiu v0,v0,32
+ ...
+ ...
+#pass
diff --git a/ld/testsuite/ld-mips-elf/empic1-space.s b/ld/testsuite/ld-mips-elf/empic1-space.s
new file mode 100644
index 0000000..9c30cfb
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/empic1-space.s
@@ -0,0 +1,5 @@
+
+ .ent space
+space:
+ .space (32 * 1024)
+ .end space
diff --git a/ld/testsuite/ld-mips-elf/empic1-tgt.s b/ld/testsuite/ld-mips-elf/empic1-tgt.s
new file mode 100644
index 0000000..909488c
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/empic1-tgt.s
@@ -0,0 +1,8 @@
+
+ .globl bar
+ .ent bar
+bar:
+ nop
+ .end bar
+
+ .p2align 5
diff --git a/ld/testsuite/ld-mips-elf/empic2-fwd-0.d b/ld/testsuite/ld-mips-elf/empic2-fwd-0.d
new file mode 100644
index 0000000..e53f1fa
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/empic2-fwd-0.d
@@ -0,0 +1,20 @@
+#name: MIPS 32-bit ELF embedded-pic relocs #2-fwd-0 (0x7ffc forward edge case)
+#as: -membedded-pic -mips3
+#source: empic2-ref.s
+#source: empic2-fwd-tgt.s
+#objdump: --prefix-addresses -tdr --show-raw-insn -mmips:4000
+#ld: -Ttext 0x400000 -e 0x400000
+
+.*: file format elf.*mips.*
+
+#...
+0+400000 g F .text [0-9a-f]+ foo
+#...
+0+407ffc g F .text [0-9a-f]+ bar
+#...
+
+Disassembly of section \.text:
+0+400000 <[^>]*> 3c020000 lui v0,0x0
+0+400004 <[^>]*> 64427ffc daddiu v0,v0,32764
+ ...
+#pass
diff --git a/ld/testsuite/ld-mips-elf/empic2-fwd-1.d b/ld/testsuite/ld-mips-elf/empic2-fwd-1.d
new file mode 100644
index 0000000..e720852
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/empic2-fwd-1.d
@@ -0,0 +1,21 @@
+#name: MIPS 32-bit ELF embedded-pic relocs #2-fwd-1 (0xfffc forward edge case)
+#as: -membedded-pic -mips3
+#source: empic2-ref.s
+#source: empic2-space.s
+#source: empic2-fwd-tgt.s
+#objdump: --prefix-addresses -tdr --show-raw-insn -mmips:4000
+#ld: -Ttext 0x400000 -e 0x400000
+
+.*: file format elf.*mips.*
+
+#...
+0+400000 g F .text [0-9a-f]+ foo
+#...
+0+40fffc g F .text [0-9a-f]+ bar
+#...
+
+Disassembly of section \.text:
+0+400000 <[^>]*> 3c020001 lui v0,0x1
+0+400004 <[^>]*> 6442fffc daddiu v0,v0,-4
+ ...
+#pass
diff --git a/ld/testsuite/ld-mips-elf/empic2-fwd-tgt.s b/ld/testsuite/ld-mips-elf/empic2-fwd-tgt.s
new file mode 100644
index 0000000..915cf45
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/empic2-fwd-tgt.s
@@ -0,0 +1,7 @@
+
+ .space (32768 - 16 - 4) # 16..32764
+
+ .globl bar
+ .ent bar
+bar:
+ .end bar
diff --git a/ld/testsuite/ld-mips-elf/empic2-ref.s b/ld/testsuite/ld-mips-elf/empic2-ref.s
new file mode 100644
index 0000000..c0ae00c
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/empic2-ref.s
@@ -0,0 +1,6 @@
+ .globl foo
+ .ent foo
+foo:
+ la $2,bar-foo
+
+ .p2align 4
diff --git a/ld/testsuite/ld-mips-elf/empic2-rev-0.d b/ld/testsuite/ld-mips-elf/empic2-rev-0.d
new file mode 100644
index 0000000..9bd9acc
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/empic2-rev-0.d
@@ -0,0 +1,22 @@
+#name: MIPS 32-bit ELF embedded-pic relocs #2-rev-0 (0x0004 backward edge case)
+#as: -membedded-pic -mips3
+#source: empic2-rev-tgt.s
+#source: empic2-ref.s
+#objdump: --prefix-addresses -tdr --show-raw-insn -mmips:4000
+#ld: -Ttext 0x400000 -e 0x400000
+
+.*: file format elf.*mips.*
+
+#...
+0+408000 g F .text [0-9a-f]+ foo
+#...
+0+407ffc g F .text [0-9a-f]+ bar
+#...
+
+Disassembly of section \.text:
+ ...
+0+407ffc <[^>]*> 00000000 nop
+0+408000 <[^>]*> 3c020000 lui v0,0x0
+0+408004 <[^>]*> 6442fffc daddiu v0,v0,-4
+ ...
+#pass
diff --git a/ld/testsuite/ld-mips-elf/empic2-rev-1.d b/ld/testsuite/ld-mips-elf/empic2-rev-1.d
new file mode 100644
index 0000000..1a38ec2
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/empic2-rev-1.d
@@ -0,0 +1,24 @@
+#name: MIPS 32-bit ELF embedded-pic relocs #2-rev-1 (0x8004 backward edge case)
+#as: -membedded-pic -mips3
+#source: empic2-rev-tgt.s
+#source: empic2-space.s
+#source: empic2-ref.s
+#objdump: --prefix-addresses -tdr --show-raw-insn -mmips:4000
+#ld: -Ttext 0x400000 -e 0x400000
+
+.*: file format elf.*mips.*
+
+#...
+0+410000 g F .text [0-9a-f]+ foo
+#...
+0+407ffc g F .text [0-9a-f]+ bar
+#...
+
+Disassembly of section \.text:
+ ...
+0+407ffc <[^>]*> 00000000 nop
+ ...
+0+410000 <[^>]*> 3c02ffff lui v0,0xffff
+0+410004 <[^>]*> 64427ffc daddiu v0,v0,32764
+ ...
+#pass
diff --git a/ld/testsuite/ld-mips-elf/empic2-rev-tgt.s b/ld/testsuite/ld-mips-elf/empic2-rev-tgt.s
new file mode 100644
index 0000000..8124cfe
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/empic2-rev-tgt.s
@@ -0,0 +1,8 @@
+
+ .space (32768 - 4)
+
+ .globl bar
+ .ent bar
+bar:
+ .space 4
+ .end bar
diff --git a/ld/testsuite/ld-mips-elf/empic2-space.s b/ld/testsuite/ld-mips-elf/empic2-space.s
new file mode 100644
index 0000000..9c30cfb
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/empic2-space.s
@@ -0,0 +1,5 @@
+
+ .ent space
+space:
+ .space (32 * 1024)
+ .end space
diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp
new file mode 100644
index 0000000..b47b326
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/mips-elf.exp
@@ -0,0 +1,38 @@
+# Expect script for MIPS ELF linker tests
+# Copyright 2002 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+if { [istarget mips*-*-*] } then {
+
+ # Run embedded-pic tests only if generic ELF.
+ if { [istarget mips*-*-elf] } {
+ # Check basic PC-relative HI/LO relocs.
+ run_dump_test "empic1-ln"
+ run_dump_test "empic1-lp"
+ run_dump_test "empic1-mn"
+ run_dump_test "empic1-mp"
+ run_dump_test "empic1-sn"
+ run_dump_test "empic1-sp"
+
+ # PC-relative HI/LO reloc edge-case regression tests.
+ # As of 2001-12-26, the linker botches the fwd-0 and rev-1 tests.
+ run_dump_test "empic2-fwd-0"
+ run_dump_test "empic2-fwd-1"
+ run_dump_test "empic2-rev-0"
+ run_dump_test "empic2-rev-1"
+ }
+}