+
+ AC_MSG_CHECKING(assembler and linker for explicit JALR relocation)
+ gcc_cv_as_ld_jalr_reloc=no
+ if test $gcc_cv_as_mips_explicit_relocs = yes; then
+ if test $in_tree_ld = yes ; then
+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 20 -o "$gcc_cv_gld_major_version" -gt 2 \
+ && test $in_tree_ld_is_elf = yes; then
+ gcc_cv_as_ld_jalr_reloc=yes
+ fi
+ elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x; then
+ echo ' .ent x' > conftest.s
+ echo 'x: ld $2,%got_disp(y)($3)' >> conftest.s
+ echo ' ld $25,%call16(y)($28)' >> conftest.s
+ echo ' .reloc 1f,R_MIPS_JALR,y' >> conftest.s
+ echo '1: jalr $25' >> conftest.s
+ echo ' .reloc 1f,R_MIPS_JALR,x' >> conftest.s
+ echo '1: jalr $25' >> conftest.s
+ echo ' .end x' >> conftest.s
+ if $gcc_cv_as -o conftest.o conftest.s >/dev/null 2>&AS_MESSAGE_LOG_FD \
+ && $gcc_cv_ld -shared -o conftest.so conftest.o >/dev/null 2>&AS_MESSAGE_LOG_FD; then
+ if $gcc_cv_objdump -d conftest.so | grep -q jalr \
+ && $gcc_cv_objdump -d conftest.so | grep -q "bal.*<x>"; then
+ gcc_cv_as_ld_jalr_reloc=yes
+ fi
+ fi
+ rm -f conftest.*
+ fi
+ fi
+ if test $gcc_cv_as_ld_jalr_reloc = yes; then
+ if test x$target_cpu_default = x; then
+ target_cpu_default=MASK_RELAX_PIC_CALLS
+ else
+ target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS"
+ fi
+ fi
+ AC_MSG_RESULT($gcc_cv_as_ld_jalr_reloc)
+
+ AC_CACHE_CHECK([linker for .eh_frame personality relaxation],
+ [gcc_cv_ld_mips_personality_relaxation],
+ [gcc_cv_ld_mips_personality_relaxation=no
+ if test $in_tree_ld = yes ; then
+ if test "$gcc_cv_gld_major_version" -eq 2 \
+ -a "$gcc_cv_gld_minor_version" -ge 21 \
+ -o "$gcc_cv_gld_major_version" -gt 2; then
+ gcc_cv_ld_mips_personality_relaxation=yes
+ fi
+ elif test x$gcc_cv_as != x \
+ -a x$gcc_cv_ld != x \
+ -a x$gcc_cv_readelf != x ; then
+ cat > conftest.s <<EOF
+ .cfi_startproc
+ .cfi_personality 0x80,indirect_ptr
+ .ent test
+test:
+ nop
+ .end test
+ .cfi_endproc
+
+ .section .data,"aw",@progbits
+indirect_ptr:
+ .dc.a personality
+EOF
+ if $gcc_cv_as -KPIC -o conftest.o conftest.s > /dev/null 2>&1 \
+ && $gcc_cv_ld -o conftest conftest.o -shared > /dev/null 2>&1; then
+ if $gcc_cv_readelf -d conftest 2>&1 \
+ | grep TEXTREL > /dev/null 2>&1; then
+ :
+ elif $gcc_cv_readelf --relocs conftest 2>&1 \
+ | grep 'R_MIPS_REL32 *$' > /dev/null 2>&1; then
+ :
+ else
+ gcc_cv_ld_mips_personality_relaxation=yes
+ fi
+ fi
+ fi
+ rm -f conftest.s conftest.o conftest])
+ if test x$gcc_cv_ld_mips_personality_relaxation = xyes; then
+ AC_DEFINE(HAVE_LD_PERSONALITY_RELAXATION, 1,
+ [Define if your linker can relax absolute .eh_frame personality
+pointers into PC-relative form.])
+ fi