aboutsummaryrefslogtreecommitdiffstats
path: root/src/unexcw.c
diff options
context:
space:
mode:
authorStefan Monnier2012-03-25 16:37:21 -0400
committerStefan Monnier2012-03-25 16:37:21 -0400
commit699c782b7668c44d0fa4446331b0590a6d5dac82 (patch)
tree5dcce364741d0761920a3d274b0fc8aba4103d45 /src/unexcw.c
parent98fb480ee31bf74cf554044f60f21df16566dd7f (diff)
parente99a9b8bdccadded1f6fae88ee7a2a93dfd4eacf (diff)
downloademacs-pending.tar.gz
emacs-pending.zip
Merge from trunkpending
Diffstat (limited to 'src/unexcw.c')
-rw-r--r--src/unexcw.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/unexcw.c b/src/unexcw.c
index f643c196de0..eae534cf4dd 100644
--- a/src/unexcw.c
+++ b/src/unexcw.c
@@ -1,7 +1,7 @@
1/* unexec() support for Cygwin; 1/* unexec() support for Cygwin;
2 complete rewrite of xemacs Cygwin unexec() code 2 complete rewrite of xemacs Cygwin unexec() code
3 3
4 Copyright (C) 2004-2011 Free Software Foundation, Inc. 4 Copyright (C) 2004-2012 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
@@ -33,6 +33,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
33 33
34extern int bss_sbrk_did_unexec; 34extern int bss_sbrk_did_unexec;
35 35
36extern int __malloc_initialized;
37
36/* emacs symbols that indicate where bss and data end for emacs internals */ 38/* emacs symbols that indicate where bss and data end for emacs internals */
37extern char my_endbss[]; 39extern char my_endbss[];
38extern char my_edata[]; 40extern char my_edata[];
@@ -210,9 +212,12 @@ fixup_executable (int fd)
210 lseek (fd, (long) (exe_header->section_header[i].s_scnptr), 212 lseek (fd, (long) (exe_header->section_header[i].s_scnptr),
211 SEEK_SET); 213 SEEK_SET);
212 assert (ret != -1); 214 assert (ret != -1);
215 /* force the dumped emacs to reinitialize malloc */
216 __malloc_initialized = 0;
213 ret = 217 ret =
214 write (fd, (char *) start_address, 218 write (fd, (char *) start_address,
215 my_endbss - (char *) start_address); 219 my_endbss - (char *) start_address);
220 __malloc_initialized = 1;
216 assert (ret == (my_endbss - (char *) start_address)); 221 assert (ret == (my_endbss - (char *) start_address));
217 if (debug_unexcw) 222 if (debug_unexcw)
218 printf (" .bss, mem start 0x%08x mem length %d\n", 223 printf (" .bss, mem start 0x%08x mem length %d\n",