about summary refs log tree commit diff
path: root/elf/ifuncmain5.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2022-11-04 18:37:16 +0100
committerFlorian Weimer <fweimer@redhat.com>2022-11-04 18:46:22 +0100
commit9cc9d61ee12f2f8620d8e0ea3c42af02bf07fe1e (patch)
tree30e83b09e9d3088b4de446a1061daf6dace4e8c0 /elf/ifuncmain5.c
parent2ff48a4025515e93d722947a9eabb114f4a65b22 (diff)
downloadglibc-9cc9d61ee12f2f8620d8e0ea3c42af02bf07fe1e.tar.gz
glibc-9cc9d61ee12f2f8620d8e0ea3c42af02bf07fe1e.tar.xz
glibc-9cc9d61ee12f2f8620d8e0ea3c42af02bf07fe1e.zip
elf: Disable some subtests of ifuncmain1, ifuncmain5 for !PIE
Diffstat (limited to 'elf/ifuncmain5.c')
-rw-r--r--elf/ifuncmain5.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/elf/ifuncmain5.c b/elf/ifuncmain5.c
index f398085cb4..6fda768fb6 100644
--- a/elf/ifuncmain5.c
+++ b/elf/ifuncmain5.c
@@ -14,12 +14,19 @@ get_foo (void)
   return foo;
 }
 
+
+/* Address-significant access to protected symbols is not supported in
+   position-dependent mode on several architectures because GCC
+   generates relocations that assume that the address is local to the
+   main program.  */
+#ifdef __PIE__
 foo_p
 __attribute__ ((noinline))
 get_foo_protected (void)
 {
   return foo_protected;
 }
+#endif
 
 int
 main (void)
@@ -30,9 +37,11 @@ main (void)
   if ((*p) () != -1)
     abort ();
 
+#ifdef __PIE__
   p = get_foo_protected ();
   if ((*p) () != 0)
     abort ();
+#endif
 
   return 0;
 }