about summary refs log tree commit diff
path: root/elf/ifuncmod1.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/ifuncmod1.c
parent51a71cf063505d689337cf998670691a0a4b2410 (diff)
downloadglibc-31c759bf37a7a41faf8b13800deb769e8a5f3871.tar.gz
glibc-31c759bf37a7a41faf8b13800deb769e8a5f3871.tar.xz
glibc-31c759bf37a7a41faf8b13800deb769e8a5f3871.zip
Uglify IFUNC tests for PPC.
Diffstat (limited to 'elf/ifuncmod1.c')
-rw-r--r--elf/ifuncmod1.c41
1 files changed, 9 insertions, 32 deletions
diff --git a/elf/ifuncmod1.c b/elf/ifuncmod1.c
index a1697b596d..2b8195ce55 100644
--- a/elf/ifuncmod1.c
+++ b/elf/ifuncmod1.c
@@ -4,8 +4,9 @@
    2. Function pointer.
    3. Visibility.
  */
+#include "ifunc-sel.h"
 
-extern int global;
+int global __attribute__ ((visibility ("protected"))) = -1;
 
 static int
 one (void)
@@ -20,7 +21,7 @@ minus_one (void)
 }
 
 static int
-zero (void) 
+zero (void)
 {
   return 0;
 }
@@ -28,52 +29,28 @@ zero (void)
 void * foo_ifunc (void) __asm__ ("foo");
 __asm__(".type foo, %gnu_indirect_function");
 
-void * 
+void *
 foo_ifunc (void)
 {
-  switch (global)
-    {
-    case 1:
-      return one;
-    case -1:
-      return minus_one;
-    default:
-      return zero;
-    }
+  return ifunc_sel (one, minus_one, zero);
 }
 
 void * foo_hidden_ifunc (void) __asm__ ("foo_hidden");
 __asm__(".type foo_hidden, %gnu_indirect_function");
 
-void * 
+void *
 foo_hidden_ifunc (void)
 {
-  switch (global)
-    {
-    case 1:
-      return minus_one;
-    case -1:
-      return one;
-    default:
-      return zero;
-    }
+  return ifunc_sel (minus_one, one, zero);
 }
 
 void * foo_protected_ifunc (void) __asm__ ("foo_protected");
 __asm__(".type foo_protected, %gnu_indirect_function");
 
-void * 
+void *
 foo_protected_ifunc (void)
 {
-  switch (global)
-    {
-    case 1:
-      return one;
-    case -1:
-      return zero;
-    default:
-      return minus_one;
-    }
+  return ifunc_sel (one, zero, minus_one);
 }
 
 /* Test hidden indirect function.  */