diff options
Diffstat (limited to 'ld/configure.in')
-rw-r--r-- | ld/configure.in | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ld/configure.in b/ld/configure.in index 85fe903..15d7685 100644 --- a/ld/configure.in +++ b/ld/configure.in @@ -5,6 +5,7 @@ AC_INIT AC_CONFIG_SRCDIR(ldmain.c) AC_CANONICAL_TARGET +AC_CANONICAL_BUILD AC_ISC_POSIX changequote(,)dnl @@ -175,6 +176,30 @@ if test x$enable_plugins = xno ; then fi AM_CONDITIONAL([ENABLE_PLUGINS], [test x$enable_plugins = xyes]) +AC_ARG_ENABLE(initfini-array, + [ --enable-initfini-array use .init_array/.fini_array sections], + [], [ +AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support, + gcc_cv_initfini_array, [dnl + if test "x${build}" = "x${target}" ; then + AC_RUN_IFELSE([AC_LANG_SOURCE([ +static int x = -1; +int main (void) { return x; } +int foo (void) { x = 0; } +int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;])], + [gcc_cv_initfini_array=yes], [gcc_cv_initfini_array=no], + [gcc_cv_initfini_array=no]) + else + gcc_cv_initfini_array=no + fi]) + enable_initfini_array=$gcc_cv_initfini_array +]) +AC_SUBST(enable_initfini_array) +if test $enable_initfini_array = yes; then + AC_DEFINE(HAVE_INITFINI_ARRAY, 1, + [Define .init_array/.fini_array sections are available and working.]) +fi + AC_MSG_CHECKING(for a known getopt prototype in unistd.h) AC_CACHE_VAL(ld_cv_decl_getopt_unistd_h, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])], |