* ld-arm/gc-hidden-1.d: Fix disassembly pattern.
[deliverable/binutils-gdb.git] / ld / testsuite / ld-ifunc / lib.c
CommitLineData
d8045f23
NC
1int
2library_func1 (void)
3{
4 return 2;
5}
6
7int global = 1;
8
9#ifdef WITH_IFUNC
10
11static int minus_one (void) { return -1; }
12static int zero (void) { return 0; }
13
14void * library_func2_ifunc (void) __asm__ ("library_func2");
15void * library_func2_ifunc (void) { return global ? minus_one : zero ; }
16__asm__(".type library_func2, %gnu_indirect_function");
17
cbe950e9
L
18extern int library_func2 (int);
19extern __typeof (library_func2) library_func2 __asm__ ("__GI_library_func2");
20
21__asm__(".global __GI_library_func2");
22__asm__(".hidden __GI_library_func2");
23__asm__(".set __GI_library_func2, library_func2");
24
25int
26library_func (int x)
27{
28 return library_func2 (x);
29}
30
d8045f23
NC
31#else /* WITHOUT_IFUNC */
32
33int
34library_func2 (void)
35{
36 return 3;
37}
38
39#endif
This page took 0.143023 seconds and 4 git commands to generate.