From 7c7bcf3634e44cf7e001aaa302138c1ee0e58f8c Mon Sep 17 00:00:00 2001 From: Tulio Magno Quites Machado Filho Date: Fri, 10 Jul 2020 19:41:06 -0300 Subject: 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. --- sysdeps/powerpc/powerpc64/configure | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'sysdeps/powerpc/powerpc64/configure') 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 -- cgit 1.4.1