1 void foo() __attribute__((ifunc("resolve_foo"))); 2 foo_impl()3static void foo_impl() {} 4 5 extern void abort (void); test()6void test() 7 { 8 void (*pg)(void) = foo; 9 if (pg != foo_impl) 10 abort (); 11 pg(); 12 } 13 resolve_foo()14static void* resolve_foo() 15 { 16 extern void zoo(void); 17 18 void (*pz)(void) = zoo; 19 pz(); 20 return foo_impl; 21 } 22