From 19f1a11e7ea2a5082bae9d9a079338c5658ba954 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 4 Aug 2017 12:17:15 -0700 Subject: Check linker support for INSERT in linker script Since gold doesn't support INSERT in linker script: https://sourceware.org/bugzilla/show_bug.cgi?id=21676 tst-split-dynreloc fails to link with gold. Check if linker supports INSERT in linker script before using it. * config.make.in (have-insert): New. * configure.ac (libc_cv_insert): New. Set to yes if linker supports INSERT in linker script. (AC_SUBST(libc_cv_insert): New. * configure: Regenerated. * sysdeps/x86_64/Makefile (tests): Add tst-split-dynreloc only if $(have-insert) == yes. --- ChangeLog | 10 ++++++++++ config.make.in | 1 + configure | 33 +++++++++++++++++++++++++++++++++ configure.ac | 21 +++++++++++++++++++++ sysdeps/x86_64/Makefile | 2 ++ 5 files changed, 67 insertions(+) diff --git a/ChangeLog b/ChangeLog index 33caac763c..cc540a148e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2017-08-04 H.J. Lu + + * config.make.in (have-insert): New. + * configure.ac (libc_cv_insert): New. Set to yes if linker + supports INSERT in linker script. + (AC_SUBST(libc_cv_insert): New. + * configure: Regenerated. + * sysdeps/x86_64/Makefile (tests): Add tst-split-dynreloc only + if $(have-insert) == yes. + 2017-08-04 H.J. Lu * elf/Makefile (tests): Add vismain only if diff --git a/config.make.in b/config.make.in index 5a4a054612..7eff1daf6a 100644 --- a/config.make.in +++ b/config.make.in @@ -54,6 +54,7 @@ enable-werror = @enable_werror@ have-z-combreloc = @libc_cv_z_combreloc@ have-z-execstack = @libc_cv_z_execstack@ have-protected-data = @libc_cv_protected_data@ +have-insert = @libc_cv_insert@ have-glob-dat-reloc = @libc_cv_has_glob_dat@ with-fp = @with_fp@ enable-timezone-tools = @enable_timezone_tools@ diff --git a/configure b/configure index d8e1c50e11..e6a54d7841 100755 --- a/configure +++ b/configure @@ -629,6 +629,7 @@ libc_cv_z_execstack libc_cv_z_combreloc ASFLAGS_config libc_cv_cc_with_libunwind +libc_cv_insert libc_cv_protected_data BISON INSTALL_INFO @@ -5716,6 +5717,38 @@ fi $as_echo "$libc_cv_protected_data" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker support for INSERT in linker script" >&5 +$as_echo_n "checking linker support for INSERT in linker script... " >&6; } +if ${libc_cv_insert+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.c < conftest.t <&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + libc_cv_insert=yes + fi + rm -f conftest.* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_insert" >&5 +$as_echo "$libc_cv_insert" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken __attribute__((alias()))" >&5 $as_echo_n "checking for broken __attribute__((alias()))... " >&6; } if ${libc_cv_broken_alias_attribute+:} false; then : diff --git a/configure.ac b/configure.ac index 77456aa8d9..2c6308883c 100644 --- a/configure.ac +++ b/configure.ac @@ -1298,6 +1298,27 @@ EOF ]) AC_SUBST(libc_cv_protected_data) +AC_CACHE_CHECK(linker support for INSERT in linker script, + libc_cv_insert, + [cat > conftest.c < conftest.t < conftest.c <