# HG changeset patch # User youngs # Date 1042207961 0 # Node ID c1e69bcf8d078b3a781dd70f63f4a01e47bde74b # Parent 4ba5a507627c26b0e52deb7f4f3061b46487ebdb [xemacs-hg @ 2003-01-10 14:12:40 by youngs] 2003-01-08 Andy Piper * unexcw.c (copy_executable_and_dump_data_section): Set the stack reserve size during unexec(). diff -r 4ba5a507627c -r c1e69bcf8d07 src/ChangeLog --- 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 + + * unexcw.c (copy_executable_and_dump_data_section): Set the stack + reserve size during unexec(). + 2002-12-17 Daiki Ueno * process-unix.c (unix_create_process): Set pipe write descriptor diff -r 4ba5a507627c -r c1e69bcf8d07 src/unexcw.c --- 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 #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 */