public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] ld: elfvers tests: support symbol prefixed targets
@ 2010-12-09 21:05 Mike Frysinger
  2010-12-10  0:24 ` Alan Modra
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Frysinger @ 2010-12-09 21:05 UTC (permalink / raw)
  To: binutils; +Cc: toolchain-devel

The symbol versioning tests mix C-visible symbols and linker-visible
symbols in order to verify .symver behavior.  This works for most
people, but fail for targets that have a symbol prefix.  So add a
helper file with macros that expand gcc's __USER_LABEL_PREFIX__ as
necessary and convert all .symver users over to it.

Now that the tests are usable on prefixed targets, update the tests
to take into account an optional leading underscore.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

2010-12-09  Mike Frysinger  <vapier@gentoo.org>

	* ld-elfvers/vers.h: New file.
	* ld-elfvers/vers1.c: Include vers.h.  Change asm(.symver) to SYMVER().
	* ld-elfvers/vers4.c, ld-elfvers/vers5.c, ld-elfvers/vers6.c,
	ld-elfvers/vers7a.c, ld-elfvers/vers9.c, ld-elfvers/vers15.c,
	ld-elfvers/vers18.c, ld-elfvers/vers21.c, ld-elfvers/vers22a.c,
	ld-elfvers/vers23a.c, ld-elfvers/vers24a.c, ld-elfvers/vers24c.c,
	ld-elfvers/vers27d1.c: Likewise.

	* ld-elf/pr9676.rd: Include _? in symbol match
	* ld-elf/pr9676.rd, ld-elf/pr9679.rd, ld-elfvers/vers1.dsym,
	ld-elfvers/vers1.sym, ld-elfvers/vers15.dsym, ld-elfvers/vers15.sym,
	ld-elfvers/vers16.dsym, ld-elfvers/vers16a.dsym, ld-elfvers/vers17.dsym,
	ld-elfvers/vers18.dsym, ld-elfvers/vers18.sym, ld-elfvers/vers19.dsym,
	ld-elfvers/vers2.dsym, ld-elfvers/vers20.dsym, ld-elfvers/vers21.dsym,
	ld-elfvers/vers21.sym, ld-elfvers/vers22.dsym, ld-elfvers/vers22a.dsym,
	ld-elfvers/vers22a.sym, ld-elfvers/vers22b.dsym, ld-elfvers/vers23.dsym,
	ld-elfvers/vers23a.dsym, ld-elfvers/vers23a.sym, ld-elfvers/vers23b.dsym,
	ld-elfvers/vers23d.dsym, ld-elfvers/vers24.rd, ld-elfvers/vers25a.dsym,
	ld-elfvers/vers26a.dsym, ld-elfvers/vers27a.dsym, ld-elfvers/vers27d.dsym,
	ld-elfvers/vers27d.sym, ld-elfvers/vers27d4.dsym, ld-elfvers/vers28b.dsym,
	ld-elfvers/vers28c.dsym, ld-elfvers/vers29.dsym, ld-elfvers/vers3.dsym,
	ld-elfvers/vers30.dsym, ld-elfvers/vers31.dsym, ld-elfvers/vers32a.dsym,
	ld-elfvers/vers32b.dsym, ld-elfvers/vers4.sym, ld-elfvers/vers4a.dsym,
	ld-elfvers/vers4a.sym, ld-elfvers/vers6.dsym, ld-elfvers/vers6.sym,
	ld-elfvers/vers7a.dsym, ld-elfvers/vers7a.sym, ld-elfvers/vers9.dsym,
	ld-elfvers/vers9.sym: Likewise.
---
 ld/testsuite/ld-elf/pr9676.rd         |    2 +-
 ld/testsuite/ld-elf/pr9679.rd         |    2 +-
 ld/testsuite/ld-elfvers/vers.h        |    9 +++++++++
 ld/testsuite/ld-elfvers/vers1.c       |   18 ++++++++++--------
 ld/testsuite/ld-elfvers/vers1.dsym    |   12 ++++++------
 ld/testsuite/ld-elfvers/vers1.sym     |    8 ++++----
 ld/testsuite/ld-elfvers/vers15.c      |    7 ++++---
 ld/testsuite/ld-elfvers/vers15.dsym   |    6 +++---
 ld/testsuite/ld-elfvers/vers15.sym    |    6 +++---
 ld/testsuite/ld-elfvers/vers16.dsym   |    4 ++--
 ld/testsuite/ld-elfvers/vers16a.dsym  |    4 ++--
 ld/testsuite/ld-elfvers/vers17.dsym   |    2 +-
 ld/testsuite/ld-elfvers/vers18.c      |   10 ++++++----
 ld/testsuite/ld-elfvers/vers18.dsym   |    8 ++++----
 ld/testsuite/ld-elfvers/vers18.sym    |    8 ++++----
 ld/testsuite/ld-elfvers/vers19.dsym   |    2 +-
 ld/testsuite/ld-elfvers/vers2.dsym    |    4 ++--
 ld/testsuite/ld-elfvers/vers20.dsym   |    2 +-
 ld/testsuite/ld-elfvers/vers21.c      |   10 ++++++----
 ld/testsuite/ld-elfvers/vers21.dsym   |    6 +++---
 ld/testsuite/ld-elfvers/vers21.sym    |    6 +++---
 ld/testsuite/ld-elfvers/vers22.dsym   |    2 +-
 ld/testsuite/ld-elfvers/vers22a.c     |    4 +++-
 ld/testsuite/ld-elfvers/vers22a.dsym  |    2 +-
 ld/testsuite/ld-elfvers/vers22a.sym   |    2 +-
 ld/testsuite/ld-elfvers/vers22b.dsym  |    2 +-
 ld/testsuite/ld-elfvers/vers23.dsym   |    2 +-
 ld/testsuite/ld-elfvers/vers23a.c     |    4 +++-
 ld/testsuite/ld-elfvers/vers23a.dsym  |    4 ++--
 ld/testsuite/ld-elfvers/vers23a.sym   |    2 +-
 ld/testsuite/ld-elfvers/vers23b.dsym  |    2 +-
 ld/testsuite/ld-elfvers/vers23d.dsym  |    4 ++--
 ld/testsuite/ld-elfvers/vers24.rd     |    6 +++---
 ld/testsuite/ld-elfvers/vers24a.c     |    4 +++-
 ld/testsuite/ld-elfvers/vers24c.c     |    4 +++-
 ld/testsuite/ld-elfvers/vers25a.dsym  |    2 +-
 ld/testsuite/ld-elfvers/vers26a.dsym  |    2 +-
 ld/testsuite/ld-elfvers/vers27a.dsym  |    2 +-
 ld/testsuite/ld-elfvers/vers27b.c     |    3 ++-
 ld/testsuite/ld-elfvers/vers27d.dsym  |    2 +-
 ld/testsuite/ld-elfvers/vers27d.sym   |    2 +-
 ld/testsuite/ld-elfvers/vers27d1.c    |    4 +++-
 ld/testsuite/ld-elfvers/vers27d4.dsym |    2 +-
 ld/testsuite/ld-elfvers/vers28b.dsym  |    2 +-
 ld/testsuite/ld-elfvers/vers28c.dsym  |    2 +-
 ld/testsuite/ld-elfvers/vers29.dsym   |    2 +-
 ld/testsuite/ld-elfvers/vers3.dsym    |    2 +-
 ld/testsuite/ld-elfvers/vers30.dsym   |    8 ++++----
 ld/testsuite/ld-elfvers/vers31.dsym   |    2 +-
 ld/testsuite/ld-elfvers/vers32a.dsym  |    2 +-
 ld/testsuite/ld-elfvers/vers32b.dsym  |    2 +-
 ld/testsuite/ld-elfvers/vers4.c       |    3 ++-
 ld/testsuite/ld-elfvers/vers4.sym     |    2 +-
 ld/testsuite/ld-elfvers/vers4a.dsym   |    2 +-
 ld/testsuite/ld-elfvers/vers4a.sym    |    2 +-
 ld/testsuite/ld-elfvers/vers5.c       |   10 ++++++----
 ld/testsuite/ld-elfvers/vers6.c       |    9 +++++----
 ld/testsuite/ld-elfvers/vers6.dsym    |    8 ++++----
 ld/testsuite/ld-elfvers/vers6.sym     |    8 ++++----
 ld/testsuite/ld-elfvers/vers7a.c      |    6 ++++--
 ld/testsuite/ld-elfvers/vers7a.dsym   |    2 +-
 ld/testsuite/ld-elfvers/vers7a.sym    |    4 ++--
 ld/testsuite/ld-elfvers/vers9.c       |   10 ++++++----
 ld/testsuite/ld-elfvers/vers9.dsym    |    4 ++--
 ld/testsuite/ld-elfvers/vers9.sym     |    8 ++++----
 65 files changed, 167 insertions(+), 132 deletions(-)
 create mode 100644 ld/testsuite/ld-elfvers/vers.h

diff --git a/ld/testsuite/ld-elf/pr9676.rd b/ld/testsuite/ld-elf/pr9676.rd
index 44a11ce..2d832db 100644
--- a/ld/testsuite/ld-elf/pr9676.rd
+++ b/ld/testsuite/ld-elf/pr9676.rd
@@ -1,5 +1,5 @@
 Symbol table '\.dynsym' contains [0-9]+ entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +LOCAL +DEFAULT +[0-9]+ +foo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +LOCAL +DEFAULT +[0-9]+ +_?foo
 #...
diff --git a/ld/testsuite/ld-elf/pr9679.rd b/ld/testsuite/ld-elf/pr9679.rd
index 44a11ce..2d832db 100644
--- a/ld/testsuite/ld-elf/pr9679.rd
+++ b/ld/testsuite/ld-elf/pr9679.rd
@@ -1,5 +1,5 @@
 Symbol table '\.dynsym' contains [0-9]+ entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +LOCAL +DEFAULT +[0-9]+ +foo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +LOCAL +DEFAULT +[0-9]+ +_?foo
 #...
diff --git a/ld/testsuite/ld-elfvers/vers.h b/ld/testsuite/ld-elfvers/vers.h
new file mode 100644
index 0000000..4455527
--- /dev/null
+++ b/ld/testsuite/ld-elfvers/vers.h
@@ -0,0 +1,9 @@
+/* Add the symbol prefix to the symbol as needed.
+   Usage: SYMPFX(foo);  */
+#define __SYMPFX(pfx, sym) #pfx sym
+#define _SYMPFX(pfx, sym) __SYMPFX(pfx, sym)
+#define SYMPFX(sym) _SYMPFX(__USER_LABEL_PREFIX__, #sym)
+
+/* Generate a .symver reference with symbol prefixes.
+   Usage: SYMVER(foo, foobar@ver);  */
+#define SYMVER(name, name2) __asm__(".symver " SYMPFX(name) "," SYMPFX(name2))
diff --git a/ld/testsuite/ld-elfvers/vers1.c b/ld/testsuite/ld-elfvers/vers1.c
index c27bc3b..86e2bd2 100644
--- a/ld/testsuite/ld-elfvers/vers1.c
+++ b/ld/testsuite/ld-elfvers/vers1.c
@@ -3,6 +3,8 @@
  * a bunch of definitions of the same symbol, and we can theoretically
  * then link applications against varying sets of these.
  */
+#include "vers.h"
+
 const char * show_bar1 = "asdf";
 const char * show_bar2 = "asdf";
 
@@ -47,10 +49,10 @@ hide_new_foo()
 
 }
 
-__asm__(".symver hide_original_foo,show_foo@");
-__asm__(".symver hide_old_foo,show_foo@VERS_1.1");
-__asm__(".symver hide_old_foo1,show_foo@VERS_1.2");
-__asm__(".symver hide_new_foo,show_foo@@VERS_2.0");
+SYMVER(hide_original_foo, show_foo@);
+SYMVER(hide_old_foo, show_foo@VERS_1.1);
+SYMVER(hide_old_foo1, show_foo@VERS_1.2);
+SYMVER(hide_new_foo, show_foo@@VERS_2.0);
 
 
 
@@ -63,7 +65,7 @@ hide_new_bogus_foo()
 	return 1000+bar();
 
 }
-__asm__(".symver hide_new_bogus_foo,show_foo@VERS_2.2");
+SYMVER(hide_new_bogus_foo, show_foo@VERS_2.2);
 #endif
 
 
@@ -81,8 +83,8 @@ xyzzz()
   bar33();
 }
 
-__asm__(".symver new2_foo,fooVERS_2.0");
-__asm__(".symver bar33,bar@@VERS_2.0");
+SYMVER(new2_foo, fooVERS_2.0);
+SYMVER(bar33, bar@@VERS_2.0);
 #endif
 
 #ifdef DO_TEST12
@@ -97,5 +99,5 @@ xyzzz()
   bar33();
 }
 
-__asm__(".symver bar33,bar@@VERS_2.0");
+SYMVER(bar33, bar@@VERS_2.0);
 #endif
diff --git a/ld/testsuite/ld-elfvers/vers1.dsym b/ld/testsuite/ld-elfvers/vers1.dsym
index d33ab20..9d19752 100644
--- a/ld/testsuite/ld-elfvers/vers1.dsym
+++ b/ld/testsuite/ld-elfvers/vers1.dsym
@@ -1,9 +1,9 @@
 0+ g +DO \*ABS\*	0+ +VERS_1\.1 +VERS_1\.1
 0+ g +DO \*ABS\*	0+ +VERS_1\.2 +VERS_1\.2
 0+ g +DO \*ABS\*	0+ +VERS_2\.0 +VERS_2\.0
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ \(Base\) +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ \(VERS_1\.1\) +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ \(VERS_1\.2\) +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ g +DO (\.s?data|\*ABS\*)	[0-9a-f]+ +VERS_2\.0 +show_bar1
-[0-9a-f]+ g +DO (\.s?data|\*ABS\*)	[0-9a-f]+ +VERS_2\.0 +show_bar2
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ \(Base\) +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ \(VERS_1\.1\) +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ \(VERS_1\.2\) +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ g +DO (\.s?data|\*ABS\*)	[0-9a-f]+ +VERS_2\.0 +_?show_bar1
+[0-9a-f]+ g +DO (\.s?data|\*ABS\*)	[0-9a-f]+ +VERS_2\.0 +_?show_bar2
diff --git a/ld/testsuite/ld-elfvers/vers1.sym b/ld/testsuite/ld-elfvers/vers1.sym
index ed589e8..f2bb9db 100644
--- a/ld/testsuite/ld-elfvers/vers1.sym
+++ b/ld/testsuite/ld-elfvers/vers1.sym
@@ -1,4 +1,4 @@
-[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?show_foo@
-[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?show_foo@VERS_1\.1
-[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?show_foo@VERS_1\.2
-[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?show_foo@@VERS_2\.0
+[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@
+[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.1
+[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.2
+[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@@VERS_2\.0
diff --git a/ld/testsuite/ld-elfvers/vers15.c b/ld/testsuite/ld-elfvers/vers15.c
index 4e22cac..2457d29 100644
--- a/ld/testsuite/ld-elfvers/vers15.c
+++ b/ld/testsuite/ld-elfvers/vers15.c
@@ -3,6 +3,7 @@
  * that we always get the right one.
  */
 #include <stdio.h>
+#include "vers.h"
 
 int
 foo_1()
@@ -31,6 +32,6 @@ main()
   return 0;
 }
 
-__asm__(".symver foo_1,show_foo@");
-__asm__(".symver foo_2,show_foo@VERS_1.1");
-__asm__(".symver foo_3,show_foo@@VERS_1.2");
+SYMVER(foo_1, show_foo@);
+SYMVER(foo_2, show_foo@VERS_1.1);
+SYMVER(foo_3, show_foo@@VERS_1.2);
diff --git a/ld/testsuite/ld-elfvers/vers15.dsym b/ld/testsuite/ld-elfvers/vers15.dsym
index fc4c996..750c358 100644
--- a/ld/testsuite/ld-elfvers/vers15.dsym
+++ b/ld/testsuite/ld-elfvers/vers15.dsym
@@ -1,5 +1,5 @@
 0+ g +DO \*ABS\*	0+ +VERS_1\.1 +VERS_1\.1
 0+ g +DO \*ABS\*	0+ +VERS_1\.2 +VERS_1\.2
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ \(Base\) +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ \(VERS_1\.1\) +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_1\.2 +(0x[0-9a-f]+ )?show_foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ \(Base\) +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ \(VERS_1\.1\) +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_1\.2 +(0x[0-9a-f]+ )?_?show_foo
diff --git a/ld/testsuite/ld-elfvers/vers15.sym b/ld/testsuite/ld-elfvers/vers15.sym
index ba9f83e..a642c9d 100644
--- a/ld/testsuite/ld-elfvers/vers15.sym
+++ b/ld/testsuite/ld-elfvers/vers15.sym
@@ -1,3 +1,3 @@
-[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?show_foo@
-[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?show_foo@VERS_1\.1
-[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?show_foo@@VERS_1\.2
+[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@
+[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.1
+[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@@VERS_1\.2
diff --git a/ld/testsuite/ld-elfvers/vers16.dsym b/ld/testsuite/ld-elfvers/vers16.dsym
index 6733ece..8ee4918 100644
--- a/ld/testsuite/ld-elfvers/vers16.dsym
+++ b/ld/testsuite/ld-elfvers/vers16.dsym
@@ -1,2 +1,2 @@
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+( +Base +)? (0x[0-9a-f]+ )?show_bar
-[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +(0x[0-9a-f]+ )?show_foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+( +Base +)? (0x[0-9a-f]+ )?_?show_bar
+[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +(0x[0-9a-f]+ )?_?show_foo
diff --git a/ld/testsuite/ld-elfvers/vers16a.dsym b/ld/testsuite/ld-elfvers/vers16a.dsym
index aaca9f5..c38d71a 100644
--- a/ld/testsuite/ld-elfvers/vers16a.dsym
+++ b/ld/testsuite/ld-elfvers/vers16a.dsym
@@ -1,3 +1,3 @@
 [0-9a-f]+ g +DO (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_1\.1 +VERS_1\.1
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_1\.1 +(0x[0-9a-f]+ )?show_bar
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +Base +(0x[0-9a-f]+ )?show_foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_1\.1 +(0x[0-9a-f]+ )?_?show_bar
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +Base +(0x[0-9a-f]+ )?_?show_foo
diff --git a/ld/testsuite/ld-elfvers/vers17.dsym b/ld/testsuite/ld-elfvers/vers17.dsym
index 9810659..4cbb334 100644
--- a/ld/testsuite/ld-elfvers/vers17.dsym
+++ b/ld/testsuite/ld-elfvers/vers17.dsym
@@ -1,2 +1,2 @@
 0+ g +DO \*ABS\*	0+ +VERS_2\.0 +VERS_2\.0
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?show_foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?_?show_foo
diff --git a/ld/testsuite/ld-elfvers/vers18.c b/ld/testsuite/ld-elfvers/vers18.c
index 25dcc25..9965b88 100644
--- a/ld/testsuite/ld-elfvers/vers18.c
+++ b/ld/testsuite/ld-elfvers/vers18.c
@@ -1,3 +1,5 @@
+#include "vers.h"
+
 int
 bar ()
 {
@@ -36,7 +38,7 @@ hide_new_foo ()
   return 1000 + bar ();
 }
 
-__asm__(".symver hide_original_foo,show_foo@");
-__asm__(".symver hide_old_foo,show_foo@VERS_1.1");
-__asm__(".symver hide_old_foo1,show_foo@VERS_1.2");
-__asm__(".symver hide_new_foo,show_foo@@VERS_2.0");
+SYMVER(hide_original_foo, show_foo@);
+SYMVER(hide_old_foo, show_foo@VERS_1.1);
+SYMVER(hide_old_foo1, show_foo@VERS_1.2);
+SYMVER(hide_new_foo, show_foo@@VERS_2.0);
diff --git a/ld/testsuite/ld-elfvers/vers18.dsym b/ld/testsuite/ld-elfvers/vers18.dsym
index 49bd7b2..38071cb 100644
--- a/ld/testsuite/ld-elfvers/vers18.dsym
+++ b/ld/testsuite/ld-elfvers/vers18.dsym
@@ -1,7 +1,7 @@
 0+ g +DO \*ABS\*	0+ +VERS_1\.1 +VERS_1\.1
 0+ g +DO \*ABS\*	0+ +VERS_1\.2 +VERS_1\.2
 0+ g +DO \*ABS\*	0+ +VERS_2\.0 +VERS_2\.0
-[0-9a-f]+ +w +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ \(Base\) +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ +w +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ \(VERS_1\.1\) +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ +w +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ \(VERS_1\.2\) +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ +w +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?show_foo
+[0-9a-f]+ +w +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ \(Base\) +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ +w +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ \(VERS_1\.1\) +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ +w +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ \(VERS_1\.2\) +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ +w +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?_?show_foo
diff --git a/ld/testsuite/ld-elfvers/vers18.sym b/ld/testsuite/ld-elfvers/vers18.sym
index bcc8882..0b1183c 100644
--- a/ld/testsuite/ld-elfvers/vers18.sym
+++ b/ld/testsuite/ld-elfvers/vers18.sym
@@ -1,4 +1,4 @@
-[0-9a-f]+ +w +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?show_foo@
-[0-9a-f]+ +w +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?show_foo@VERS_1\.1
-[0-9a-f]+ +w +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?show_foo@VERS_1\.2
-[0-9a-f]+ +w +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?show_foo@@VERS_2\.0
+[0-9a-f]+ +w +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@
+[0-9a-f]+ +w +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.1
+[0-9a-f]+ +w +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.2
+[0-9a-f]+ +w +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@@VERS_2\.0
diff --git a/ld/testsuite/ld-elfvers/vers19.dsym b/ld/testsuite/ld-elfvers/vers19.dsym
index 7396dee..a77f949 100644
--- a/ld/testsuite/ld-elfvers/vers19.dsym
+++ b/ld/testsuite/ld-elfvers/vers19.dsym
@@ -1 +1 @@
-[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?show_foo
+[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?_?show_foo
diff --git a/ld/testsuite/ld-elfvers/vers2.dsym b/ld/testsuite/ld-elfvers/vers2.dsym
index 63f15db..30ba91b 100644
--- a/ld/testsuite/ld-elfvers/vers2.dsym
+++ b/ld/testsuite/ld-elfvers/vers2.dsym
@@ -1,3 +1,3 @@
-[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?show_foo
+[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?_?show_foo
 0+ g +DO \*ABS\*	0+ +VERS_XXX_1\.1 VERS_XXX_1\.1
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_XXX_1\.1 (0x[0-9a-f]+ )?show_xyzzy
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_XXX_1\.1 (0x[0-9a-f]+ )?_?show_xyzzy
diff --git a/ld/testsuite/ld-elfvers/vers20.dsym b/ld/testsuite/ld-elfvers/vers20.dsym
index 559170c..fc13955 100644
--- a/ld/testsuite/ld-elfvers/vers20.dsym
+++ b/ld/testsuite/ld-elfvers/vers20.dsym
@@ -1,2 +1,2 @@
 0+[ 	]+g[ 	]+DO[ 	]+\*ABS\*[ 	]+0+[ 	]+VERS_1\.1[ 	]+VERS_1\.1
-[0-9a-f]+[ 	]+g[ 	]+DO[ 	]+\.s?bss[	]+[0-9a-f]+[ 	]+VERS_1\.1[ 	]+show_foo
+[0-9a-f]+[ 	]+g[ 	]+DO[ 	]+\.s?bss[	]+[0-9a-f]+[ 	]+VERS_1\.1[ 	]+_?show_foo
diff --git a/ld/testsuite/ld-elfvers/vers21.c b/ld/testsuite/ld-elfvers/vers21.c
index 2879c7f..3a75b48 100644
--- a/ld/testsuite/ld-elfvers/vers21.c
+++ b/ld/testsuite/ld-elfvers/vers21.c
@@ -1,7 +1,9 @@
-__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");
+#include "vers.h"
+
+SYMVER(_old_foo, foo@VERS.0);
+SYMVER(_old_bar, bar@VERS.0);
+SYMVER(_old_foobar, foobar@VERS.0);
+__asm__(".weak " SYMPFX(_old_bar));
 
 int
 bar () 
diff --git a/ld/testsuite/ld-elfvers/vers21.dsym b/ld/testsuite/ld-elfvers/vers21.dsym
index 4cb2188..7800a0c 100644
--- a/ld/testsuite/ld-elfvers/vers21.dsym
+++ b/ld/testsuite/ld-elfvers/vers21.dsym
@@ -1,4 +1,4 @@
 0+[ 	]+g[ 	]+DO[ 	]+\*ABS\*[ 	]+0+[ 	]+VERS\.0[ 	]+VERS\.0
-[0-9a-f]+[ 	]+w[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+\(VERS\.0\)[ 	]+(0x[0-9a-f]+|)[ 	]*bar
-[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+\(VERS\.0\)[ 	]+(0x[0-9a-f]+|)[ 	]*foo
-[0-9a-f]+[ 	]+g[ 	]+DO[ 	]+\.s?data[	]+[0-9a-f]+[ 	]+\(VERS\.0\)[ 	]+foobar
+[0-9a-f]+[ 	]+w[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+\(VERS\.0\)[ 	]+(0x[0-9a-f]+|)[ 	]*_?bar
+[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[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.sym b/ld/testsuite/ld-elfvers/vers21.sym
index e7de74f..e2b2038 100644
--- a/ld/testsuite/ld-elfvers/vers21.sym
+++ b/ld/testsuite/ld-elfvers/vers21.sym
@@ -1,3 +1,3 @@
-[0-9a-f]+[ 	]+g[ 	]+O[ 	]+\.s?data[ 	]+[0-9a-f]+ (0x[0-9a-f]+ )?foobar@VERS\.0
-[0-9a-f]+[ 	]+w[ 	]+F[ 	]+\.(text|opd)[ 	]+[0-9a-f]+ (0x[0-9a-f]+ )?bar@VERS\.0
-[0-9a-f]+[ 	]+g[ 	]+F[ 	]+\.(text|opd)[ 	]+[0-9a-f]+ (0x[0-9a-f]+ )?foo@VERS\.0
+[0-9a-f]+[ 	]+g[ 	]+O[ 	]+\.s?data[ 	]+[0-9a-f]+ (0x[0-9a-f]+ )?_?foobar@VERS\.0
+[0-9a-f]+[ 	]+w[ 	]+F[ 	]+\.(text|opd)[ 	]+[0-9a-f]+ (0x[0-9a-f]+ )?_?bar@VERS\.0
+[0-9a-f]+[ 	]+g[ 	]+F[ 	]+\.(text|opd)[ 	]+[0-9a-f]+ (0x[0-9a-f]+ )?_?foo@VERS\.0
diff --git a/ld/testsuite/ld-elfvers/vers22.dsym b/ld/testsuite/ld-elfvers/vers22.dsym
index 5dfa465..db2aeec 100644
--- a/ld/testsuite/ld-elfvers/vers22.dsym
+++ b/ld/testsuite/ld-elfvers/vers22.dsym
@@ -1 +1 @@
-[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +VERS\.0 +(0x[0-9a-f]+ )?bar
+[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +VERS\.0 +(0x[0-9a-f]+ )?_?bar
diff --git a/ld/testsuite/ld-elfvers/vers22a.c b/ld/testsuite/ld-elfvers/vers22a.c
index 288c820..bc5777b 100644
--- a/ld/testsuite/ld-elfvers/vers22a.c
+++ b/ld/testsuite/ld-elfvers/vers22a.c
@@ -1,4 +1,6 @@
-__asm__(".symver _old_bar,bar@VERS.0");
+#include "vers.h"
+
+SYMVER(_old_bar, bar@VERS.0);
 
 void
 _old_bar () 
diff --git a/ld/testsuite/ld-elfvers/vers22a.dsym b/ld/testsuite/ld-elfvers/vers22a.dsym
index af06123..0c8d027 100644
--- a/ld/testsuite/ld-elfvers/vers22a.dsym
+++ b/ld/testsuite/ld-elfvers/vers22a.dsym
@@ -1,2 +1,2 @@
 0+[ 	]+g[ 	]+DO[ 	]+\*ABS\*[ 	]+0+[ 	]+VERS\.0[ 	]+VERS\.0
-[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+\(VERS\.0\)[ 	]+(0x[0-9a-f]+ )?bar
+[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+\(VERS\.0\)[ 	]+(0x[0-9a-f]+ )?_?bar
diff --git a/ld/testsuite/ld-elfvers/vers22a.sym b/ld/testsuite/ld-elfvers/vers22a.sym
index ff07708..c3f4150 100644
--- a/ld/testsuite/ld-elfvers/vers22a.sym
+++ b/ld/testsuite/ld-elfvers/vers22a.sym
@@ -1 +1 @@
-[0-9a-f]+[ 	]+g[ 	]+F[ 	]+\.(text|opd)[ 	]+[0-9a-f]+ (0x[0-9a-f]+ )?bar@VERS.0
+[0-9a-f]+[ 	]+g[ 	]+F[ 	]+\.(text|opd)[ 	]+[0-9a-f]+ (0x[0-9a-f]+ )?_?bar@VERS.0
diff --git a/ld/testsuite/ld-elfvers/vers22b.dsym b/ld/testsuite/ld-elfvers/vers22b.dsym
index 88c31b3..47f0606 100644
--- a/ld/testsuite/ld-elfvers/vers22b.dsym
+++ b/ld/testsuite/ld-elfvers/vers22b.dsym
@@ -1,2 +1,2 @@
 0+[ 	]+g[ 	]+DO[ 	]+\*ABS\*[ 	]+0+[ 	]+VERS\.0[ 	]+VERS\.0
-[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+VERS\.0[ 	]+(0x[0-9a-f]+ )?bar
+[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+VERS\.0[ 	]+(0x[0-9a-f]+ )?_?bar
diff --git a/ld/testsuite/ld-elfvers/vers23.dsym b/ld/testsuite/ld-elfvers/vers23.dsym
index 8c85a4a..dfd6a33 100644
--- a/ld/testsuite/ld-elfvers/vers23.dsym
+++ b/ld/testsuite/ld-elfvers/vers23.dsym
@@ -1 +1 @@
-[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +VERS\.0 +(0x[0-9a-f]+ )?foo
+[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +VERS\.0 +(0x[0-9a-f]+ )?_?foo
diff --git a/ld/testsuite/ld-elfvers/vers23a.c b/ld/testsuite/ld-elfvers/vers23a.c
index 250d6f9..13c8edd 100644
--- a/ld/testsuite/ld-elfvers/vers23a.c
+++ b/ld/testsuite/ld-elfvers/vers23a.c
@@ -1,4 +1,6 @@
-__asm__(".symver _old_bar,bar@VERS.0");
+#include "vers.h"
+
+SYMVER(_old_bar, bar@VERS.0);
 
 void
 _old_bar (void) 
diff --git a/ld/testsuite/ld-elfvers/vers23a.dsym b/ld/testsuite/ld-elfvers/vers23a.dsym
index 4450665..04385b0 100644
--- a/ld/testsuite/ld-elfvers/vers23a.dsym
+++ b/ld/testsuite/ld-elfvers/vers23a.dsym
@@ -1,3 +1,3 @@
 0+[ 	]+g[ 	]+DO[ 	]+\*ABS\*[ 	]+0+[ 	]+VERS\.0[ 	]+VERS\.0
-[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+\(VERS\.0\)[ 	]+(0x[0-9a-f]+ )?bar
-[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+VERS\.0[ 	]+(0x[0-9a-f]+ )?foo
+[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+\(VERS\.0\)[ 	]+(0x[0-9a-f]+ )?_?bar
+[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+VERS\.0[ 	]+(0x[0-9a-f]+ )?_?foo
diff --git a/ld/testsuite/ld-elfvers/vers23a.sym b/ld/testsuite/ld-elfvers/vers23a.sym
index ff07708..c3f4150 100644
--- a/ld/testsuite/ld-elfvers/vers23a.sym
+++ b/ld/testsuite/ld-elfvers/vers23a.sym
@@ -1 +1 @@
-[0-9a-f]+[ 	]+g[ 	]+F[ 	]+\.(text|opd)[ 	]+[0-9a-f]+ (0x[0-9a-f]+ )?bar@VERS.0
+[0-9a-f]+[ 	]+g[ 	]+F[ 	]+\.(text|opd)[ 	]+[0-9a-f]+ (0x[0-9a-f]+ )?_?bar@VERS.0
diff --git a/ld/testsuite/ld-elfvers/vers23b.dsym b/ld/testsuite/ld-elfvers/vers23b.dsym
index 88c31b3..47f0606 100644
--- a/ld/testsuite/ld-elfvers/vers23b.dsym
+++ b/ld/testsuite/ld-elfvers/vers23b.dsym
@@ -1,2 +1,2 @@
 0+[ 	]+g[ 	]+DO[ 	]+\*ABS\*[ 	]+0+[ 	]+VERS\.0[ 	]+VERS\.0
-[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+VERS\.0[ 	]+(0x[0-9a-f]+ )?bar
+[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+VERS\.0[ 	]+(0x[0-9a-f]+ )?_?bar
diff --git a/ld/testsuite/ld-elfvers/vers23d.dsym b/ld/testsuite/ld-elfvers/vers23d.dsym
index b31b82b..ab5fbd8 100644
--- a/ld/testsuite/ld-elfvers/vers23d.dsym
+++ b/ld/testsuite/ld-elfvers/vers23d.dsym
@@ -1,2 +1,2 @@
-[0-9a-f]*      DF \*UND\*	[0-9a-f]*  VERS.0      (0x[0-9a-f][0-9a-f] )?bar
-[0-9a-f]*      DF \*UND\*	[0-9a-f]*  VERS.0      (0x[0-9a-f][0-9a-f] )?foo
+[0-9a-f]*      DF \*UND\*	[0-9a-f]*  VERS.0      (0x[0-9a-f][0-9a-f] )?_?bar
+[0-9a-f]*      DF \*UND\*	[0-9a-f]*  VERS.0      (0x[0-9a-f][0-9a-f] )?_?foo
diff --git a/ld/testsuite/ld-elfvers/vers24.rd b/ld/testsuite/ld-elfvers/vers24.rd
index e5b55b1..42e81e4 100644
--- a/ld/testsuite/ld-elfvers/vers24.rd
+++ b/ld/testsuite/ld-elfvers/vers24.rd
@@ -1,15 +1,15 @@
 Relocation section .*
 # Ensure there is a dynamic relocation against x
 #...
-[0-9a-f]+ +[0-9a-f]+ R_.* +x(| \+ 0)
+[0-9a-f]+ +[0-9a-f]+ R_.* +_?x(| \+ 0)
 #...
 Symbol table '.dynsym' contains [0-9]+ entries:
 # And ensure the dynamic symbol table contains at least x@VERS.0
 # and foo@@VERS.0 symbols
 #...
- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ x|[0-9]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ foo@)@VERS\.0
+ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ _?foo@)@VERS\.0
 #...
- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ x|[0-9]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ foo@)@VERS\.0
+ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ _?foo@)@VERS\.0
 #...
 Symbol table '.symtab' contains [0-9]+ entries:
 #pass
diff --git a/ld/testsuite/ld-elfvers/vers24a.c b/ld/testsuite/ld-elfvers/vers24a.c
index 7fef8d8..10073d4 100644
--- a/ld/testsuite/ld-elfvers/vers24a.c
+++ b/ld/testsuite/ld-elfvers/vers24a.c
@@ -1,5 +1,7 @@
 /* Test whether .symver x, x@foo
    causes relocations against x within the same shared library
    to become dynamic relocations against x@foo.  */
+#include "vers.h"
+
 int x = 12;
-__asm__ (".symver x, x@VERS.0");
+SYMVER(x, x@VERS.0);
diff --git a/ld/testsuite/ld-elfvers/vers24c.c b/ld/testsuite/ld-elfvers/vers24c.c
index 267c424..6e69b33 100644
--- a/ld/testsuite/ld-elfvers/vers24c.c
+++ b/ld/testsuite/ld-elfvers/vers24c.c
@@ -1,8 +1,10 @@
 /* Test whether .symver x, x@foo
    causes relocations against x within the same shared library
    to become dynamic relocations against x@foo.  */
+#include "vers.h"
+
 int x = 12;
-__asm__ (".symver x, x@VERS.0");
+SYMVER(x, x@VERS.0);
 void foo (void)
 {
   x = 24;
diff --git a/ld/testsuite/ld-elfvers/vers25a.dsym b/ld/testsuite/ld-elfvers/vers25a.dsym
index 6e6573a..51fa8f1 100644
--- a/ld/testsuite/ld-elfvers/vers25a.dsym
+++ b/ld/testsuite/ld-elfvers/vers25a.dsym
@@ -1,2 +1,2 @@
 0+[ 	]+g[ 	]+DO[ 	]+\*ABS\*[ 	]+0+[ 	]+VERS\.0[ 	]+VERS\.0
-[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+VERS\.0[ 	]+(0x[0-9a-f]+ )?foo
+[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+VERS\.0[ 	]+(0x[0-9a-f]+ )?_foo
diff --git a/ld/testsuite/ld-elfvers/vers26a.dsym b/ld/testsuite/ld-elfvers/vers26a.dsym
index 6e6573a..a9d0313 100644
--- a/ld/testsuite/ld-elfvers/vers26a.dsym
+++ b/ld/testsuite/ld-elfvers/vers26a.dsym
@@ -1,2 +1,2 @@
 0+[ 	]+g[ 	]+DO[ 	]+\*ABS\*[ 	]+0+[ 	]+VERS\.0[ 	]+VERS\.0
-[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+VERS\.0[ 	]+(0x[0-9a-f]+ )?foo
+[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+VERS\.0[ 	]+(0x[0-9a-f]+ )?_?foo
diff --git a/ld/testsuite/ld-elfvers/vers27a.dsym b/ld/testsuite/ld-elfvers/vers27a.dsym
index 6e6573a..a9d0313 100644
--- a/ld/testsuite/ld-elfvers/vers27a.dsym
+++ b/ld/testsuite/ld-elfvers/vers27a.dsym
@@ -1,2 +1,2 @@
 0+[ 	]+g[ 	]+DO[ 	]+\*ABS\*[ 	]+0+[ 	]+VERS\.0[ 	]+VERS\.0
-[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+VERS\.0[ 	]+(0x[0-9a-f]+ )?foo
+[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+VERS\.0[ 	]+(0x[0-9a-f]+ )?_?foo
diff --git a/ld/testsuite/ld-elfvers/vers27b.c b/ld/testsuite/ld-elfvers/vers27b.c
index 7b164c4..3fe5615 100644
--- a/ld/testsuite/ld-elfvers/vers27b.c
+++ b/ld/testsuite/ld-elfvers/vers27b.c
@@ -1,2 +1,3 @@
+#include "vers.h"
 void foo () {}
-asm (".hidden foo");
+asm (".hidden " SYMPFX(foo));
diff --git a/ld/testsuite/ld-elfvers/vers27d.dsym b/ld/testsuite/ld-elfvers/vers27d.dsym
index 58b56e8..c585799 100644
--- a/ld/testsuite/ld-elfvers/vers27d.dsym
+++ b/ld/testsuite/ld-elfvers/vers27d.dsym
@@ -1,2 +1,2 @@
 0+[ 	]+g[ 	]+DO[ 	]+\*ABS\*[ 	]+0+[ 	]+VERS\.0[ 	]+VERS\.0
-[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+\(VERS\.0\)[ 	]+(0x[0-9a-f]+ )?foo
+[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+\(VERS\.0\)[ 	]+(0x[0-9a-f]+ )?_?foo
diff --git a/ld/testsuite/ld-elfvers/vers27d.sym b/ld/testsuite/ld-elfvers/vers27d.sym
index d4946f5..d20bd1d 100644
--- a/ld/testsuite/ld-elfvers/vers27d.sym
+++ b/ld/testsuite/ld-elfvers/vers27d.sym
@@ -1 +1 @@
-[0-9a-f]+[ 	]+g[ 	]+F[ 	]+\.(text|opd)[ 	]+[0-9a-f]+ (0x[0-9a-f]+ )?foo@VERS\.0
+[0-9a-f]+[ 	]+g[ 	]+F[ 	]+\.(text|opd)[ 	]+[0-9a-f]+ (0x[0-9a-f]+ )?_?foo@VERS\.0
diff --git a/ld/testsuite/ld-elfvers/vers27d1.c b/ld/testsuite/ld-elfvers/vers27d1.c
index 3fc60b0..107e1c1 100644
--- a/ld/testsuite/ld-elfvers/vers27d1.c
+++ b/ld/testsuite/ld-elfvers/vers27d1.c
@@ -1,6 +1,8 @@
+#include "vers.h"
+
 void
 foo ()
 {
 }
 
-asm (".symver foo,foo@VERS.0");
+SYMVER(foo, foo@VERS.0);
diff --git a/ld/testsuite/ld-elfvers/vers27d4.dsym b/ld/testsuite/ld-elfvers/vers27d4.dsym
index 8c85a4a..dfd6a33 100644
--- a/ld/testsuite/ld-elfvers/vers27d4.dsym
+++ b/ld/testsuite/ld-elfvers/vers27d4.dsym
@@ -1 +1 @@
-[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +VERS\.0 +(0x[0-9a-f]+ )?foo
+[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +VERS\.0 +(0x[0-9a-f]+ )?_?foo
diff --git a/ld/testsuite/ld-elfvers/vers28b.dsym b/ld/testsuite/ld-elfvers/vers28b.dsym
index 750ee88..6c35c9b 100644
--- a/ld/testsuite/ld-elfvers/vers28b.dsym
+++ b/ld/testsuite/ld-elfvers/vers28b.dsym
@@ -1,2 +1,2 @@
 0+[ 	]+g[ 	]+DO[ 	]+\*ABS\*[ 	]+0+[ 	]+VERS\.0[ 	]+VERS\.0
-[0-9a-f]+[ 	]+w[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+VERS\.0[ 	]+(0x[0-9a-f]+ )?foo
+[0-9a-f]+[ 	]+w[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+VERS\.0[ 	]+(0x[0-9a-f]+ )?_?foo
diff --git a/ld/testsuite/ld-elfvers/vers28c.dsym b/ld/testsuite/ld-elfvers/vers28c.dsym
index 99f6d88..7ad5678 100644
--- a/ld/testsuite/ld-elfvers/vers28c.dsym
+++ b/ld/testsuite/ld-elfvers/vers28c.dsym
@@ -1 +1 @@
-[0-9a-f]+[ 	]+DF[ 	]+\*UND\*[	]+[0-9a-f]+[ 	]+VERS\.0[ 	]+(0x[0-9a-f]+ )?foo
+[0-9a-f]+[ 	]+DF[ 	]+\*UND\*[	]+[0-9a-f]+[ 	]+VERS\.0[ 	]+(0x[0-9a-f]+ )?_?foo
diff --git a/ld/testsuite/ld-elfvers/vers29.dsym b/ld/testsuite/ld-elfvers/vers29.dsym
index ed8a230..f983d43 100644
--- a/ld/testsuite/ld-elfvers/vers29.dsym
+++ b/ld/testsuite/ld-elfvers/vers29.dsym
@@ -1 +1 @@
-[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+vers29\.so[ 	]+(0x[0-9a-f]+ )?show
+[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+vers29\.so[ 	]+(0x[0-9a-f]+ )?_?show
diff --git a/ld/testsuite/ld-elfvers/vers3.dsym b/ld/testsuite/ld-elfvers/vers3.dsym
index 7396dee..a77f949 100644
--- a/ld/testsuite/ld-elfvers/vers3.dsym
+++ b/ld/testsuite/ld-elfvers/vers3.dsym
@@ -1 +1 @@
-[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?show_foo
+[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?_?show_foo
diff --git a/ld/testsuite/ld-elfvers/vers30.dsym b/ld/testsuite/ld-elfvers/vers30.dsym
index ddb21eb..5762f01 100644
--- a/ld/testsuite/ld-elfvers/vers30.dsym
+++ b/ld/testsuite/ld-elfvers/vers30.dsym
@@ -1,5 +1,5 @@
 0+ g    DO \*ABS\*	0+  VERS_30\.0   VERS_30\.0
-[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+  VERS_30\.0   global
-[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+  VERS_30\.0   foo
-[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+  VERS_30\.0   info
-[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+  VERS_30\.0   extern
+[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+  VERS_30\.0   _?global
+[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+  VERS_30\.0   _?foo
+[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+  VERS_30\.0   _?info
+[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+  VERS_30\.0   _?extern
diff --git a/ld/testsuite/ld-elfvers/vers31.dsym b/ld/testsuite/ld-elfvers/vers31.dsym
index 72dec06..fb22f5b 100644
--- a/ld/testsuite/ld-elfvers/vers31.dsym
+++ b/ld/testsuite/ld-elfvers/vers31.dsym
@@ -1,2 +1,2 @@
 0+ g +DO \*ABS\*	0+ +VERS_31\.0 +VERS_31\.0
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_31\.0 +_Z1fIA3_icEvPT_T0
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_31\.0 +_?_Z1fIA3_icEvPT_T0
diff --git a/ld/testsuite/ld-elfvers/vers32a.dsym b/ld/testsuite/ld-elfvers/vers32a.dsym
index 47d1b06..24deae4 100644
--- a/ld/testsuite/ld-elfvers/vers32a.dsym
+++ b/ld/testsuite/ld-elfvers/vers32a.dsym
@@ -1,2 +1,2 @@
 0+ g +DO \*ABS\*	0+ +VERS_1 +VERS_1
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_1 +(0x[0-9a-f]+ )?foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_1 +(0x[0-9a-f]+ )?_?foo
diff --git a/ld/testsuite/ld-elfvers/vers32b.dsym b/ld/testsuite/ld-elfvers/vers32b.dsym
index 88b3474..a2fc578 100644
--- a/ld/testsuite/ld-elfvers/vers32b.dsym
+++ b/ld/testsuite/ld-elfvers/vers32b.dsym
@@ -1,2 +1,2 @@
-[0-9a-f]+ g +D +\*ABS\*	[0-9a-f]+ +VERS_1 +(0x[0-9a-f]+ )?foo
+[0-9a-f]+ g +D +\*ABS\*	[0-9a-f]+ +VERS_1 +(0x[0-9a-f]+ )?_?foo
 0+ g +DO \*ABS\*	0+ +VERS_1 +VERS_1
diff --git a/ld/testsuite/ld-elfvers/vers4.c b/ld/testsuite/ld-elfvers/vers4.c
index 453f2eb..46ac432 100644
--- a/ld/testsuite/ld-elfvers/vers4.c
+++ b/ld/testsuite/ld-elfvers/vers4.c
@@ -5,6 +5,7 @@
  * -export-dynamic.
  */
 #include <stdio.h>
+#include "vers.h"
 
 extern int foo ();
 
@@ -21,7 +22,7 @@ new_foo()
 
 }
 
-__asm__(".symver new_foo,foo@@VERS_2.0");
+SYMVER(new_foo, foo@@VERS_2.0);
 
 int
 main()
diff --git a/ld/testsuite/ld-elfvers/vers4.sym b/ld/testsuite/ld-elfvers/vers4.sym
index 395e699..c48d1bb 100644
--- a/ld/testsuite/ld-elfvers/vers4.sym
+++ b/ld/testsuite/ld-elfvers/vers4.sym
@@ -1 +1 @@
-[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?foo@@VERS_2\.0
+[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?_?foo@@VERS_2\.0
diff --git a/ld/testsuite/ld-elfvers/vers4a.dsym b/ld/testsuite/ld-elfvers/vers4a.dsym
index a7efb0a..96dfea8 100644
--- a/ld/testsuite/ld-elfvers/vers4a.dsym
+++ b/ld/testsuite/ld-elfvers/vers4a.dsym
@@ -1,2 +1,2 @@
 0+ g    DO \*ABS\*	0+  VERS_2\.0    VERS_2\.0
-[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+  VERS_2\.0    (0x[0-9a-f]+ )?foo
+[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+  VERS_2\.0    (0x[0-9a-f]+ )?_?foo
diff --git a/ld/testsuite/ld-elfvers/vers4a.sym b/ld/testsuite/ld-elfvers/vers4a.sym
index 395e699..c48d1bb 100644
--- a/ld/testsuite/ld-elfvers/vers4a.sym
+++ b/ld/testsuite/ld-elfvers/vers4a.sym
@@ -1 +1 @@
-[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?foo@@VERS_2\.0
+[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?_?foo@@VERS_2\.0
diff --git a/ld/testsuite/ld-elfvers/vers5.c b/ld/testsuite/ld-elfvers/vers5.c
index cc6ea40..3cae67e 100644
--- a/ld/testsuite/ld-elfvers/vers5.c
+++ b/ld/testsuite/ld-elfvers/vers5.c
@@ -2,6 +2,8 @@
  * Testcase to verify that foo@BAR and foo@@BAR are correctly detected
  * as a multiply defined symbol.
  */
+#include "vers.h"
+
 const char * bar1 = "asdf";
 const char * bar2 = "asdf";
 
@@ -39,10 +41,10 @@ new_foo()
 
 }
 
-__asm__(".symver original_foo,foo@");
-__asm__(".symver old_foo,foo@VERS_1.1");
-__asm__(".symver old_foo1,foo@VERS_1.2");
-__asm__(".symver new_foo,foo@@VERS_1.2");
+SYMVER(original_foo, foo@);
+SYMVER(old_foo, foo@VERS_1.1);
+SYMVER(old_foo1, foo@VERS_1.2);
+SYMVER(new_foo, foo@@VERS_1.2);
 
 int
 main ()
diff --git a/ld/testsuite/ld-elfvers/vers6.c b/ld/testsuite/ld-elfvers/vers6.c
index 9e48df9..cb1c93f 100644
--- a/ld/testsuite/ld-elfvers/vers6.c
+++ b/ld/testsuite/ld-elfvers/vers6.c
@@ -3,6 +3,7 @@
  * that we always get the right one.
  */
 #include <stdio.h>
+#include "vers.h"
 
 extern int foo_1();
 extern int foo_2();
@@ -19,7 +20,7 @@ main()
   return 0;
 }
 
-__asm__(".symver foo_1,show_foo@");
-__asm__(".symver foo_2,show_foo@VERS_1.1");
-__asm__(".symver foo_3,show_foo@VERS_1.2");
-__asm__(".symver foo_4,show_foo@VERS_2.0");
+SYMVER(foo_1, show_foo@);
+SYMVER(foo_2, show_foo@VERS_1.1);
+SYMVER(foo_3, show_foo@VERS_1.2);
+SYMVER(foo_4, show_foo@VERS_2.0);
diff --git a/ld/testsuite/ld-elfvers/vers6.dsym b/ld/testsuite/ld-elfvers/vers6.dsym
index 79e9061..a53099b 100644
--- a/ld/testsuite/ld-elfvers/vers6.dsym
+++ b/ld/testsuite/ld-elfvers/vers6.dsym
@@ -1,4 +1,4 @@
-[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +VERS_2.0 +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +VERS_1.2 +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +VERS_1.1 +(0x[0-9a-f]+ )?show_foo
+[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +VERS_2.0 +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +VERS_1.2 +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ +DF \*UND\*	[0-9a-f]+ +VERS_1.1 +(0x[0-9a-f]+ )?_?show_foo
diff --git a/ld/testsuite/ld-elfvers/vers6.sym b/ld/testsuite/ld-elfvers/vers6.sym
index 801f7b3..ae68d72 100644
--- a/ld/testsuite/ld-elfvers/vers6.sym
+++ b/ld/testsuite/ld-elfvers/vers6.sym
@@ -1,4 +1,4 @@
-0+ *F? *\*UND\*	0+ show_foo@
-0+ *F? *\*UND\*	0+ show_foo@VERS_1\.1
-0+ *F? *\*UND\*	0+ show_foo@VERS_1\.2
-0+ *F? *\*UND\*	0+ show_foo@VERS_2\.0
+0+ *F? *\*UND\*	0+ _?show_foo@
+0+ *F? *\*UND\*	0+ _?show_foo@VERS_1\.1
+0+ *F? *\*UND\*	0+ _?show_foo@VERS_1\.2
+0+ *F? *\*UND\*	0+ _?show_foo@VERS_2\.0
diff --git a/ld/testsuite/ld-elfvers/vers7a.c b/ld/testsuite/ld-elfvers/vers7a.c
index 7bee8c7..f3d2a2d 100644
--- a/ld/testsuite/ld-elfvers/vers7a.c
+++ b/ld/testsuite/ld-elfvers/vers7a.c
@@ -2,6 +2,8 @@
  * Test supplied by Ulrich.  Verify that we can correctly force 'a'
  * to local scope.
  */
+#include "vers.h"
+
 int
 __a_internal (int e)
 {
@@ -14,5 +16,5 @@ __b_internal (int e)
   return e + 42;
 }
 
-asm (".symver __a_internal,hide_a@@VERS_1");
-asm (".symver __b_internal,show_b@@VERS_1");
+SYMVER(__a_internal, hide_a@@VERS_1);
+SYMVER(__b_internal, show_b@@VERS_1);
diff --git a/ld/testsuite/ld-elfvers/vers7a.dsym b/ld/testsuite/ld-elfvers/vers7a.dsym
index 8434925..89a45a5 100644
--- a/ld/testsuite/ld-elfvers/vers7a.dsym
+++ b/ld/testsuite/ld-elfvers/vers7a.dsym
@@ -1,2 +1,2 @@
 0+ g +DO \*ABS\*	0+ +VERS_1 +VERS_1
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_1 +(0x[0-9a-f]+ )?show_b
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_1 +(0x[0-9a-f]+ )?_?show_b
diff --git a/ld/testsuite/ld-elfvers/vers7a.sym b/ld/testsuite/ld-elfvers/vers7a.sym
index 94d9312..ef8d04b 100644
--- a/ld/testsuite/ld-elfvers/vers7a.sym
+++ b/ld/testsuite/ld-elfvers/vers7a.sym
@@ -1,2 +1,2 @@
-[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?hide_a@@VERS_1
-[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?show_b@@VERS_1
+[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?_?hide_a@@VERS_1
+[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?_?show_b@@VERS_1
diff --git a/ld/testsuite/ld-elfvers/vers9.c b/ld/testsuite/ld-elfvers/vers9.c
index bef1402..5079364 100644
--- a/ld/testsuite/ld-elfvers/vers9.c
+++ b/ld/testsuite/ld-elfvers/vers9.c
@@ -2,6 +2,8 @@
  * Testcase to verify that reference to foo@BAR and a definition of foo@@BAR
  * are not treated as a multiple def.
  */
+#include "vers.h"
+
 const char * bar1 = "asdf";
 const char * bar2 = "asdf";
 
@@ -41,7 +43,7 @@ main()
   return 0;
 }
 
-__asm__(".symver original_foo,foo@");
-__asm__(".symver old_foo,foo@VERS_1.1");
-__asm__(".symver old_foo1,foo@VERS_1.2");
-__asm__(".symver new_foo,foo@@VERS_1.2");
+SYMVER(original_foo, foo@);
+SYMVER(old_foo, foo@VERS_1.1);
+SYMVER(old_foo1, foo@VERS_1.2);
+SYMVER(new_foo, foo@@VERS_1.2);
diff --git a/ld/testsuite/ld-elfvers/vers9.dsym b/ld/testsuite/ld-elfvers/vers9.dsym
index 5443e67..411451a 100644
--- a/ld/testsuite/ld-elfvers/vers9.dsym
+++ b/ld/testsuite/ld-elfvers/vers9.dsym
@@ -1,4 +1,4 @@
 0+ g +DO \*ABS\*	0+ +VERS_1\.1 +VERS_1\.1
 0+ g +DO \*ABS\*	0+ +VERS_1\.2 +VERS_1\.2
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ \(VERS_1\.1\) +(0x[0-9a-f]+ )?foo
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_1\.2 +(0x[0-9a-f]+ )?foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ \(VERS_1\.1\) +(0x[0-9a-f]+ )?_?foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*)	[0-9a-f]+ +VERS_1\.2 +(0x[0-9a-f]+ )?_?foo
diff --git a/ld/testsuite/ld-elfvers/vers9.sym b/ld/testsuite/ld-elfvers/vers9.sym
index 6d6585f..be0e6dd 100644
--- a/ld/testsuite/ld-elfvers/vers9.sym
+++ b/ld/testsuite/ld-elfvers/vers9.sym
@@ -1,4 +1,4 @@
-0+ *F? *\*UND\*	0+ foo@VERS_1\.2
-[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?foo@
-[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?foo@VERS_1\.1
-[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?foo@@VERS_1\.2
+0+ *F? *\*UND\*	0+ _?foo@VERS_1\.2
+[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?_?foo@
+[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?_?foo@VERS_1\.1
+[0-9a-f]+ g +F \.(text|opd)	[0-9a-f]+ (0x[0-9a-f]+ )?_?foo@@VERS_1\.2
-- 
1.7.3.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ld: elfvers tests: support symbol prefixed targets
  2010-12-09 21:05 [PATCH] ld: elfvers tests: support symbol prefixed targets Mike Frysinger
@ 2010-12-10  0:24 ` Alan Modra
  2010-12-10  3:55   ` Mike Frysinger
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Modra @ 2010-12-10  0:24 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: binutils, toolchain-devel

On Thu, Dec 09, 2010 at 04:05:07PM -0500, Mike Frysinger wrote:
> Now that the tests are usable on prefixed targets, update the tests
> to take into account an optional leading underscore.

OK.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ld: elfvers tests: support symbol prefixed targets
  2010-12-10  0:24 ` Alan Modra
@ 2010-12-10  3:55   ` Mike Frysinger
  2010-12-10  5:11     ` Alan Modra
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Frysinger @ 2010-12-10  3:55 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils, toolchain-devel

[-- Attachment #1: Type: Text/Plain, Size: 391 bytes --]

On Thursday, December 09, 2010 19:24:41 Alan Modra wrote:
> On Thu, Dec 09, 2010 at 04:05:07PM -0500, Mike Frysinger wrote:
> > Now that the tests are usable on prefixed targets, update the tests
> > to take into account an optional leading underscore.
> 
> OK.

sorry, but are you approving the whole patch or just the changes to the sym/rd 
files which tweak the regexps ?
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ld: elfvers tests: support symbol prefixed targets
  2010-12-10  3:55   ` Mike Frysinger
@ 2010-12-10  5:11     ` Alan Modra
  2010-12-10  6:08       ` Mike Frysinger
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Modra @ 2010-12-10  5:11 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: binutils, toolchain-devel

On Thu, Dec 09, 2010 at 10:55:11PM -0500, Mike Frysinger wrote:
> On Thursday, December 09, 2010 19:24:41 Alan Modra wrote:
> > On Thu, Dec 09, 2010 at 04:05:07PM -0500, Mike Frysinger wrote:
> > > Now that the tests are usable on prefixed targets, update the tests
> > > to take into account an optional leading underscore.
> > 
> > OK.
> 
> sorry, but are you approving the whole patch or just the changes to the sym/rd 
> files which tweak the regexps ?

The whole patch in that message.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ld: elfvers tests: support symbol prefixed targets
  2010-12-10  5:11     ` Alan Modra
@ 2010-12-10  6:08       ` Mike Frysinger
  2010-12-11 12:58         ` Alan Modra
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Frysinger @ 2010-12-10  6:08 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils, toolchain-devel

[-- Attachment #1: Type: Text/Plain, Size: 616 bytes --]

On Friday, December 10, 2010 00:10:59 Alan Modra wrote:
> On Thu, Dec 09, 2010 at 10:55:11PM -0500, Mike Frysinger wrote:
> > On Thursday, December 09, 2010 19:24:41 Alan Modra wrote:
> > > On Thu, Dec 09, 2010 at 04:05:07PM -0500, Mike Frysinger wrote:
> > > > Now that the tests are usable on prefixed targets, update the tests
> > > > to take into account an optional leading underscore.
> > > 
> > > OK.
> > 
> > sorry, but are you approving the whole patch or just the changes to the
> > sym/rd files which tweak the regexps ?
> 
> The whole patch in that message.

thanks, committed then
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ld: elfvers tests: support symbol prefixed targets
  2010-12-10  6:08       ` Mike Frysinger
@ 2010-12-11 12:58         ` Alan Modra
  2010-12-11 14:21           ` [toolchain-devel] " Mike Frysinger
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Modra @ 2010-12-11 12:58 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: binutils, toolchain-devel

	* ld-elfvers/vers25a.dsym: Really include _? in match.

Index: ld/testsuite/ld-elfvers/vers25a.dsym
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-elfvers/vers25a.dsym,v
retrieving revision 1.3
diff -u -p -r1.3 vers25a.dsym
--- ld/testsuite/ld-elfvers/vers25a.dsym	10 Dec 2010 06:08:11 -0000	1.3
+++ ld/testsuite/ld-elfvers/vers25a.dsym	11 Dec 2010 12:00:58 -0000
@@ -1,2 +1,2 @@
 0+[ 	]+g[ 	]+DO[ 	]+\*ABS\*[ 	]+0+[ 	]+VERS\.0[ 	]+VERS\.0
-[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+VERS\.0[ 	]+(0x[0-9a-f]+ )?_foo
+[0-9a-f]+[ 	]+g[ 	]+DF[ 	]+\.(text|opd)[	]+[0-9a-f]+[ 	]+VERS\.0[ 	]+(0x[0-9a-f]+ )?_?foo

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [toolchain-devel] [PATCH] ld: elfvers tests: support symbol prefixed targets
  2010-12-11 12:58         ` Alan Modra
@ 2010-12-11 14:21           ` Mike Frysinger
  0 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2010-12-11 14:21 UTC (permalink / raw)
  To: binutils, toolchain-devel

On Sat, Dec 11, 2010 at 07:57, Alan Modra wrote:
>        * ld-elfvers/vers25a.dsym: Really include _? in match.

sorry about that.  i went though my commit again and i think this is
the only one i missed.
-mike

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-12-11 14:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-09 21:05 [PATCH] ld: elfvers tests: support symbol prefixed targets Mike Frysinger
2010-12-10  0:24 ` Alan Modra
2010-12-10  3:55   ` Mike Frysinger
2010-12-10  5:11     ` Alan Modra
2010-12-10  6:08       ` Mike Frysinger
2010-12-11 12:58         ` Alan Modra
2010-12-11 14:21           ` [toolchain-devel] " Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).