patches/libffi-02-SHT_AMD64_UNWIND.diff
author rohinis
Tue, 29 Nov 2011 17:32:55 +0000
branchs11express-2010-11
changeset 22234 c23e64da3e06
parent 17946 317acdff9b94
permissions -rw-r--r--
2011-11-29 Rohini S <[email protected]> * patches/Python26-22-audio.diff: Fixes CVE-2010-1634 * specs/SUNWPython26.spec: Fixes CR 7085446

--- libffi/configure.ac       Mon Mar 15 19:47:38 2010 +0100
+++ libffi/configure.ac       Mon Mar 15 19:47:38 2010 +0100
@@ -284,6 +284,21 @@
      ;;
 esac
 
+if test x$TARGET = xX86_64; then
+    AC_CACHE_CHECK([assembler supports unwind section type],
+       libffi_cv_as_x86_64_unwind_section_type, [
+       libffi_cv_as_x86_64_unwind_section_type=yes
+       echo '.section .eh_frame,"a",@unwind' > conftest.s
+       if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
+           libffi_cv_as_x86_64_unwind_section_type=no
+       fi
+       ])
+    if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then
+       AC_DEFINE(HAVE_AS_X86_64_UNWIND_SECTION_TYPE, 1,
+                 [Define if your assembler supports unwind section type.])
+    fi
+fi
+
 AC_CACHE_CHECK([whether .eh_frame section should be read-only],
     libffi_cv_ro_eh_frame, [
 	libffi_cv_ro_eh_frame=no
--- libffi/src/x86/unix64.S   Mon Mar 15 19:47:38 2010 +0100
+++ libffi/src/x86/unix64.S   Mon Mar 15 19:47:38 2010 +0100
@@ -324,7 +324,11 @@
 .LUW9:
 	.size	ffi_closure_unix64,.-ffi_closure_unix64
 
+#ifdef HAVE_AS_X86_64_UNWIND_SECTION_TYPE
+	.section	.eh_frame,"a",@unwind
+#else
 	.section	.eh_frame,"a",@progbits
+#endif
 .Lframe1:
 	.long	.LECIE1-.LSCIE1		/* CIE Length */
 .LSCIE1: