aboutsummaryrefslogtreecommitdiff
path: root/elf/ifuncdep2.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/ifuncdep2.c')
-rw-r--r--elf/ifuncdep2.c34
1 files changed, 6 insertions, 28 deletions
diff --git a/elf/ifuncdep2.c b/elf/ifuncdep2.c
index fb21eef5cb..758bae1932 100644
--- a/elf/ifuncdep2.c
+++ b/elf/ifuncdep2.c
@@ -1,6 +1,8 @@
/* Test 3 STT_GNU_IFUNC symbols. */
-extern int global;
+#include "ifunc-sel.h"
+
+int global __attribute__ ((visibility ("protected"))) = -1;
static int
one (void)
@@ -26,15 +28,7 @@ __asm__(".type foo1, %gnu_indirect_function");
void *
foo1_ifunc (void)
{
- switch (global)
- {
- case 1:
- return one;
- case -1:
- return minus_one;
- default:
- return zero;
- }
+ return ifunc_sel (one, minus_one, zero);
}
void * foo2_ifunc (void) __asm__ ("foo2");
@@ -43,15 +37,7 @@ __asm__(".type foo2, %gnu_indirect_function");
void *
foo2_ifunc (void)
{
- switch (global)
- {
- case 1:
- return minus_one;
- case -1:
- return one;
- default:
- return zero;
- }
+ return ifunc_sel (minus_one, one, zero);
}
void * foo3_ifunc (void) __asm__ ("foo3");
@@ -60,13 +46,5 @@ __asm__(".type foo3, %gnu_indirect_function");
void *
foo3_ifunc (void)
{
- switch (global)
- {
- case 1:
- return one;
- case -1:
- return zero;
- default:
- return minus_one;
- }
+ return ifunc_sel (one, zero, minus_one);
}