diff options
Diffstat (limited to 'src/unexec.c')
| -rw-r--r-- | src/unexec.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/unexec.c b/src/unexec.c index a1bb5460d3c..1a27db1232d 100644 --- a/src/unexec.c +++ b/src/unexec.c | |||
| @@ -131,11 +131,9 @@ initialize nonstandard fields in the file header | |||
| 131 | #ifdef HAVE_COFF_H | 131 | #ifdef HAVE_COFF_H |
| 132 | #include <coff.h> | 132 | #include <coff.h> |
| 133 | #ifdef MSDOS | 133 | #ifdef MSDOS |
| 134 | #if __DJGPP__ > 1 | ||
| 135 | #include <fcntl.h> /* for O_RDONLY, O_RDWR */ | 134 | #include <fcntl.h> /* for O_RDONLY, O_RDWR */ |
| 136 | #include <crt0.h> /* for _crt0_startup_flags and its bits */ | 135 | #include <crt0.h> /* for _crt0_startup_flags and its bits */ |
| 137 | static int save_djgpp_startup_flags; | 136 | static int save_djgpp_startup_flags; |
| 138 | #endif /* __DJGPP__ > 1 */ | ||
| 139 | #define filehdr external_filehdr | 137 | #define filehdr external_filehdr |
| 140 | #define scnhdr external_scnhdr | 138 | #define scnhdr external_scnhdr |
| 141 | #define syment external_syment | 139 | #define syment external_syment |
| @@ -310,7 +308,6 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name) | |||
| 310 | if (a_out >= 0) | 308 | if (a_out >= 0) |
| 311 | { | 309 | { |
| 312 | #ifdef MSDOS | 310 | #ifdef MSDOS |
| 313 | #if __DJGPP__ > 1 | ||
| 314 | /* Support the coff-go32-exe format with a prepended stub, since | 311 | /* Support the coff-go32-exe format with a prepended stub, since |
| 315 | this is what GCC 2.8.0 and later generates by default in DJGPP. */ | 312 | this is what GCC 2.8.0 and later generates by default in DJGPP. */ |
| 316 | unsigned short mz_header[3]; | 313 | unsigned short mz_header[3]; |
| @@ -328,7 +325,6 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name) | |||
| 328 | } | 325 | } |
| 329 | else | 326 | else |
| 330 | lseek (a_out, 0L, 0); | 327 | lseek (a_out, 0L, 0); |
| 331 | #endif /* __DJGPP__ > 1 */ | ||
| 332 | #endif /* MSDOS */ | 328 | #endif /* MSDOS */ |
| 333 | if (read (a_out, &f_hdr, sizeof (f_hdr)) != sizeof (f_hdr)) | 329 | if (read (a_out, &f_hdr, sizeof (f_hdr)) != sizeof (f_hdr)) |
| 334 | { | 330 | { |
| @@ -470,9 +466,6 @@ write_segment (new, ptr, end) | |||
| 470 | { | 466 | { |
| 471 | register int i, nwrite, ret; | 467 | register int i, nwrite, ret; |
| 472 | char buf[80]; | 468 | char buf[80]; |
| 473 | #ifndef USE_CRT_DLL | ||
| 474 | extern int errno; | ||
| 475 | #endif | ||
| 476 | /* This is the normal amount to write at once. | 469 | /* This is the normal amount to write at once. |
| 477 | It is the size of block that NFS uses. */ | 470 | It is the size of block that NFS uses. */ |
| 478 | int writesize = 1 << 13; | 471 | int writesize = 1 << 13; |
| @@ -532,7 +525,6 @@ copy_text_and_data (new, a_out) | |||
| 532 | register char *ptr; | 525 | register char *ptr; |
| 533 | 526 | ||
| 534 | #ifdef MSDOS | 527 | #ifdef MSDOS |
| 535 | #if __DJGPP__ >= 2 | ||
| 536 | /* Dump the original table of exception handlers, not the one | 528 | /* Dump the original table of exception handlers, not the one |
| 537 | where our exception hooks are registered. */ | 529 | where our exception hooks are registered. */ |
| 538 | __djgpp_exception_toggle (); | 530 | __djgpp_exception_toggle (); |
| @@ -542,7 +534,6 @@ copy_text_and_data (new, a_out) | |||
| 542 | save_djgpp_startup_flags = _crt0_startup_flags; | 534 | save_djgpp_startup_flags = _crt0_startup_flags; |
| 543 | _crt0_startup_flags &= ~(_CRT0_FLAG_NO_LFN | _CRT0_FLAG_NEARPTR); | 535 | _crt0_startup_flags &= ~(_CRT0_FLAG_NO_LFN | _CRT0_FLAG_NEARPTR); |
| 544 | #endif | 536 | #endif |
| 545 | #endif | ||
| 546 | 537 | ||
| 547 | lseek (new, (long) text_scnptr, 0); | 538 | lseek (new, (long) text_scnptr, 0); |
| 548 | ptr = (char *) f_ohdr.text_start; | 539 | ptr = (char *) f_ohdr.text_start; |
| @@ -555,14 +546,12 @@ copy_text_and_data (new, a_out) | |||
| 555 | write_segment (new, ptr, end); | 546 | write_segment (new, ptr, end); |
| 556 | 547 | ||
| 557 | #ifdef MSDOS | 548 | #ifdef MSDOS |
| 558 | #if __DJGPP__ >= 2 | ||
| 559 | /* Restore our exception hooks. */ | 549 | /* Restore our exception hooks. */ |
| 560 | __djgpp_exception_toggle (); | 550 | __djgpp_exception_toggle (); |
| 561 | 551 | ||
| 562 | /* Restore the startup flags. */ | 552 | /* Restore the startup flags. */ |
| 563 | _crt0_startup_flags = save_djgpp_startup_flags; | 553 | _crt0_startup_flags = save_djgpp_startup_flags; |
| 564 | #endif | 554 | #endif |
| 565 | #endif | ||
| 566 | 555 | ||
| 567 | 556 | ||
| 568 | return 0; | 557 | return 0; |