+2010-12-10 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.
+
2010-12-05 H.J. Lu <hongjiu.lu@intel.com>
* ld-plugin/plugin-vis-1.d: Updated.
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
#...
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
#...
--- /dev/null
+/* 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))
* 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";
}
-__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);
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
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
bar33();
}
-__asm__(".symver bar33,bar@@VERS_2.0");
+SYMVER(bar33, bar@@VERS_2.0);
#endif
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
-[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
* that we always get the right one.
*/
#include <stdio.h>
+#include "vers.h"
int
foo_1()
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);
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
-[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
-[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
[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
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
+#include "vers.h"
+
int
bar ()
{
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);
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
-[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
-[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-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
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
-__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 ()
0+[ ]+g[ ]+DO[ ]+\*ABS\*[ ]+0+[ ]+VERS\.0[ ]+VERS\.0
-[0-9a-f]+[ ]+w[ ]+DF[ ]+\.(text|opd)[ ]+[0-9a-f]+[ ]+\(VERS\.0\)[ ]+(0x[0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]+\.(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
-[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
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
-[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
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
/* 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);
/* 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;
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
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]+ )?fo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 ]+[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
-[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
-[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
-[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_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
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
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
-[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
* -export-dynamic.
*/
#include <stdio.h>
+#include "vers.h"
extern int foo ();
}
-__asm__(".symver new_foo,foo@@VERS_2.0");
+SYMVER(new_foo, foo@@VERS_2.0);
int
main()
-[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
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
-[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
* 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";
}
-__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 ()
* that we always get the right one.
*/
#include <stdio.h>
+#include "vers.h"
extern int foo_1();
extern int foo_2();
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);
-[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
-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
* Test supplied by Ulrich. Verify that we can correctly force 'a'
* to local scope.
*/
+#include "vers.h"
+
int
__a_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);
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
-[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
* 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";
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);
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
-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