changeset 1198:c1e69bcf8d07

[xemacs-hg @ 2003-01-10 14:12:40 by youngs] 2003-01-08 Andy Piper <andy@xemacs.org> * unexcw.c (copy_executable_and_dump_data_section): Set the stack reserve size during unexec().
author youngs
date Fri, 10 Jan 2003 14:12:41 +0000
parents 4ba5a507627c
children 6ee712ef2c1f
files src/ChangeLog src/unexcw.c
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Jan 09 22:53:02 2003 +0000
+++ b/src/ChangeLog	Fri Jan 10 14:12:41 2003 +0000
@@ -1,3 +1,8 @@
+2003-01-08  Andy Piper  <andy@xemacs.org>
+
+	* unexcw.c (copy_executable_and_dump_data_section): Set the stack
+	reserve size during unexec().
+
 2002-12-17  Daiki Ueno  <daiki@xemacs.org>
 
 	* process-unix.c (unix_create_process): Set pipe write descriptor
--- a/src/unexcw.c	Thu Jan 09 22:53:02 2003 +0000
+++ b/src/unexcw.c	Fri Jan 10 14:12:41 2003 +0000
@@ -47,6 +47,7 @@
 #include <a.out.h>
 #endif
 
+#define STACK_SIZE 0x800000
 #define ALLOC_UNIT 0xFFFF
 #define ALLOC_MASK ~((unsigned long) (ALLOC_UNIT))
 #define ALIGN_ALLOC(addr) \
@@ -302,6 +303,9 @@
     printf ("warning: new data size is < approx\n");
   f_ohdr.dsize=new_data_size;
   f_ohdr.bsize=BSS_PAD_SIZE;
+  /* Prevent stack overflow with regexp usage. */
+  f_ohdr.SizeOfStackReserve = STACK_SIZE;
+
   if (write (a_new, &f_ohdr, sizeof (f_ohdr)) != sizeof (f_ohdr))
     PERROR ("failed to write optional header");
   /* write text as is */