1 int foo (int x) __attribute__ ((ifunc ("resolve_foo"))); 2 extern void abort (void); 3 foo_impl(int x)4static int foo_impl(int x) 5 { 6 return x; 7 } 8 bar()9int bar() 10 { 11 int (*f)(int) = foo; 12 13 if (foo (5) != 5) 14 abort (); 15 16 if (f(42) != 42) 17 abort (); 18 } 19 20 resolve_foo(void)21void *resolve_foo (void) 22 { 23 return (void *) foo_impl; 24 } 25