This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Check for gnu_indirect_function support in the toolchain building gold
- From: simonb at google dot com (Simon Baldwin)
- To: binutils at sourceware dot org
- Cc: iant at google dot com
- Date: Tue, 1 Mar 2011 19:06:23 +0100 (CET)
- Subject: [PATCH] Check for gnu_indirect_function support in the toolchain building gold
Check for gnu_indirect_function support in the toolchain building gold.
Selected gold tests require gnu_indirect_function support. Gold currently
checks for glibc 2.11 or later, and assumes if present that this feature
is available. However, the "as" associated with the compiler being used
to build gold must also support gnu_indirect_function in order for the
gold tests to build successfully.
This patch enhances the current check for gnu_indirect_function to include
the toolchain building gold.
ChangeLog gold/
2011-03-01 Simon Baldwin <simonb@google.com>
* configure.ac: Add check for gnu_indirect_function support in
the toolchain building binutils.
* configure: Rebuild.
Index: gold/configure
===================================================================
RCS file: /cvs/src/src/gold/configure,v
retrieving revision 1.63
diff -u -r1.63 configure
--- gold/configure 23 Nov 2010 13:39:56 -0000 1.63
+++ gold/configure 1 Mar 2011 17:53:12 -0000
@@ -6384,6 +6384,7 @@
#elif __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 11)
error
#endif
+__asm__(".type foo, %gnu_indirect_function");
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
Index: gold/configure.ac
===================================================================
RCS file: /cvs/src/src/gold/configure.ac,v
retrieving revision 1.60
diff -u -r1.60 configure.ac
--- gold/configure.ac 23 Nov 2010 13:39:56 -0000 1.60
+++ gold/configure.ac 1 Mar 2011 17:53:12 -0000
@@ -369,7 +369,7 @@
AC_SUBST(RANDOM_SEED_CFLAGS)
dnl On GNU/Linux ifunc is supported by the dynamic linker in glibc
-dnl 2.11 or later.
+dnl 2.11 or later, and by binutils 2.20.1 or later.
AC_CACHE_CHECK([for glibc >= 2.11], [gold_cv_lib_glibc2_11],
[AC_COMPILE_IFELSE([
#include <features.h>
@@ -378,6 +378,7 @@
#elif __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 11)
error
#endif
+__asm__(".type foo, %gnu_indirect_function");
], [gold_cv_lib_glibc2_11=yes], [gold_cv_lib_glibc2_11=no])])
AM_CONDITIONAL(IFUNC, test "$gold_cv_lib_glibc2_11" = "yes")