about summary refs log tree commit diff
path: root/sysdeps/powerpc/powerpc64/configure
diff options
context:
space:
mode:
authorTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>2020-07-10 19:41:06 -0300
committerTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>2020-07-10 19:41:06 -0300
commit7c7bcf3634e44cf7e001aaa302138c1ee0e58f8c (patch)
treeefc90e1b49ce51b1ec962f034ca6ba872ad3c6c7 /sysdeps/powerpc/powerpc64/configure
parent936c9666aed6747f7a76221118f7cf59100075e6 (diff)
downloadglibc-7c7bcf3634e44cf7e001aaa302138c1ee0e58f8c.tar.gz
glibc-7c7bcf3634e44cf7e001aaa302138c1ee0e58f8c.tar.xz
glibc-7c7bcf3634e44cf7e001aaa302138c1ee0e58f8c.zip
powerpc64: Fix calls when r2 is not used [BZ #26173]
Teach the linker that __mcount_internal, __sigjmp_save_symbol,
__syscall_error and __GI_exit do not use r2, so that it does not need to
recover r2 after the call.

Test at configure time if the assembler supports @notoc and define
USE_PPC64_NOTOC.
Diffstat (limited to 'sysdeps/powerpc/powerpc64/configure')
-rw-r--r--sysdeps/powerpc/powerpc64/configure28
1 files changed, 28 insertions, 0 deletions
diff --git a/sysdeps/powerpc/powerpc64/configure b/sysdeps/powerpc/powerpc64/configure
index 7632a7be04..5ce77af631 100644
--- a/sysdeps/powerpc/powerpc64/configure
+++ b/sysdeps/powerpc/powerpc64/configure
@@ -31,3 +31,31 @@ if test x$libc_cv_overlapping_opd = xyes; then
   $as_echo "#define USE_PPC64_OVERLAPPING_OPD 1" >>confdefs.h
 
 fi
+
+# @notoc started to be supported in GNU Binutils 2.31.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the assembler supports @notoc" >&5
+$as_echo_n "checking if the assembler supports @notoc... " >&6; }
+if ${libc_cv_ppc64_notoc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+	       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+void foo (void) {asm("b foo@notoc");}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  libc_cv_ppc64_notoc=yes
+else
+  libc_cv_ppc64_notoc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ppc64_notoc" >&5
+$as_echo "$libc_cv_ppc64_notoc" >&6; }
+if test x$libc_cv_ppc64_notoc = xyes; then :
+  $as_echo "#define USE_PPC64_NOTOC 1" >>confdefs.h
+
+fi