2002-07-15 H.J. Lu <hjl@gnu.org>
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 16 Jul 2002 00:15:57 +0000 (00:15 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 16 Jul 2002 00:15:57 +0000 (00:15 +0000)
* ld-elfvers/vers.exp: Add vers21.

* ld-elfvers/vers21.c: New.
* ld-elfvers/vers21.dsym: New.
* ld-elfvers/vers21.map: New.
* ld-elfvers/vers21.sym: New.
* ld-elfvers/vers21.ver: New.

ld/testsuite/ChangeLog
ld/testsuite/ld-elfvers/vers.exp
ld/testsuite/ld-elfvers/vers21.c [new file with mode: 0644]
ld/testsuite/ld-elfvers/vers21.dsym [new file with mode: 0644]
ld/testsuite/ld-elfvers/vers21.map [new file with mode: 0644]
ld/testsuite/ld-elfvers/vers21.sym [new file with mode: 0644]
ld/testsuite/ld-elfvers/vers21.ver [new file with mode: 0644]

index ff64b7919f0530057f0d69370bf2b6e8f3570d18..44763c4fac8a7fdf0738a2bb97beac0ad50f8f6e 100644 (file)
@@ -1,3 +1,13 @@
+2002-07-15  H.J. Lu <hjl@gnu.org>
+
+       * ld-elfvers/vers.exp: Add vers21.
+
+       * ld-elfvers/vers21.c: New.
+       * ld-elfvers/vers21.dsym: New.
+       * ld-elfvers/vers21.map: New.
+       * ld-elfvers/vers21.sym: New.
+       * ld-elfvers/vers21.ver: New.
+
 2002-07-12  Hans-Peter Nilsson  <hp@axis.com>
 
        * ld-cris/nodyn4.d, ld-cris/expdyn4.d, ld-cris/comref1.s,
index 48ba4ca5d685df31ed2a8271746bccdbc4f6c4b4..6381ea5084719a329eaad2c5f68ba52a3c2d97a8 100644 (file)
@@ -821,3 +821,6 @@ build_exec "vers19" vers19.c vers19 "-rpath ." vers18.so vers19.ver vers19.dsym
 build_vers_lib "vers20a" vers20.c vers20a "" vers20.map vers20a.ver vers20.dsym ""
 exec cp $tmpdir/vers20a.so $tmpdir/vers20b.so
 build_vers_lib "vers20" vers20.c vers20 "vers20a.so vers20b.so" vers20.map vers20.ver vers20.dsym ""
+
+# Test .symver override.
+build_vers_lib "vers21" vers21.c vers21 "" vers21.map vers21.ver vers21.dsym vers21.sym
diff --git a/ld/testsuite/ld-elfvers/vers21.c b/ld/testsuite/ld-elfvers/vers21.c
new file mode 100644 (file)
index 0000000..23382af
--- /dev/null
@@ -0,0 +1,32 @@
+__asm__(".symver _old_foo,foo@VERS.0");
+__asm__(".symver _old_bar,bar@VERS.0");
+__asm__(".symver _old_foobar,foobar@VERS.0");
+__asm__(".weak  _old_bar");
+
+int
+bar () 
+{
+  return 1;
+}
+
+int
+_old_bar () 
+{
+  return bar ();
+}
+
+int
+foo () 
+{
+  return 2;
+}
+
+int
+_old_foo () 
+{
+  return foo ();
+}
+
+int _old_foobar = 0;
+
+int foobar = 1;
diff --git a/ld/testsuite/ld-elfvers/vers21.dsym b/ld/testsuite/ld-elfvers/vers21.dsym
new file mode 100644 (file)
index 0000000..2096b5d
--- /dev/null
@@ -0,0 +1,4 @@
+[0]*[  ]+g[    ]+DO[   ]+\*ABS\*[      ]+[0]*[         ]+VERS.0[       ]+VERS.0
+[0-9a-f]*[     ]+w[    ]+DF[   ]+.text[        ]+[0-9a-f]*[    ]+\(VERS.0\)[   ]+(0x[0-9a-f]*|)[       ]*bar
+[0-9a-f]*[     ]+g[    ]+DF[   ]+.text[        ]+[0-9a-f]*[    ]+\(VERS.0\)[   ]+(0x[0-9a-f]*|)[       ]*foo
+[0-9a-f]*[     ]+g[    ]+DO[   ]+.s?data[      ]+[0-9a-f]*[    ]+\(VERS.0\)[   ]+foobar
diff --git a/ld/testsuite/ld-elfvers/vers21.map b/ld/testsuite/ld-elfvers/vers21.map
new file mode 100644 (file)
index 0000000..08f748a
--- /dev/null
@@ -0,0 +1,8 @@
+VERS.0 {
+  global:
+    bar;
+    foo;
+    foobar;
+  local:
+    *;
+};
diff --git a/ld/testsuite/ld-elfvers/vers21.sym b/ld/testsuite/ld-elfvers/vers21.sym
new file mode 100644 (file)
index 0000000..bcb6359
--- /dev/null
@@ -0,0 +1,3 @@
+[0-9a-f]*[     ]+g[    ]+O[    ]+.s?data[      ]+[0-9a-f]* (0x[0-9a-f][0-9a-f] )?foobar@VERS.0
+[0-9a-f]*[     ]+w[    ]+F[    ]+.text[        ]+[0-9a-f]* (0x[0-9a-f][0-9a-f] )?bar@VERS.0
+[0-9a-f]*[     ]+g[    ]+F[    ]+.text[        ]+[0-9a-f]* (0x[0-9a-f][0-9a-f] )?foo@VERS.0
diff --git a/ld/testsuite/ld-elfvers/vers21.ver b/ld/testsuite/ld-elfvers/vers21.ver
new file mode 100644 (file)
index 0000000..3ba24d8
--- /dev/null
@@ -0,0 +1,4 @@
+Version definitions:
+1 0x01 0x0965595f vers21.so
+2 0x00 0x05aa7610 VERS.0
+