2004-03-19 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 19 Mar 2004 17:02:31 +0000 (17:02 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 19 Mar 2004 17:02:31 +0000 (17:02 +0000)
* 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.

12 files changed:
ld/testsuite/ChangeLog
ld/testsuite/ld-elfvers/vers.exp
ld/testsuite/ld-elfvers/vers28a.c [new file with mode: 0644]
ld/testsuite/ld-elfvers/vers28a.dsym [new file with mode: 0644]
ld/testsuite/ld-elfvers/vers28a.ver [new file with mode: 0644]
ld/testsuite/ld-elfvers/vers28b.c [new file with mode: 0644]
ld/testsuite/ld-elfvers/vers28b.dsym [new file with mode: 0644]
ld/testsuite/ld-elfvers/vers28b.map [new file with mode: 0644]
ld/testsuite/ld-elfvers/vers28b.ver [new file with mode: 0644]
ld/testsuite/ld-elfvers/vers28c.c [new file with mode: 0644]
ld/testsuite/ld-elfvers/vers28c.dsym [new file with mode: 0644]
ld/testsuite/ld-elfvers/vers28c.ver [new file with mode: 0644]

index a41e6ae60e0bdfd4ed93ed7bdf50874ae63156ba..eb1a897e0630fd5c082fd3b56a2f8628dc2d849c 100644 (file)
@@ -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.
index 47be40ef8ecf1fe88451c980cbc58b374431bb82..a9b37787009eb0c3d61bd75cba186f2c35406c79 100644 (file)
@@ -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 (file)
index 0000000..f5be371
--- /dev/null
@@ -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 (file)
index 0000000..932b798
--- /dev/null
@@ -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 (file)
index 0000000..932b798
--- /dev/null
@@ -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 (file)
index 0000000..8186782
--- /dev/null
@@ -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 (file)
index 0000000..e174c91
--- /dev/null
@@ -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 (file)
index 0000000..31bfc76
--- /dev/null
@@ -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 (file)
index 0000000..ab99615
--- /dev/null
@@ -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 (file)
index 0000000..55afb6c
--- /dev/null
@@ -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 (file)
index 0000000..37a1c43
--- /dev/null
@@ -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 (file)
index 0000000..1462686
--- /dev/null
@@ -0,0 +1,4 @@
+Version References:
+  required from tmpdir/vers28b.so:
+    0x05aa7610 0x00 02 VERS.0
+