ld/testsuite/ld-elfvers/vers4.c
raw| 1 | /* |
| 2 | * Testcase to make sure that a versioned symbol definition in an |
| 3 | * application correctly defines the version node, if and only if |
| 4 | * the actual symbol is exported. This is built both with and without |
| 5 | * -export-dynamic. |
| 6 | */ |
| 7 | #include <stdio.h> |
| 8 | |
| 9 | extern int foo (); |
| 10 | |
| 11 | int |
| 12 | bar() |
| 13 | { |
| 14 | return 3; |
| 15 | } |
| 16 | |
| 17 | int |
| 18 | new_foo() |
| 19 | { |
| 20 | return 1000+bar(); |
| 21 | |
| 22 | } |
| 23 | |
| 24 | __asm__(".symver new_foo,foo@@VERS_2.0"); |
| 25 | |
| 26 | int |
| 27 | main() |
| 28 | { |
| 29 | printf("%d\n", foo()); |
| 30 | return 0; |
| 31 | } |