aboutsummaryrefslogtreecommitdiff
path: root/elf/ifuncdep2.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2009-10-30 00:48:54 -0700
committerUlrich Drepper <drepper@redhat.com>2009-10-30 00:48:54 -0700
commit31c759bf37a7a41faf8b13800deb769e8a5f3871 (patch)
treeb1e594e990e74cff74ab667cfb4a57faa790e6dd /elf/ifuncdep2.c
parent51a71cf063505d689337cf998670691a0a4b2410 (diff)
downloadglibc-31c759bf37a7a41faf8b13800deb769e8a5f3871.tar
glibc-31c759bf37a7a41faf8b13800deb769e8a5f3871.tar.gz
glibc-31c759bf37a7a41faf8b13800deb769e8a5f3871.tar.bz2
glibc-31c759bf37a7a41faf8b13800deb769e8a5f3871.zip
Uglify IFUNC tests for PPC.
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);
}