1 int
library_func1(void)2 library_func1 (void)
3 {
4   return 2;
5 }
6 
7 int global = 1;
8 
9 #ifdef WITH_IFUNC
10 
minus_one(void)11 static int minus_one (void) { return -1; }
zero(void)12 static int zero (void) { return 0; }
13 
14 void * library_func2_ifunc (void) __asm__ ("library_func2");
library_func2_ifunc(void)15 void * library_func2_ifunc (void) { return global ? minus_one : zero ; }
16 __asm__(".type library_func2, %gnu_indirect_function");
17 
18 extern int library_func2 (int);
19 extern __typeof (library_func2) library_func2 __asm__ ("__GI_library_func2");
20 
21 __asm__(".global __GI_library_func2");
22 __asm__(".hidden __GI_library_func2");
23 __asm__("__GI_library_func2 = library_func2");
24 
25 int
library_func(int x)26 library_func (int x)
27 {
28   return library_func2 (x);
29 }
30 
31 #else /* WITHOUT_IFUNC */
32 
33 int
library_func2(void)34 library_func2 (void)
35 {
36   return 3;
37 }
38 
39 #endif
40