1 #include <stdio.h> 2 #include <bfd_stdint.h> 3 4 extern void foo (void); 5 extern void check_ptr_eq (void *, void *); 6 7 void new_foo(void)8new_foo (void) 9 { 10 } 11 12 __asm__(".symver new_foo, foo@@VERS_2.0"); 13 14 #if defined(__GNUC__) && (__GNUC__ * 1000 + __GNUC_MINOR__) >= 4005 15 __attribute__ ((noinline, noclone)) 16 #else 17 __attribute__ ((noinline)) 18 #endif 19 int bar(void)20bar (void) 21 { 22 return (intptr_t) &foo == 0x12345678 ? 1 : 0; 23 } 24 25 int main(void)26main(void) 27 { 28 bar (); 29 check_ptr_eq (&foo, &new_foo); 30 printf("PASS\n"); 31 return 0; 32 } 33