aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ld/testsuite/ChangeLog16
-rw-r--r--ld/testsuite/ld-elfvers/vers.exp6
-rw-r--r--ld/testsuite/ld-elfvers/vers28a.c1
-rw-r--r--ld/testsuite/ld-elfvers/vers28a.dsym1
-rw-r--r--ld/testsuite/ld-elfvers/vers28a.ver1
-rw-r--r--ld/testsuite/ld-elfvers/vers28b.c3
-rw-r--r--ld/testsuite/ld-elfvers/vers28b.dsym2
-rw-r--r--ld/testsuite/ld-elfvers/vers28b.map5
-rw-r--r--ld/testsuite/ld-elfvers/vers28b.ver4
-rw-r--r--ld/testsuite/ld-elfvers/vers28c.c7
-rw-r--r--ld/testsuite/ld-elfvers/vers28c.dsym1
-rw-r--r--ld/testsuite/ld-elfvers/vers28c.ver4
12 files changed, 51 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index a41e6ae..eb1a897 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,19 @@
+2004-03-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ld-elfvers/vers.exp: Add new tests for versioned weak
+ definition.
+
+ * ld-elfvers/vers28a.c: New file.
+ * ld-elfvers/vers28a.dsym: Likewise.
+ * ld-elfvers/vers28a.ver: Likewise.
+ * ld-elfvers/vers28b.c: Likewise.
+ * ld-elfvers/vers28b.dsym: Likewise.
+ * ld-elfvers/vers28b.map: Likewise.
+ * ld-elfvers/vers28b.ver: Likewise.
+ * ld-elfvers/vers28c.c: Likewise.
+ * ld-elfvers/vers28c.dsym: Likewise.
+ * ld-elfvers/vers28c.ver: Likewise.
+
2004-03-19 Alan Modra <amodra@bigpond.net.au>
* ld-scripts/provide-2.d: Ignore random symbols.
diff --git a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/vers.exp
index 47be40e..a9b3778 100644
--- a/ld/testsuite/ld-elfvers/vers.exp
+++ b/ld/testsuite/ld-elfvers/vers.exp
@@ -938,3 +938,9 @@ build_vers_lib_pic "vers27d2" vers27d2.c vers27d2 "" "" vers27b.ver vers27b.dsym
build_executable "vers27d3" vers27d3.c vers27d3 "vers27b.o vers27d2.so vers27d1.so" "" vers27b.ver vers27b.dsym ""
build_vers_lib_pic "vers27d4" vers27d2.c vers27d4 "vers27a.so" "" vers27d4.ver vers27d4.dsym ""
build_executable "vers27d5" vers27d3.c vers27d5 "vers27d4.so vers27b.o vers27a.so" "" vers27b.ver vers27b.dsym ""
+
+# Test weak versioned definition vs. strong definition in different
+# files.
+build_vers_lib_pic "vers28a" vers28a.c vers28a "" "" vers28a.ver vers28a.dsym ""
+build_vers_lib_pic "vers28b" vers28b.c vers28b "" vers28b.map vers28b.ver vers28b.dsym ""
+build_vers_lib_pic "vers28c" vers28c.c vers28c "vers28b.so vers28a.so" "" vers28c.ver vers28c.dsym ""
diff --git a/ld/testsuite/ld-elfvers/vers28a.c b/ld/testsuite/ld-elfvers/vers28a.c
new file mode 100644
index 0000000..f5be371
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers28a.c
@@ -0,0 +1 @@
+void foo () {}
diff --git a/ld/testsuite/ld-elfvers/vers28a.dsym b/ld/testsuite/ld-elfvers/vers28a.dsym
new file mode 100644
index 0000000..932b798
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers28a.dsym
@@ -0,0 +1 @@
+# Empty file
diff --git a/ld/testsuite/ld-elfvers/vers28a.ver b/ld/testsuite/ld-elfvers/vers28a.ver
new file mode 100644
index 0000000..932b798
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers28a.ver
@@ -0,0 +1 @@
+# Empty file
diff --git a/ld/testsuite/ld-elfvers/vers28b.c b/ld/testsuite/ld-elfvers/vers28b.c
new file mode 100644
index 0000000..8186782
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers28b.c
@@ -0,0 +1,3 @@
+#pragma weak foo
+
+void foo () {}
diff --git a/ld/testsuite/ld-elfvers/vers28b.dsym b/ld/testsuite/ld-elfvers/vers28b.dsym
new file mode 100644
index 0000000..e174c91
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers28b.dsym
@@ -0,0 +1,2 @@
+[0]*[ ]+g[ ]+DO[ ]+\*ABS\*[ ]+[0]*[ ]+VERS.0[ ]+VERS.0
+[0-9a-f]*[ ]+w[ ]+DF[ ]+.text[ ]+[0-9a-f]*[ ]+VERS.0[ ]+(0x[0-9a-f]*|)[ ]*foo
diff --git a/ld/testsuite/ld-elfvers/vers28b.map b/ld/testsuite/ld-elfvers/vers28b.map
new file mode 100644
index 0000000..31bfc76
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers28b.map
@@ -0,0 +1,5 @@
+VERS.0 {
+ global:
+ foo;
+ local: *;
+};
diff --git a/ld/testsuite/ld-elfvers/vers28b.ver b/ld/testsuite/ld-elfvers/vers28b.ver
new file mode 100644
index 0000000..ab99615
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers28b.ver
@@ -0,0 +1,4 @@
+Version definitions:
+1 0x01 0x0659990f vers28b.so
+2 0x00 0x05aa7610 VERS.0
+
diff --git a/ld/testsuite/ld-elfvers/vers28c.c b/ld/testsuite/ld-elfvers/vers28c.c
new file mode 100644
index 0000000..55afb6c
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers28c.c
@@ -0,0 +1,7 @@
+extern void foo ();
+
+void
+bar ()
+{
+ foo ();
+}
diff --git a/ld/testsuite/ld-elfvers/vers28c.dsym b/ld/testsuite/ld-elfvers/vers28c.dsym
new file mode 100644
index 0000000..37a1c43
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers28c.dsym
@@ -0,0 +1 @@
+[0-9a-f]*[ ]+DF[ ]+\*UND\*[ ]+[0-9a-f]*[ ]+VERS.0[ ]+(0x[0-9a-f]*|)[ ]*foo
diff --git a/ld/testsuite/ld-elfvers/vers28c.ver b/ld/testsuite/ld-elfvers/vers28c.ver
new file mode 100644
index 0000000..1462686
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers28c.ver
@@ -0,0 +1,4 @@
+Version References:
+ required from tmpdir/vers28b.so:
+ 0x05aa7610 0x00 02 VERS.0
+