This is an automated email from the git hooks/post-receive script.
unknown user pushed a commit to branch hjl/indbr/master in repository gcc.
commit b08798eca06987ff90fb69c2949ce1950587bbed Author: H.J. Lu hjl.tools@gmail.com Date: Thu Jul 23 10:51:15 2015 -0700
Check if linker supports indirect branch relocation --- gcc/config.in | 6 ++++++ gcc/configure | 44 +++++++++++++++++++++++++++++++++++++------- gcc/configure.ac | 22 ++++++++++++++++++++++ 3 files changed, 65 insertions(+), 7 deletions(-)
diff --git a/gcc/config.in b/gcc/config.in index 67d03d1..9d9f3d2 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -1429,6 +1429,12 @@ #endif
+/* Define 0/1 if Define if your linker supports indirect branch relocation. */ +#ifndef USED_FOR_TARGET +#undef HAVE_LD_IX86_INDBR_RELOC +#endif + + /* Define if your PowerPC64 linker supports a large TOC. */ #ifndef USED_FOR_TARGET #undef HAVE_LD_LARGE_TOC diff --git a/gcc/configure b/gcc/configure index 525439d..3736435 100755 --- a/gcc/configure +++ b/gcc/configure @@ -21681,7 +21681,7 @@ else
if test -x "$DEFAULT_ASSEMBLER"; then gcc_cv_as="$DEFAULT_ASSEMBLER" -elif test -f $gcc_cv_as_gas_srcdir/configure.[ai][cn] \ +elif test -f $gcc_cv_as_gas_srcdir/configure.aicn \ && test -f ../gas/Makefile \ && test x$build = x$host; then gcc_cv_as=../gas/as-new$build_exeext @@ -21754,7 +21754,7 @@ $as_echo "newly built gas" >&6; } gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd for f in $gcc_cv_as_bfd_srcdir/configure \ $gcc_cv_as_gas_srcdir/configure \ - $gcc_cv_as_gas_srcdir/configure.[ai][cn] \ + $gcc_cv_as_gas_srcdir/configure.aicn \ $gcc_cv_as_gas_srcdir/Makefile.in ; do gcc_cv_gas_version=`sed -n -e 's/^[ ]*VERSION=[^0-9A-Za-z_]*([0-9]*.[0-9]*.*\ [...] if test x$gcc_cv_gas_version != x; then @@ -21844,7 +21844,7 @@ elif test $install_gold_as_default = yes \ && test -f ../gold/Makefile \ && test x$build = x$host; then gcc_cv_ld=../gold/ld-new$build_exeext -elif test -f $gcc_cv_ld_gld_srcdir/configure.[ai][cn] \ +elif test -f $gcc_cv_ld_gld_srcdir/configure.aicn \ && test -f ../ld/Makefile \ && test x$build = x$host; then gcc_cv_ld=../ld/ld-new$build_exeext @@ -21960,7 +21960,7 @@ $as_echo "newly built ld" >&6; } elif test "$ld_is_gold" = yes; then in_tree_ld_is_elf=yes fi - for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ [...] + for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ [...] do gcc_cv_gld_version=`sed -n -e 's/^[ ]*VERSION=[^0-9A-Za-z_]*([0-9]*.[0-9]*.*\ [...] if test x$gcc_cv_gld_version != x; then @@ -21993,7 +21993,7 @@ if test "${gcc_cv_nm+set}" = set; then :
else
-if test -f $gcc_cv_binutils_srcdir/configure.[ai][cn] \ +if test -f $gcc_cv_binutils_srcdir/configure.aicn \ && test -f ../binutils/Makefile \ && test x$build = x$host; then gcc_cv_nm=../binutils/nm-new$build_exeext @@ -22072,7 +22072,7 @@ if test "${gcc_cv_objdump+set}" = set; then :
else
-if test -f $gcc_cv_binutils_srcdir/configure.[ai][cn] \ +if test -f $gcc_cv_binutils_srcdir/configure.aicn \ && test -f ../binutils/Makefile \ && test x$build = x$host; then # Single tree build which includes binutils. @@ -22144,7 +22144,7 @@ if test "${gcc_cv_readelf+set}" = set; then :
else
-if test -f $gcc_cv_binutils_srcdir/configure.[ai][cn] \ +if test -f $gcc_cv_binutils_srcdir/configure.aicn \ && test -f ../binutils/Makefile \ && test x$build = x$host; then # Single tree build which includes binutils. @@ -25652,6 +25652,36 @@ cat >>confdefs.h <<_ACEOF _ACEOF
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker for indirect branch r [...] +$as_echo_n "checking linker for indirect branch relocation... " >&6; } +if test "${gcc_cv_ld_ix86_indirect_branch+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_ld_ix86_indirect_branch=no + if test $in_tree_ld = yes ; then + if grep R_386_INDBR_GOT32 $srcdir/../include/elf/i386.h > /dev/null 2>&1; then + gcc_cv_ld_ix86_indirect_branch=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_INDBR_GOT32 > /dev/null 2>&1; then + gcc_cv_ld_ix86_indirect_branch=yes + fi + fi + fi + rm -f conftest.s conftest.o +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_ix86_indirect_branch" >&5 +$as_echo "$gcc_cv_ld_ix86_indirect_branch" >&6; } + +cat >>confdefs.h <<_ACEOF +#define HAVE_LD_IX86_INDBR_RELOC `if test x"$gcc_cv_ld_ix86_indirect_branch" = xye [...] +_ACEOF + ;;
ia64*-*-*) diff --git a/gcc/configure.ac b/gcc/configure.ac index 1b6e616..24f1cd7 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -4068,6 +4068,28 @@ 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 indirect branch relocation], + [gcc_cv_ld_ix86_indirect_branch], + [gcc_cv_ld_ix86_indirect_branch=no + if test $in_tree_ld = yes ; then + if grep R_386_INDBR_GOT32 $srcdir/../include/elf/i386.h > /dev/null 2>&1; then + gcc_cv_ld_ix86_indirect_branch=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_INDBR_GOT32 > /dev/null 2>&1; then + gcc_cv_ld_ix86_indirect_branch=yes + fi + fi + fi + rm -f conftest.s conftest.o]) + AC_DEFINE_UNQUOTED(HAVE_LD_IX86_INDBR_RELOC, + [`if test x"$gcc_cv_ld_ix86_indirect_branch" = xyes; then echo 1; else echo [...] + [Define 0/1 if Define if your linker supports indirect branch relocation.]) ;;
ia64*-*-*)