From 8eb2807f9b59b14eb646d536f3250eaaccf7ba18 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 10 Apr 1996 04:15:13 +0000 Subject: [PATCH] [DJGPP v2]: Include fcntl.h. (copy_text_and_data) [DJGPP v2]: Call __djgpp_exception_toggle. --- src/unexec.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/unexec.c b/src/unexec.c index 65d36ba8688..7e276015943 100644 --- a/src/unexec.c +++ b/src/unexec.c @@ -176,6 +176,9 @@ int need_coff_header = 1; #include /* The location might be a poor assumption */ #else #ifdef MSDOS +#if __DJGPP__ > 1 +#include /* for O_RDONLY, O_RDWR */ +#endif #include #define filehdr external_filehdr #define scnhdr external_scnhdr @@ -876,6 +879,14 @@ copy_text_and_data (new, a_out) #else /* COFF, but not USG_SHARED_LIBRARIES */ +#ifdef MSDOS +#if __DJGPP__ >= 2 + /* Dump the original table of exception handlers, not the one + where our exception hooks are registered. */ + __djgpp_exception_toggle (); +#endif +#endif + lseek (new, (long) text_scnptr, 0); ptr = (char *) f_ohdr.text_start; #ifdef HEADER_INCL_IN_TEXT @@ -890,6 +901,13 @@ copy_text_and_data (new, a_out) end = ptr + f_ohdr.dsize; write_segment (new, ptr, end); +#ifdef MSDOS +#if __DJGPP__ >= 2 + /* Restore our exception hooks. */ + __djgpp_exception_toggle (); +#endif +#endif + #endif /* USG_SHARED_LIBRARIES */ #else /* if not COFF */ -- 2.39.2