diff options
| author | Karl Heuer | 1996-07-19 19:47:26 +0000 |
|---|---|---|
| committer | Karl Heuer | 1996-07-19 19:47:26 +0000 |
| commit | c17a2102aa6bb5895fe0236f7dcaa9e54aaec13b (patch) | |
| tree | a65185ca0ce00aa21f170f9a340695db362406e0 /src/unexec.c | |
| parent | 22549f8ba262dde71f6e50ae2d80254f90652ca9 (diff) | |
| download | emacs-c17a2102aa6bb5895fe0236f7dcaa9e54aaec13b.tar.gz emacs-c17a2102aa6bb5895fe0236f7dcaa9e54aaec13b.zip | |
(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.
Diffstat (limited to 'src/unexec.c')
| -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; | |||
| 178 | #ifdef MSDOS | 178 | #ifdef MSDOS |
| 179 | #if __DJGPP__ > 1 | 179 | #if __DJGPP__ > 1 |
| 180 | #include <fcntl.h> /* for O_RDONLY, O_RDWR */ | 180 | #include <fcntl.h> /* for O_RDONLY, O_RDWR */ |
| 181 | #include <crt0.h> /* for _crt0_startup_flags and its bits */ | ||
| 182 | static int save_djgpp_startup_flags; | ||
| 181 | #endif | 183 | #endif |
| 182 | #include <coff.h> | 184 | #include <coff.h> |
| 183 | #define filehdr external_filehdr | 185 | #define filehdr external_filehdr |
| @@ -884,6 +886,11 @@ copy_text_and_data (new, a_out) | |||
| 884 | /* Dump the original table of exception handlers, not the one | 886 | /* Dump the original table of exception handlers, not the one |
| 885 | where our exception hooks are registered. */ | 887 | where our exception hooks are registered. */ |
| 886 | __djgpp_exception_toggle (); | 888 | __djgpp_exception_toggle (); |
| 889 | |||
| 890 | /* Switch off startup flags that might have been set at runtime | ||
| 891 | and which might change the way that dumped Emacs works. */ | ||
| 892 | save_djgpp_startup_flags = _crt0_startup_flags; | ||
| 893 | _crt0_startup_flags &= ~(_CRT0_FLAG_NO_LFN | _CRT0_FLAG_NEARPTR); | ||
| 887 | #endif | 894 | #endif |
| 888 | #endif | 895 | #endif |
| 889 | 896 | ||
| @@ -905,6 +912,9 @@ copy_text_and_data (new, a_out) | |||
| 905 | #if __DJGPP__ >= 2 | 912 | #if __DJGPP__ >= 2 |
| 906 | /* Restore our exception hooks. */ | 913 | /* Restore our exception hooks. */ |
| 907 | __djgpp_exception_toggle (); | 914 | __djgpp_exception_toggle (); |
| 915 | |||
| 916 | /* Restore the startup flags. */ | ||
| 917 | _crt0_startup_flags = save_djgpp_startup_flags; | ||
| 908 | #endif | 918 | #endif |
| 909 | #endif | 919 | #endif |
| 910 | 920 | ||