aboutsummaryrefslogtreecommitdiff
path: root/gcc/configure.ac
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-02-28 16:36:37 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-02-28 16:36:37 +0100
commit1b500976241ac4b41d59489cab9fe3a9eccbc734 (patch)
treebcf30f81c91016458a27aa522a244c86f6230419 /gcc/configure.ac
parent68ade9e4e84617fd5c613618cfdc0cc1fa6d6d81 (diff)
downloadgcc-1b500976241ac4b41d59489cab9fe3a9eccbc734.zip
gcc-1b500976241ac4b41d59489cab9fe3a9eccbc734.tar.gz
gcc-1b500976241ac4b41d59489cab9fe3a9eccbc734.tar.bz2
re PR middle-end/46790 (EH failures in libstdc++ testsuite with --gc-sections and GNU ld 2.18)
PR middle-end/46790 * configure.ac (HAVE_LD_EH_GC_SECTIONS_BUG): New test. * configure: Regenerated. * config.in: Regenerated. * varasm.c (default_function_section): Return NULL if HAVE_LD_EH_GC_SECTIONS_BUG and decl has implicit section name. From-SVN: r170565
Diffstat (limited to 'gcc/configure.ac')
-rw-r--r--gcc/configure.ac45
1 files changed, 45 insertions, 0 deletions
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 0c065e0..03a8cef 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -4097,6 +4097,51 @@ if test x$gcc_cv_ld_eh_gc_sections = xyes; then
fi
AC_MSG_RESULT($gcc_cv_ld_eh_gc_sections)
+AC_MSG_CHECKING(linker EH garbage collection of sections bug)
+gcc_cv_ld_eh_gc_sections_bug=no
+if test $in_tree_ld = yes ; then
+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -lt 19 -o "$gcc_cv_gld_major_version" -lt 2 \
+ && test $in_tree_ld_is_elf = yes; then
+ gcc_cv_ld_eh_gc_sections_bug=yes
+ fi
+elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x -a x$gcc_cv_as_comdat_group = xyes; then
+ gcc_cv_ld_eh_gc_sections_bug=yes
+ cat > conftest.s <<EOF
+ .section .text
+.globl _start
+ .type _start, @function
+_start:
+ .long foo
+ .size _start, .-_start
+ .section .text.startup.foo,"ax",@progbits
+ .type foo, @function
+foo:
+ .long 0
+ .size foo, .-foo
+ .section .gcc_except_table.foo,"a",@progbits
+.L0:
+ .long 0
+ .section .eh_frame,"a",@progbits
+ .long .L0
+EOF
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+ if $gcc_cv_ld -o conftest conftest.o --entry=_start --gc-sections 2>&1 \
+ | grep "gc-sections option ignored" > /dev/null; then
+ :
+ elif $gcc_cv_objdump -h conftest 2> /dev/null \
+ | grep gcc_except_table > /dev/null; then
+ gcc_cv_ld_eh_gc_sections_bug=no
+ fi
+ fi
+ rm -f conftest.s conftest.o conftest
+fi
+if test x$gcc_cv_ld_eh_gc_sections_bug = xyes; then
+ AC_DEFINE(HAVE_LD_EH_GC_SECTIONS_BUG, 1,
+ [Define if your linker has buggy garbage collection of
+ sections support when .text.startup.foo like sections are used.])
+fi
+AC_MSG_RESULT($gcc_cv_ld_eh_gc_sections_bug)
+
# --------
# UNSORTED
# --------