diff options
Diffstat (limited to 'src/unexcoff.c')
| -rw-r--r-- | src/unexcoff.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/unexcoff.c b/src/unexcoff.c index 966dd58cb6e..2e662a34145 100644 --- a/src/unexcoff.c +++ b/src/unexcoff.c | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | /* Copyright (C) 1985-1988, 1992-1994, 2001-2012 Free Software Foundation, Inc. | 1 | /* Copyright (C) 1985-1988, 1992-1994, 2001-2013 Free Software |
| 2 | * Foundation, Inc. | ||
| 2 | 3 | ||
| 3 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 4 | 5 | ||
| @@ -98,7 +99,7 @@ struct aouthdr | |||
| 98 | 99 | ||
| 99 | #include <sys/file.h> | 100 | #include <sys/file.h> |
| 100 | 101 | ||
| 101 | #include "mem-limits.h" | 102 | extern int etext; |
| 102 | 103 | ||
| 103 | static long block_copy_start; /* Old executable start point */ | 104 | static long block_copy_start; /* Old executable start point */ |
| 104 | static struct filehdr f_hdr; /* File header */ | 105 | static struct filehdr f_hdr; /* File header */ |
| @@ -167,7 +168,7 @@ make_hdr (int new, int a_out, | |||
| 167 | pagemask = getpagesize () - 1; | 168 | pagemask = getpagesize () - 1; |
| 168 | 169 | ||
| 169 | /* Adjust text/data boundary. */ | 170 | /* Adjust text/data boundary. */ |
| 170 | data_start = (int) start_of_data (); | 171 | data_start = (int) DATA_START; |
| 171 | data_start = ADDR_CORRECT (data_start); | 172 | data_start = ADDR_CORRECT (data_start); |
| 172 | data_start = data_start & ~pagemask; /* (Down) to page boundary. */ | 173 | data_start = data_start & ~pagemask; /* (Down) to page boundary. */ |
| 173 | 174 | ||
| @@ -332,11 +333,7 @@ write_segment (int new, const char *ptr, const char *end) | |||
| 332 | a gap between the old text segment and the old data segment. | 333 | a gap between the old text segment and the old data segment. |
| 333 | This gap has probably been remapped into part of the text segment. | 334 | This gap has probably been remapped into part of the text segment. |
| 334 | So write zeros for it. */ | 335 | So write zeros for it. */ |
| 335 | if (ret == -1 | 336 | if (ret == -1 && errno == EFAULT) |
| 336 | #ifdef EFAULT | ||
| 337 | && errno == EFAULT | ||
| 338 | #endif | ||
| 339 | ) | ||
| 340 | { | 337 | { |
| 341 | /* Write only a page of zeros at once, | 338 | /* Write only a page of zeros at once, |
| 342 | so that we don't overshoot the start | 339 | so that we don't overshoot the start |