Commit | Line | Data |
---|---|---|
bf3077a6 MM |
1 | #define _GNU_SOURCE |
2 | #include <stdlib.h> | |
3 | #include <stdio.h> | |
4 | #include <dlfcn.h> | |
5 | ||
6 | extern int foo (void); | |
7 | ||
8 | extern int __start___verbose[]; | |
9 | extern int __stop___verbose[]; | |
10 | int bar (void) | |
11 | { | |
f000c2b9 | 12 | static int my_var __attribute__((section("__verbose"), used)) = 6; |
bf3077a6 MM |
13 | int *ptr; |
14 | ptr = (int*) dlsym(RTLD_DEFAULT, "__start___verbose"); | |
15 | if (!ptr || *ptr != 6) | |
16 | return -1; | |
17 | return 0; | |
18 | } | |
19 | ||
20 | int main() | |
21 | { | |
22 | if (bar () == 0) | |
23 | printf ("PASS\n"); | |
24 | ||
25 | return 0; | |
26 | } |