@@ -2405,7 +2405,7 @@ gcc_GAS_CHECK_FEATURE([cfi directives], gcc_cv_as_cfi_directive,
gcc_cv_as_cfi_directive=yes
;;
esac])
-if test $gcc_cv_as_cfi_directive = yes && test x$gcc_cv_readelf != x; then
+if test $gcc_cv_as_cfi_directive = yes && test x$gcc_cv_objdump != x; then
gcc_GAS_CHECK_FEATURE([working cfi advance], gcc_cv_as_cfi_advance_working,
,,
[ .text
@@ -2415,13 +2415,13 @@ gcc_GAS_CHECK_FEATURE([working cfi advance], gcc_cv_as_cfi_advance_working,
.cfi_adjust_cfa_offset 128
.cfi_endproc],
[[
-if $gcc_cv_readelf -wf conftest.o 2>/dev/null \
+if $gcc_cv_objdump -Wf conftest.o 2>/dev/null \
| grep 'DW_CFA_advance_loc[24]:[ ][ ]*75040[ ]' >/dev/null; then
gcc_cv_as_cfi_advance_working=yes
fi
]])
else
- # no readelf, err on the side of caution
+ # no objdump, err on the side of caution
gcc_cv_as_cfi_advance_working=no
fi
AC_DEFINE_UNQUOTED(HAVE_GAS_CFI_DIRECTIVE,
@@ -2445,7 +2445,23 @@ gcc_GAS_CHECK_FEATURE([cfi sections directive],
[ .text
.cfi_sections .debug_frame, .eh_frame
.cfi_startproc
- .cfi_endproc])
+ .cfi_endproc],
+[case $target_os in
+ win32 | pe | cygwin* | mingw32* | uwin*)
+ # Need to check that we generated the correct relocation for the
+ # .debug_frame section. This was fixed for binutils 2.21.
+ gcc_cv_as_cfi_sections_directive=no
+ if test "x$gcc_cv_objdump" != x; then
+ if $gcc_cv_objdump -j .debug_frame -r conftest.o 2>/dev/null | \
+ grep secrel > /dev/null; then
+ gcc_cv_as_cfi_sections_directive=yes
+ fi
+ fi
+ ;;
+ *)
+ gcc_cv_as_cfi_sections_directive=yes
+ ;;
+esac])
AC_DEFINE_UNQUOTED(HAVE_GAS_CFI_SECTIONS_DIRECTIVE,
[`if test $gcc_cv_as_cfi_sections_directive = yes;
then echo 1; else echo 0; fi`],