Fix read-only eh_frame test
authorAnthony Green <green@moxielogic.com>
Tue, 8 Jan 2013 17:22:24 +0000 (12:22 -0500)
committerAnthony Green <green@moxielogic.com>
Tue, 8 Jan 2013 17:22:24 +0000 (12:22 -0500)
ChangeLog
configure
configure.ac

index 464dbe8..88e3659 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2013-01-08  Anthony Green  <green@moxielogic.com>
 
+       * configure.ac: Fix test for read-only eh_frame.
+       * configure: Rebuilt.
+
+2013-01-08  Anthony Green  <green@moxielogic.com>
+
        * src/x86/sysv.S, src/x86/unix64.S: Only emit DWARF unwind info
        when building with the GNU toolchain.
        * testsuite/libffi.call/ffitest.h (CHECK): Fix for Solaris vendor
index c4d1e8d..142bb86 100755 (executable)
--- 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
index 78f54af..b62dd6f 100644 (file)
@@ -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