aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog7
-rw-r--r--ld/testsuite/ld-mips-elf/got-vers-1.dd6
-rw-r--r--ld/testsuite/ld-mips-elf/got-vers-1.rd6
-rw-r--r--ld/testsuite/ld-mips-elf/got-vers-1.sd6
-rw-r--r--ld/testsuite/ld-mips-elf/got-vers-1.ver1
-rw-r--r--ld/testsuite/ld-mips-elf/got-vers-1a.s2
-rw-r--r--ld/testsuite/ld-mips-elf/got-vers-1b.s7
-rw-r--r--ld/testsuite/ld-mips-elf/mips-elf.exp12
8 files changed, 47 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 529643b..d40ec92 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,5 +1,12 @@
2008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
+ * ld-mips-elf/got-vers-1a.s, ld-mips-elf/got-vers-1b.s,
+ ld-mips-elf/got-vers-1.ver, ld-mips-elf/got-vers-1.dd,
+ ld-mips-elf/got-vers-1.sd, ld-mips-elf/got-vers-1.rd: New tests.
+ * ld-mips-elf/mips-elf.exp: Run them.
+
+2008-08-07 Richard Sandiford <rdsandiford@googlemail.com>
+
* ld-mips-elf/tlsdyn-o32-2.got, ld-mips-elf/tlsdyn-o32-3.got,
ld-mips-elf/tlsdyn-o32-2.d, ld-mips-elf/tlsdyn-o32-3.d: Change the
GOT layout as follows:
diff --git a/ld/testsuite/ld-mips-elf/got-vers-1.dd b/ld/testsuite/ld-mips-elf/got-vers-1.dd
new file mode 100644
index 0000000..98cda95
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/got-vers-1.dd
@@ -0,0 +1,6 @@
+# There must be one global GOT symbol. Its index doesn't matter.
+#...
+ 0x70000011 \(MIPS_SYMTABNO\) * 4
+#...
+ 0x70000013 \(MIPS_GOTSYM\) * 0x3
+#pass
diff --git a/ld/testsuite/ld-mips-elf/got-vers-1.rd b/ld/testsuite/ld-mips-elf/got-vers-1.rd
new file mode 100644
index 0000000..d99ead1
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/got-vers-1.rd
@@ -0,0 +1,6 @@
+
+Relocation section '\.rel\.dyn' at offset .* contains 2 entries:
+ *Offset * Info * Type * Sym\.Value * Sym\. Name
+00000000 * 00000000 * R_MIPS_NONE *
+# This index must be the same as DT_MIPS_GOTsYM.
+[^ ]+ * 00000303 * R_MIPS_REL32 * [^ ]+ * foo
diff --git a/ld/testsuite/ld-mips-elf/got-vers-1.sd b/ld/testsuite/ld-mips-elf/got-vers-1.sd
new file mode 100644
index 0000000..9c3a8c0
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/got-vers-1.sd
@@ -0,0 +1,6 @@
+# foo@@V2 must have index DT_MIPS_GOTSYM
+#...
+ *3: .* 4 * OBJECT * GLOBAL * DEFAULT * [0-9]+ * foo@@V2
+
+Symbol table '\.symtab' contains .*:
+#pass
diff --git a/ld/testsuite/ld-mips-elf/got-vers-1.ver b/ld/testsuite/ld-mips-elf/got-vers-1.ver
new file mode 100644
index 0000000..defa8e9
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/got-vers-1.ver
@@ -0,0 +1 @@
+V2 { global: foo; local: *; };
diff --git a/ld/testsuite/ld-mips-elf/got-vers-1a.s b/ld/testsuite/ld-mips-elf/got-vers-1a.s
new file mode 100644
index 0000000..b9959ff
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/got-vers-1a.s
@@ -0,0 +1,2 @@
+ .abicalls
+ .word foo
diff --git a/ld/testsuite/ld-mips-elf/got-vers-1b.s b/ld/testsuite/ld-mips-elf/got-vers-1b.s
new file mode 100644
index 0000000..dd308b4
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/got-vers-1b.s
@@ -0,0 +1,7 @@
+ .abicalls
+ .symver foo2,foo@@V2
+ .global foo2
+ .data
+ .type foo2,%object
+ .size foo2,4
+foo2: .word 0
diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp
index b4da748..368335a 100644
--- a/ld/testsuite/ld-mips-elf/mips-elf.exp
+++ b/ld/testsuite/ld-mips-elf/mips-elf.exp
@@ -363,3 +363,15 @@ run_dump_test "attr-gnu-4-43"
run_dump_test "attr-gnu-4-44"
run_dump_test "attr-gnu-4-45"
run_dump_test "attr-gnu-4-51"
+
+if { $linux_gnu } {
+ run_ld_link_tests {
+ {"GOT and versioning 1"
+ "-shared -melf32btsmip --version-script got-vers-1.ver"
+ "-EB -mips2 -32" {got-vers-1a.s got-vers-1b.s}
+ {{readelf -d got-vers-1.dd}
+ {readelf --symbols got-vers-1.sd}
+ {readelf --relocs got-vers-1.rd}}
+ "got-vers-1.so"}
+ }
+}