]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - elf/ifuncmain6pie.c
install.texi: Build was tested with binutils 2.41 (just released)
[thirdparty/glibc.git] / elf / ifuncmain6pie.c
index 06f179bf9d8681367b9721ec3a86b93ea0e0702a..4a01906836173e3a2e1a5a87b1d20dc793f48beb 100644 (file)
@@ -6,9 +6,9 @@
  */
 
 #include <stdlib.h>
+#include "ifunc-sel.h"
 
 typedef int (*foo_p) (void);
-extern foo_p foo_ptr;
 
 static int
 one (void)
@@ -20,26 +20,24 @@ void * foo_ifunc (void) __asm__ ("foo");
 __asm__(".type foo, %gnu_indirect_function");
 
 void *
+inhibit_stack_protector
 foo_ifunc (void)
 {
-  return one;
+  return ifunc_one (one);
 }
 
 extern int foo (void);
-extern foo_p get_foo (void);
+extern int call_foo (void);
 extern foo_p get_foo_p (void);
 
-foo_p my_foo_ptr = foo;
+foo_p foo_ptr = foo;
 
 int
 main (void)
 {
   foo_p p;
 
-  p = get_foo ();
-  if (p != foo)
-    abort ();
-  if ((*p) () != -30)
+  if (call_foo () != -30)
     abort ();
 
   p = get_foo_p ();
@@ -50,12 +48,8 @@ main (void)
 
   if (foo_ptr != foo)
     abort ();
-  if (my_foo_ptr != foo)
-    abort ();
   if ((*foo_ptr) () != -30)
     abort ();
-  if ((*my_foo_ptr) () != -30)
-    abort ();
   if (foo () != -30)
     abort ();