about summary refs log tree commit diff
path: root/configure
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-08-04 12:17:15 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-08-04 12:17:30 -0700
commit19f1a11e7ea2a5082bae9d9a079338c5658ba954 (patch)
tree242caa3dcb915548b8541f4552e849e06c1ffb19 /configure
parent3093fd5e5d418b91411aa9b061850b8773433cf7 (diff)
downloadglibc-19f1a11e7ea2a5082bae9d9a079338c5658ba954.tar.gz
glibc-19f1a11e7ea2a5082bae9d9a079338c5658ba954.tar.xz
glibc-19f1a11e7ea2a5082bae9d9a079338c5658ba954.zip
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.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure33
1 files changed, 33 insertions, 0 deletions
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 <<EOF
+		const int __attribute__ ((section(".bar"))) bar = 0x12345678;
+		int test (void) { return bar; }
+EOF
+		cat > conftest.t <<EOF
+		SECTIONS
+		{
+		  .bar : { *(.bar) }
+		}
+		INSERT AFTER .rela.dyn;
+EOF
+		libc_cv_insert=no
+		if { ac_try='${CC-cc} -nostdlib -nostartfiles $no_ssp -fPIC -shared conftest.c -Wl,-T,conftest.t -o conftest.so'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&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 :