/* On powerpc64, use overlapping .opd entries. */
#undef USE_PPC64_OVERLAPPING_OPD
+/* On powerpc64, use @notoc. */
+#undef USE_PPC64_NOTOC
+
/* Define if _Unwind_Find_FDE should be exported from glibc. */
#undef EXPORT_UNWIND_FIND_FDE
$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
if test x$libc_cv_overlapping_opd = xyes; then
AC_DEFINE(USE_PPC64_OVERLAPPING_OPD)
fi
+
+# @notoc started to be supported in GNU Binutils 2.31.
+AC_CACHE_CHECK([if the assembler supports @notoc],
+ libc_cv_ppc64_notoc, [
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+void foo (void) {asm("b foo@notoc");}
+ ])],
+ [libc_cv_ppc64_notoc=yes],
+ [libc_cv_ppc64_notoc=no])])
+AS_IF([test x$libc_cv_ppc64_notoc = xyes],
+ [AC_DEFINE(USE_PPC64_NOTOC)])
cfi_adjust_cfa_offset (FRAME_MIN_SIZE)
cfi_offset (lr, FRAME_LR_SAVE)
ld r3, FRAME_LR_SAVE(r11)
- bl JUMPTARGET(__mcount_internal)
+ bl JUMPTARGET (NOTOC (__mcount_internal))
#ifndef SHARED
nop
#endif
li r3,0
blr
#elif defined SHARED
- b JUMPTARGET (__sigjmp_save_symbol)
+ b JUMPTARGET (NOTOC (__sigjmp_save_symbol))
#else
mflr r0
std r0,FRAME_LR_SAVE(r1)
#ifdef SHARED
#define TAIL_CALL_SYSCALL_ERROR \
- b JUMPTARGET(__syscall_error)
+ b JUMPTARGET (NOTOC (__syscall_error))
#else
/* Static version might be linked into a large app with a toc exceeding
64k. We can't put a toc adjusting stub on a plain branch, so can't
lwz rOUT,0(rOUT)
#endif
+#ifdef USE_PPC64_NOTOC
+# define NOTOC(l) l@notoc
+#else
+# define NOTOC(l) l
+#endif
+
#else /* !__ASSEMBLER__ */
#if _CALL_ELF != 2
li r3,-1
L(do_exit):
#ifdef SHARED
- b JUMPTARGET(__GI_exit);
+ b JUMPTARGET (NOTOC (__GI_exit));
#else
b JUMPTARGET(exit);
nop