diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2010-12-15 14:56:40 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2010-12-15 14:56:40 +0000 |
commit | 02ecc8e968f7524f4c41cd7942adff4ff31afe5c (patch) | |
tree | d380df5339289f8d485d5cf384ff3285f3516647 /ld/configure | |
parent | bef6be3d9f7368a79569cdefefde45724aa64fa5 (diff) | |
download | gdb-02ecc8e968f7524f4c41cd7942adff4ff31afe5c.zip gdb-02ecc8e968f7524f4c41cd7942adff4ff31afe5c.tar.gz gdb-02ecc8e968f7524f4c41cd7942adff4ff31afe5c.tar.bz2 |
Add SORT_BY_INIT_PRIORITY.
bfd/
2010-12-15 H.J. Lu <hongjiu.lu@intel.com>
* elf.c (_bfd_elf_new_section_hook): Special handling for
.init_array/.fini_array output sections.
ld/
2010-12-15 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.am (GENSCRIPTS): Add @enable_initfini_array@.
* NEWS: Mention SORT_BY_INIT_PRIORITY.
* configure.in: Add AC_CANONICAL_BUILD.
Add --enable-initfini-array.
* genscripts.sh (ENABLE_INITFINI_ARRAY): New.
* ld.h (sort_type): Add by_init_priority.
* ld.texinfo: Document SORT_BY_INIT_PRIORITY.
* ldgram.y (SORT_BY_INIT_PRIORITY): New.
(wildcard_spec): Handle SORT_BY_INIT_PRIORITY.
* ldlang.c (get_init_priority): New.
(compare_section): Use get_init_priority for by_init_priority.
* ldlex.l (SORT_BY_INIT_PRIORITY): New.
* scripttempl/elf.sc: Support ENABLE_INITFINI_ARRAY.
* Makefile.in: Regenerated.
* aclocal.m4: Regenerated.
* config.in: Likewise.
* configure: Likewise.
ld/testsuite/
2010-12-15 H.J. Lu <hongjiu.lu@intel.com>
* ld-elf/elf.exp (array_tests): Add init-mixed.
(array_tests_static): Likewise.
Also delete tmpdir/init-mixed.
* ld-elf/init-mixed.c: New.
* ld-elf/init-mixed.out: Likewise.
Diffstat (limited to 'ld/configure')
-rwxr-xr-x | ld/configure | 56 |
1 files changed, 54 insertions, 2 deletions
diff --git a/ld/configure b/ld/configure index 088c721..a6802dd 100755 --- a/ld/configure +++ b/ld/configure @@ -609,6 +609,7 @@ EMUL_EXTRA_OFILES EMULATION_OFILES EMUL STRINGIFY +enable_initfini_array ENABLE_PLUGINS_FALSE ENABLE_PLUGINS_TRUE NATIVE_LIB_DIRS @@ -778,6 +779,7 @@ enable_fast_install with_gnu_ld enable_libtool_lock enable_nls +enable_initfini_array ' ac_precious_vars='build_alias host_alias @@ -1427,6 +1429,7 @@ Optional Features: optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-nls do not use Native Language Support + --enable-initfini-array use .init_array/.fini_array sections Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -2591,6 +2594,7 @@ test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -11622,7 +11626,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11625 "configure" +#line 11629 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11728,7 +11732,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11731 "configure" +#line 11735 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12944,6 +12948,54 @@ else fi +# Check whether --enable-initfini-array was given. +if test "${enable_initfini_array+set}" = set; then : + enableval=$enable_initfini_array; +else + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for .preinit_array/.init_array/.fini_array support" >&5 +$as_echo_n "checking for .preinit_array/.init_array/.fini_array support... " >&6; } +if test "${gcc_cv_initfini_array+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x${build}" = "x${target}" ; then + if test "$cross_compiling" = yes; then : + gcc_cv_initfini_array=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +static int x = -1; +int main (void) { return x; } +int foo (void) { x = 0; } +int (*fp) (void) __attribute__ ((section (".init_array"))) = foo; +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gcc_cv_initfini_array=yes +else + gcc_cv_initfini_array=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + else + gcc_cv_initfini_array=no + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_initfini_array" >&5 +$as_echo "$gcc_cv_initfini_array" >&6; } + enable_initfini_array=$gcc_cv_initfini_array + +fi + + +if test $enable_initfini_array = yes; then + +$as_echo "#define HAVE_INITFINI_ARRAY 1" >>confdefs.h + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a known getopt prototype in unistd.h" >&5 $as_echo_n "checking for a known getopt prototype in unistd.h... " >&6; } if test "${ld_cv_decl_getopt_unistd_h+set}" = set; then : |