diff options
author | Karl Heuer <kwzh@gnu.org> | 1996-07-19 19:47:26 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1996-07-19 19:47:26 +0000 |
commit | f9fce674363db89805fb56ac015b0b1b4f804cf0 (patch) | |
tree | cde654eb16acb3c2fbd17d097ac65637c245fbf3 | |
parent | 99b2797a6754dd91c1befbdd3f8ad0d7eb585221 (diff) | |
download | emacs-f9fce674363db89805fb56ac015b0b1b4f804cf0.tar.gz |
(copy_text_and_data) [DJGPP >= 2]: Switch off two bits
in `_crt0_startup_flags' so they don't go into the dumped Emacs.
Restore the value of `_crt0_startup_flags' after .text and .data
were dumped.
-rw-r--r-- | src/unexec.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/unexec.c b/src/unexec.c index 7e276015943..f7ff9ca6b02 100644 --- a/src/unexec.c +++ b/src/unexec.c @@ -178,6 +178,8 @@ int need_coff_header = 1; #ifdef MSDOS #if __DJGPP__ > 1 #include <fcntl.h> /* for O_RDONLY, O_RDWR */ +#include <crt0.h> /* for _crt0_startup_flags and its bits */ +static int save_djgpp_startup_flags; #endif #include <coff.h> #define filehdr external_filehdr @@ -884,6 +886,11 @@ copy_text_and_data (new, a_out) /* Dump the original table of exception handlers, not the one where our exception hooks are registered. */ __djgpp_exception_toggle (); + + /* Switch off startup flags that might have been set at runtime + and which might change the way that dumped Emacs works. */ + save_djgpp_startup_flags = _crt0_startup_flags; + _crt0_startup_flags &= ~(_CRT0_FLAG_NO_LFN | _CRT0_FLAG_NEARPTR); #endif #endif @@ -905,6 +912,9 @@ copy_text_and_data (new, a_out) #if __DJGPP__ >= 2 /* Restore our exception hooks. */ __djgpp_exception_toggle (); + + /* Restore the startup flags. */ + _crt0_startup_flags = save_djgpp_startup_flags; #endif #endif |