From 8962c8c8d06803e310bac0ffc8e84ea15daeff3f Mon Sep 17 00:00:00 2001 From: Anthony Green Date: Tue, 8 Jan 2013 12:22:24 -0500 Subject: [PATCH] Fix read-only eh_frame test --- ChangeLog | 5 +++++ configure | 11 ++++++----- configure.ac | 11 ++++++----- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 464dbe87..88e3659e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-01-08 Anthony Green + + * configure.ac: Fix test for read-only eh_frame. + * configure: Rebuilt. + 2013-01-08 Anthony Green * src/x86/sysv.S, src/x86/unix64.S: Only emit DWARF unwind info diff --git a/configure b/configure index c4d1e8dc..142bb869 100755 --- a/configure +++ b/configure @@ -14635,11 +14635,12 @@ else libffi_cv_ro_eh_frame=no echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c - if $CC $CFLAGS -S -fpic -fexceptions -o conftest.s conftest.c > /dev/null 2>&1; then - if grep '.section.*eh_frame.*"a"' conftest.s > /dev/null; then - libffi_cv_ro_eh_frame=yes - elif grep '.section.*eh_frame.*#alloc' conftest.c \ - | grep -v '#write' > /dev/null; then + if $CC $CFLAGS -c -fpic -fexceptions -o conftest.o conftest.c > /dev/null 2>&1; then + objdump -h conftest.o > conftest.dump 2>&1 + libffi_eh_frame_line=`grep -n eh_frame conftest.dump | cut -d: -f 1` + libffi_test_line=`expr $libffi_eh_frame_line + 1`p + sed -n $libffi_test_line conftest.dump > conftest.line + if grep READONLY conftest.line > /dev/null; then libffi_cv_ro_eh_frame=yes fi fi diff --git a/configure.ac b/configure.ac index 78f54af7..b62dd6f8 100644 --- a/configure.ac +++ b/configure.ac @@ -402,11 +402,12 @@ if test "x$GCC" = "xyes"; then libffi_cv_ro_eh_frame, [ libffi_cv_ro_eh_frame=no echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c - if $CC $CFLAGS -S -fpic -fexceptions -o conftest.s conftest.c > /dev/null 2>&1; then - if grep '.section.*eh_frame.*"a"' conftest.s > /dev/null; then - libffi_cv_ro_eh_frame=yes - elif grep '.section.*eh_frame.*#alloc' conftest.c \ - | grep -v '#write' > /dev/null; then + if $CC $CFLAGS -c -fpic -fexceptions -o conftest.o conftest.c > /dev/null 2>&1; then + objdump -h conftest.o > conftest.dump 2>&1 + libffi_eh_frame_line=`grep -n eh_frame conftest.dump | cut -d: -f 1` + libffi_test_line=`expr $libffi_eh_frame_line + 1`p + sed -n $libffi_test_line conftest.dump > conftest.line + if grep READONLY conftest.line > /dev/null; then libffi_cv_ro_eh_frame=yes fi fi