Define HAVE_LD_R_386_GOT32X to 1 if 32-bit x86 assembler generates R_386_GOT32X for "jmp *foo@GOT". Define HAVE_LD_R_X86_64_GOTPCRELX to 1 if 64-bit x86 assembler generates R_X86_64_GOTPCRELX for "jmp *foo@GOTPCREL(%rip)".
* configure.ac (HAVE_LD_R_386_GOT32X): New. Defined to 1 if 32-bit assembler generates R_386_GOT32X for "jmp *foo@GOT". Otherise, defined to 0. (HAVE_LD_R_X86_64_GOTPCRELX): New. Defined to 1 if 64-bit x86 assembler generates R_X86_64_GOTPCRELX for "jmp *foo@GOTPCREL(%rip)". * config.in: Regenerated. * configure: Likewise. --- gcc/config.in | 13 ++++++++++++ gcc/configure | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ gcc/configure.ac | 45 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+) diff --git a/gcc/config.in b/gcc/config.in index 77b3862..d32906d 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -1507,6 +1507,19 @@ #endif +/* Define 0/1 if Define if your linker supports R_386_GOT32X relocation. */ +#ifndef USED_FOR_TARGET +#undef HAVE_LD_R_386_GOT32X +#endif + + +/* Define 0/1 if Define if your linker supports R_X86_64_GOTPCRELX relocation. + */ +#ifndef USED_FOR_TARGET +#undef HAVE_LD_R_X86_64_GOTPCRELX +#endif + + /* Define if your linker supports the *_sol2 emulations. */ #ifndef USED_FOR_TARGET #undef HAVE_LD_SOL2_EMULATION diff --git a/gcc/configure b/gcc/configure index e388318..0ce7d65 100755 --- a/gcc/configure +++ b/gcc/configure @@ -25779,6 +25779,67 @@ cat >>confdefs.h <<_ACEOF _ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker for R_386_GOT32X relocation" >&5 +$as_echo_n "checking linker for R_386_GOT32X relocation... " >&6; } +if test "${gcc_cv_ld_r_386_got32x+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_ld_r_386_got32x=no + if test $in_tree_ld = yes ; then + if grep R_386_GOT32X $srcdir/../include/elf/i386.h > /dev/null 2>&1; then + gcc_cv_ld_r_386_got32x=yes + fi + elif test x$gcc_cv_as != x -a x$gcc_cv_readelf != x; then + cat > conftest.s <<EOF + jmp *foo@GOT +EOF + if $gcc_cv_as --32 -o conftest.o conftest.s > /dev/null 2>&1; then + if $gcc_cv_readelf --relocs --wide conftest.o 2>&1 \ + | grep R_386_GOT32X > /dev/null 2>&1; then + gcc_cv_ld_r_386_got32x=yes + fi + fi + fi + rm -f conftest.s conftest.o +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_r_386_got32x" >&5 +$as_echo "$gcc_cv_ld_r_386_got32x" >&6; } + +cat >>confdefs.h <<_ACEOF +#define HAVE_LD_R_386_GOT32X `if test x"$gcc_cv_ld_r_386_got32x" = xyes; then echo 1; else echo 0; fi` +_ACEOF + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker for R_X86_64_GOTPCRELX relocation" >&5 +$as_echo_n "checking linker for R_X86_64_GOTPCRELX relocation... " >&6; } +if test "${gcc_cv_ld_r_x86_64_gotpcrelx+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_ld_r_x86_64_gotpcrelx=no + if test $in_tree_ld = yes ; then + if grep R_X86_64_GOTPCRELX $srcdir/../include/elf/i386.h > /dev/null 2>&1; then + gcc_cv_ld_r_x86_64_gotpcrelx=yes + fi + elif test x$gcc_cv_as != x -a x$gcc_cv_readelf != x; then + cat > conftest.s <<EOF + jmp *foo@GOTPCREL(%rip) +EOF + if $gcc_cv_as --64 -o conftest.o conftest.s > /dev/null 2>&1; then + if $gcc_cv_readelf --relocs --wide conftest.o 2>&1 \ + | grep R_X86_64_GOTPCRELX > /dev/null 2>&1; then + gcc_cv_ld_r_x86_64_gotpcrelx=yes + fi + fi + fi + rm -f conftest.s conftest.o +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_r_x86_64_gotpcrelx" >&5 +$as_echo "$gcc_cv_ld_r_x86_64_gotpcrelx" >&6; } + +cat >>confdefs.h <<_ACEOF +#define HAVE_LD_R_X86_64_GOTPCRELX `if test x"$gcc_cv_ld_r_x86_64_gotpcrelx" = xyes; then echo 1; else echo 0; fi` +_ACEOF + ;; ia64*-*-*) diff --git a/gcc/configure.ac b/gcc/configure.ac index 7d5cc9a..afada92 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -4137,6 +4137,51 @@ value:' [`if test $gcc_cv_as_ix86_tlsldm = yes; then echo 1; else echo 0; fi`], [Define to 1 if your assembler and linker support @tlsldm.]) + AC_CACHE_CHECK([linker for R_386_GOT32X relocation], + [gcc_cv_ld_r_386_got32x], + [gcc_cv_ld_r_386_got32x=no + if test $in_tree_ld = yes ; then + if grep R_386_GOT32X $srcdir/../include/elf/i386.h > /dev/null 2>&1; then + gcc_cv_ld_r_386_got32x=yes + fi + elif test x$gcc_cv_as != x -a x$gcc_cv_readelf != x; then + cat > conftest.s <<EOF + jmp *foo@GOT +EOF + if $gcc_cv_as --32 -o conftest.o conftest.s > /dev/null 2>&1; then + if $gcc_cv_readelf --relocs --wide conftest.o 2>&1 \ + | grep R_386_GOT32X > /dev/null 2>&1; then + gcc_cv_ld_r_386_got32x=yes + fi + fi + fi + rm -f conftest.s conftest.o]) + AC_DEFINE_UNQUOTED(HAVE_LD_R_386_GOT32X, + [`if test x"$gcc_cv_ld_r_386_got32x" = xyes; then echo 1; else echo 0; fi`], + [Define 0/1 if Define if your linker supports R_386_GOT32X relocation.]) + + AC_CACHE_CHECK([linker for R_X86_64_GOTPCRELX relocation], + [gcc_cv_ld_r_x86_64_gotpcrelx], + [gcc_cv_ld_r_x86_64_gotpcrelx=no + if test $in_tree_ld = yes ; then + if grep R_X86_64_GOTPCRELX $srcdir/../include/elf/i386.h > /dev/null 2>&1; then + gcc_cv_ld_r_x86_64_gotpcrelx=yes + fi + elif test x$gcc_cv_as != x -a x$gcc_cv_readelf != x; then + cat > conftest.s <<EOF + jmp *foo@GOTPCREL(%rip) +EOF + if $gcc_cv_as --64 -o conftest.o conftest.s > /dev/null 2>&1; then + if $gcc_cv_readelf --relocs --wide conftest.o 2>&1 \ + | grep R_X86_64_GOTPCRELX > /dev/null 2>&1; then + gcc_cv_ld_r_x86_64_gotpcrelx=yes + fi + fi + fi + rm -f conftest.s conftest.o]) + AC_DEFINE_UNQUOTED(HAVE_LD_R_X86_64_GOTPCRELX, + [`if test x"$gcc_cv_ld_r_x86_64_gotpcrelx" = xyes; then echo 1; else echo 0; fi`], + [Define 0/1 if Define if your linker supports R_X86_64_GOTPCRELX relocation.]) ;; ia64*-*-*) -- 2.4.3