diff -uraN binutils-2.19.orig/bfd/config.in binutils-2.19/bfd/config.in
--- binutils-2.19.orig/bfd/config.in	2008-08-15 04:31:46.000000000 -0400
+++ binutils-2.19/bfd/config.in	2009-01-20 19:21:18.000000000 -0500
@@ -231,6 +231,9 @@
    */
 #undef LT_OBJDIR
 
+/* Add Solaris support for -zexecstack */
+#undef NEED_EXECLASTLOAD
+
 /* Name of package */
 #undef PACKAGE
 
diff -uraN binutils-2.19.orig/bfd/configure binutils-2.19/bfd/configure
--- binutils-2.19.orig/bfd/configure	2008-10-16 09:20:42.000000000 -0400
+++ binutils-2.19/bfd/configure	2009-01-20 19:19:00.824980087 -0500
@@ -19515,6 +19515,17 @@
 
 
 
+# Add Solaris support for -zexecstack
+case "${target}" in
+  *-*solaris2* | *-*kopensolaris*-gnu*)
+
+cat >>confdefs.h <<\_ACEOF
+#define NEED_EXECLASTLOAD 1
+_ACEOF
+
+    ;;
+esac
+
 # target stuff:
 
 # Canonicalize the secondary target names.
diff -uraN binutils-2.19.orig/bfd/configure.in binutils-2.19/bfd/configure.in
--- binutils-2.19.orig/bfd/configure.in	2008-10-16 09:20:34.000000000 -0400
+++ binutils-2.19/bfd/configure.in	2009-01-20 19:18:55.266741096 -0500
@@ -508,6 +508,14 @@
 AC_SUBST(WIN32LDFLAGS)
 AC_SUBST(WIN32LIBADD)
 
+# Add Solaris support for -zexecstack
+case "${target}" in
+  *-*solaris2* | *-*kopensolaris*-gnu*)
+  AC_DEFINE(NEED_EXECLASTLOAD, 1,
+    [Add Solaris support for -zexecstack])
+    ;;
+esac
+
 # target stuff:
 
 # Canonicalize the secondary target names.
diff -uraN binutils-2.19.orig/bfd/elf.c binutils-2.19/bfd/elf.c
--- binutils-2.19.orig/bfd/elf.c	2008-10-09 08:18:23.000000000 -0400
+++ binutils-2.19/bfd/elf.c	2009-01-20 18:19:04.997225415 -0500
@@ -3822,6 +3822,11 @@
 	  if (m == NULL)
 	    goto error_return;
 
+#ifdef NEED_EXECLASTLOAD
+	  if (info->execstack)
+	    m->p_flags = PF_X;
+#endif
+
 	  *pm = m;
 	  pm = &m->next;
 	}

