From b9e33f301ea91a4d15666e882acd35e65ec68d41 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 10 Dec 2010 06:08:11 +0000 Subject: ld: elfvers tests: support symbol prefixed targets 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 --- ld/testsuite/ld-elfvers/vers1.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'ld/testsuite/ld-elfvers/vers1.c') 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 -- cgit v1.1