1 /* Test STT_GNU_IFUNC symbols:
3 1. Direct function call.
9 int global
__attribute__ ((visibility ("protected"))) = -1;
29 void * foo_ifunc (void) __asm__ ("foo");
30 __asm__(".type foo, %gnu_indirect_function");
35 return ifunc_sel (one
, minus_one
, zero
);
38 void * foo_hidden_ifunc (void) __asm__ ("foo_hidden");
39 __asm__(".type foo_hidden, %gnu_indirect_function");
42 foo_hidden_ifunc (void)
44 return ifunc_sel (minus_one
, one
, zero
);
47 void * foo_protected_ifunc (void) __asm__ ("foo_protected");
48 __asm__(".type foo_protected, %gnu_indirect_function");
51 foo_protected_ifunc (void)
53 return ifunc_sel (one
, zero
, minus_one
);
56 /* Test hidden indirect function. */
57 __asm__(".hidden foo_hidden");
59 /* Test protected indirect function. */
60 __asm__(".protected foo_protected");
62 extern int foo (void);
63 extern int foo_hidden (void);
64 extern int foo_protected (void);
66 extern int ret_foo_hidden
;
67 extern int ret_foo_protected
;
70 typedef int (*foo_p
) (void);
80 get_foo_hidden_p (void)
82 ret_foo_hidden
= foo_hidden ();
87 get_foo_protected_p (void)
89 ret_foo_protected
= foo_protected ();