diff options
Diffstat (limited to 'gcc/configure.ac')
-rw-r--r-- | gcc/configure.ac | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gcc/configure.ac b/gcc/configure.ac index 7c8b3af..1dafd85 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3119,6 +3119,49 @@ if test x"$gcc_cv_ld_pie" = xyes; then fi AC_MSG_RESULT($gcc_cv_ld_pie) +AC_MSG_CHECKING(linker EH-compatible garbage collection of sections) +gcc_cv_ld_eh_gc_sections=no +if test $in_tree_ld = yes ; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 17 -o "$gcc_cv_gld_major_version" -gt 2 \ + && test $in_tree_ld_is_elf = yes; then + gcc_cv_ld_eh_gc_sections=yes + fi +elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x ; then + cat > conftest.s <<EOF + .section .text +.globl _start + .type _start, @function +_start: + .long foo + .size _start, .-_start + .section .text.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 + gcc_cv_ld_eh_gc_sections=no + elif $gcc_cv_objdump -h conftest | grep gcc_except_table > /dev/null; then + gcc_cv_ld_eh_gc_sections=yes + fi + fi + rm -f conftest.s conftest.o conftest +fi +if test x$gcc_cv_ld_eh_gc_sections = xyes; then + AC_DEFINE(HAVE_LD_EH_GC_SECTIONS, 1, + [Define if your linker supports garbage collection of + sections in presence of EH frames.]) +fi +AC_MSG_RESULT($gcc_cv_ld_eh_gc_sections) + # -------- # UNSORTED # -------- |