libffi/configure.ac does not correctly determine writable eh_frame

Ian Lance Taylor iant@google.com
Mon Jan 10 21:47:00 GMT 2011


In the version of libffi distributed with gcc, I see this in
configure.ac:

	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
		libffi_cv_ro_eh_frame=yes
	    fi
	fi

This does not work with current gcc.  When that code is compiled, no
.eh_frame section is generated.  Therefore the configure script assumes
that a writable .eh_frame section is appropriate, even when it is not.

This was detected due to a bug in gold; see http://gcc.gnu.org/PR47248
for more details.  However, this issue in libffi should be fixed
independently of the gold bug fix.

Ian



More information about the Libffi-discuss mailing list