aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2003-03-11 19:20:16 +0000
committerAlexandre Oliva <aoliva@redhat.com>2003-03-11 19:20:16 +0000
commit48fe7bdacc15bbf455243d1d7d26231aa8292f04 (patch)
tree85524c9fb61395b044ecb4c82ff0c704da141a07
parent908488f19e7e3f91c9129426ad503ed0194eba68 (diff)
downloadgdb-48fe7bdacc15bbf455243d1d7d26231aa8292f04.zip
gdb-48fe7bdacc15bbf455243d1d7d26231aa8292f04.tar.gz
gdb-48fe7bdacc15bbf455243d1d7d26231aa8292f04.tar.bz2
* ld-mips-elf/mips-elf.exp (linux_gnu): New variable. Add:
* ld-mips-elf/rel32-o32.d, ld-mips-elf/rel32-n32.d, ld-mips-elf/rel64.d, ld-mips-elf/rel32.s, ld-mips-elf/rel64.s: New tests.
-rw-r--r--ld/testsuite/ChangeLog7
-rw-r--r--ld/testsuite/ld-mips-elf/mips-elf.exp10
-rw-r--r--ld/testsuite/ld-mips-elf/rel32-n32.d16
-rw-r--r--ld/testsuite/ld-mips-elf/rel32-o32.d16
-rw-r--r--ld/testsuite/ld-mips-elf/rel32.s4
-rw-r--r--ld/testsuite/ld-mips-elf/rel64.d19
-rw-r--r--ld/testsuite/ld-mips-elf/rel64.s4
7 files changed, 75 insertions, 1 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 048d36e..299ade0 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2003-03-11 Alexandre Oliva <aoliva@redhat.com>
+
+ * ld-mips-elf/mips-elf.exp (linux_gnu): New variable. Add:
+ * ld-mips-elf/rel32-o32.d, ld-mips-elf/rel32-n32.d,
+ ld-mips-elf/rel64.d, ld-mips-elf/rel32.s, ld-mips-elf/rel64.s: New
+ tests.
+
2003-03-11 Alan Modra <amodra@bigpond.net.au>
* ld-powerpc/tlsso.r: Adjust for corrected zero symbol index relocs.
diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp
index a75f4db..d206bd4 100644
--- a/ld/testsuite/ld-mips-elf/mips-elf.exp
+++ b/ld/testsuite/ld-mips-elf/mips-elf.exp
@@ -1,5 +1,5 @@
# Expect script for MIPS ELF linker tests
-# Copyright 2002 Free Software Foundation, Inc.
+# Copyright 2002, 2003 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
@@ -20,6 +20,7 @@ if { [istarget mips*-*-*] } then {
set elf [expr [istarget mips*-*-elf] || [istarget mips*-*-linux*] || \
[istarget mips*-*-netbsd] || [istarget mips*-*-irix*]]
+ set linux_gnu [expr [istarget mips*-*-linux*]]
set embedded_elf [expr [istarget mips*-*-elf]]
@@ -34,6 +35,13 @@ if { [istarget mips*-*-*] } then {
run_dump_test "multi-got-1"
}
+ if { $linux_gnu } {
+ run_dump_test "rel32-o32"
+ run_dump_test "rel32-n32"
+ run_dump_test "rel64"
+ }
+
+
if { $embedded_elf } {
# Check basic Embedded-PIC PC-relative HI/LO relocs.
run_dump_test "empic1-ln"
diff --git a/ld/testsuite/ld-mips-elf/rel32-n32.d b/ld/testsuite/ld-mips-elf/rel32-n32.d
new file mode 100644
index 0000000..a9233c4
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/rel32-n32.d
@@ -0,0 +1,16 @@
+#name: MIPS rel32 n32
+#source: rel32.s
+#as: -KPIC -n32
+#readelf: -x 5 -r
+#ld: -shared -melf32btsmipn32
+
+Relocation section '.rel.dyn' at offset 0x3d0 contains 2 entries:
+ Offset Info Type Sym.Value Sym. Name
+00000000 00000000 R_MIPS_NONE
+000003f0 00000003 R_MIPS_REL32
+
+Hex dump of section '.text':
+ 0x000003e0 00000000 00000000 00000000 00000000 ................
+ 0x000003f0 000003f0 00000000 00000000 00000000 ................
+ 0x00000400 00000000 00000000 00000000 00000000 ................
+ 0x00000410 00000000 00000000 00000000 00000000 ................
diff --git a/ld/testsuite/ld-mips-elf/rel32-o32.d b/ld/testsuite/ld-mips-elf/rel32-o32.d
new file mode 100644
index 0000000..7bcad7b
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/rel32-o32.d
@@ -0,0 +1,16 @@
+#name: MIPS rel32 o32
+#source: rel32.s
+#as: -KPIC -32
+#readelf: -x 6 -r
+#ld: -shared -melf32btsmip
+
+Relocation section '.rel.dyn' at offset 0x3e0 contains 2 entries:
+ Offset Info Type Sym.Value Sym. Name
+00000000 00000000 R_MIPS_NONE
+00000400 00000003 R_MIPS_REL32
+
+Hex dump of section '.text':
+ 0x000003f0 00000000 00000000 00000000 00000000 ................
+ 0x00000400 00000400 00000000 00000000 00000000 ................
+ 0x00000410 00000000 00000000 00000000 00000000 ................
+ 0x00000420 00000000 00000000 00000000 00000000 ................
diff --git a/ld/testsuite/ld-mips-elf/rel32.s b/ld/testsuite/ld-mips-elf/rel32.s
new file mode 100644
index 0000000..dad4670
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/rel32.s
@@ -0,0 +1,4 @@
+ .space 16
+.Lfoo:
+ .word .Lfoo
+ .space 16
diff --git a/ld/testsuite/ld-mips-elf/rel64.d b/ld/testsuite/ld-mips-elf/rel64.d
new file mode 100644
index 0000000..f2289b0
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/rel64.d
@@ -0,0 +1,19 @@
+#name: MIPS rel64 n64
+#source: rel64.s
+#as: -KPIC -64
+#readelf: -x 6 -r
+#ld: -shared -melf64btsmip
+
+Relocation section '.rel.dyn' at offset 0x5b0 contains 2 entries:
+ Offset Info Type Sym. Value Sym. Name
+000000000000 000000000000 R_MIPS_NONE
+ Type2: R_MIPS_NONE
+ Type3: R_MIPS_NONE
+0000000005e0 000000001203 R_MIPS_REL32
+ Type2: R_MIPS_64
+ Type3: R_MIPS_NONE
+
+Hex dump of section '.text':
+ 0x000005d0 00000000 00000000 00000000 00000000 ................
+ 0x000005e0 00000000 000005e0 00000000 00000000 ................
+ 0x000005f0 00000000 00000000 00000000 00000000 ................
diff --git a/ld/testsuite/ld-mips-elf/rel64.s b/ld/testsuite/ld-mips-elf/rel64.s
new file mode 100644
index 0000000..3971eb8
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/rel64.s
@@ -0,0 +1,4 @@
+ .space 16
+.Lfoo:
+ .dword .Lfoo
+ .space 16