diff options
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/unexcoff.c | 41 |
2 files changed, 8 insertions, 41 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 527a5f1d865..024cf18efb6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,13 @@ | |||
| 1 | 2010-08-13 Eli Zaretskii <eliz@gnu.org> | 1 | 2010-08-13 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * unexcoff.c: Remove the parts used when "emacs" is not defined. | ||
| 4 | (report_error, report_error_1): Ditto. | ||
| 5 | (write_segment): Remove "#if 0" unused code. | ||
| 6 | (make_hdr): Remove code that was "#ifndef NO_REMAP" before | ||
| 7 | NO_REMAP was removed (in 2010-07-29T03:25:08Z!dann@ics.uci.edu). | ||
| 8 | (start_of_text): Remove unused function (was used only if NO_REMAP | ||
| 9 | was NOT defined). | ||
| 10 | |||
| 3 | * msdos.c (IT_set_face): Fix format string to match argument | 11 | * msdos.c (IT_set_face): Fix format string to match argument |
| 4 | types. | 12 | types. |
| 5 | (IT_write_glyphs, IT_note_mode_line_highlight) | 13 | (IT_write_glyphs, IT_note_mode_line_highlight) |
diff --git a/src/unexcoff.c b/src/unexcoff.c index ed319ec8e7f..3e9786348c3 100644 --- a/src/unexcoff.c +++ b/src/unexcoff.c | |||
| @@ -74,12 +74,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 74 | * of Dell Computer Corporation. james@bigtex.cactus.org. | 74 | * of Dell Computer Corporation. james@bigtex.cactus.org. |
| 75 | */ | 75 | */ |
| 76 | 76 | ||
| 77 | #ifndef emacs | ||
| 78 | #define PERROR(arg) perror (arg); return -1 | ||
| 79 | #else | ||
| 80 | #include <config.h> | 77 | #include <config.h> |
| 81 | #define PERROR(file) report_error (file, new) | 78 | #define PERROR(file) report_error (file, new) |
| 82 | #endif | ||
| 83 | 79 | ||
| 84 | #ifndef CANNOT_DUMP /* all rest of file! */ | 80 | #ifndef CANNOT_DUMP /* all rest of file! */ |
| 85 | 81 | ||
| @@ -132,7 +128,6 @@ struct aouthdr | |||
| 132 | #endif | 128 | #endif |
| 133 | 129 | ||
| 134 | 130 | ||
| 135 | extern char *start_of_text (); /* Start of text */ | ||
| 136 | extern char *start_of_data (); /* Start of initialized data */ | 131 | extern char *start_of_data (); /* Start of initialized data */ |
| 137 | 132 | ||
| 138 | static long block_copy_start; /* Old executable start point */ | 133 | static long block_copy_start; /* Old executable start point */ |
| @@ -155,8 +150,6 @@ static int pagemask; | |||
| 155 | 150 | ||
| 156 | #define ADDR_CORRECT(x) ((char *)(x) - (char*)0) | 151 | #define ADDR_CORRECT(x) ((char *)(x) - (char*)0) |
| 157 | 152 | ||
| 158 | #ifdef emacs | ||
| 159 | |||
| 160 | #include <setjmp.h> | 153 | #include <setjmp.h> |
| 161 | #include "lisp.h" | 154 | #include "lisp.h" |
| 162 | 155 | ||
| @@ -169,7 +162,6 @@ report_error (file, fd) | |||
| 169 | close (fd); | 162 | close (fd); |
| 170 | report_file_error ("Cannot unexec", Fcons (build_string (file), Qnil)); | 163 | report_file_error ("Cannot unexec", Fcons (build_string (file), Qnil)); |
| 171 | } | 164 | } |
| 172 | #endif /* emacs */ | ||
| 173 | 165 | ||
| 174 | #define ERROR0(msg) report_error_1 (new, msg, 0, 0); return -1 | 166 | #define ERROR0(msg) report_error_1 (new, msg, 0, 0); return -1 |
| 175 | #define ERROR1(msg,x) report_error_1 (new, msg, x, 0); return -1 | 167 | #define ERROR1(msg,x) report_error_1 (new, msg, x, 0); return -1 |
| @@ -182,12 +174,7 @@ report_error_1 (fd, msg, a1, a2) | |||
| 182 | int a1, a2; | 174 | int a1, a2; |
| 183 | { | 175 | { |
| 184 | close (fd); | 176 | close (fd); |
| 185 | #ifdef emacs | ||
| 186 | error (msg, a1, a2); | 177 | error (msg, a1, a2); |
| 187 | #else | ||
| 188 | fprintf (stderr, msg, a1, a2); | ||
| 189 | fprintf (stderr, "\n"); | ||
| 190 | #endif | ||
| 191 | } | 178 | } |
| 192 | 179 | ||
| 193 | static int make_hdr (); | 180 | static int make_hdr (); |
| @@ -319,9 +306,6 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name) | |||
| 319 | to correspond to what we want to dump. */ | 306 | to correspond to what we want to dump. */ |
| 320 | 307 | ||
| 321 | f_hdr.f_flags |= (F_RELFLG | F_EXEC); | 308 | f_hdr.f_flags |= (F_RELFLG | F_EXEC); |
| 322 | f_ohdr.text_start = (long) start_of_text (); | ||
| 323 | f_ohdr.tsize = data_start - f_ohdr.text_start; | ||
| 324 | f_ohdr.data_start = data_start; | ||
| 325 | f_ohdr.dsize = bss_start - f_ohdr.data_start; | 309 | f_ohdr.dsize = bss_start - f_ohdr.data_start; |
| 326 | f_ohdr.bsize = bss_end - bss_start; | 310 | f_ohdr.bsize = bss_end - bss_start; |
| 327 | f_thdr.s_size = f_ohdr.tsize; | 311 | f_thdr.s_size = f_ohdr.tsize; |
| @@ -417,16 +401,6 @@ write_segment (new, ptr, end) | |||
| 417 | nwrite = pagesize; | 401 | nwrite = pagesize; |
| 418 | write (new, zeros, nwrite); | 402 | write (new, zeros, nwrite); |
| 419 | } | 403 | } |
| 420 | #if 0 /* Now that we have can ask `write' to write more than a page, | ||
| 421 | it is legit for write do less than the whole amount specified. */ | ||
| 422 | else if (nwrite != ret) | ||
| 423 | { | ||
| 424 | sprintf (buf, | ||
| 425 | "unexec write failure: addr 0x%x, fileno %d, size 0x%x, wrote 0x%x, errno %d", | ||
| 426 | ptr, new, nwrite, ret, errno); | ||
| 427 | PERROR (buf); | ||
| 428 | } | ||
| 429 | #endif | ||
| 430 | i += nwrite; | 404 | i += nwrite; |
| 431 | ptr += nwrite; | 405 | ptr += nwrite; |
| 432 | } | 406 | } |
| @@ -606,21 +580,6 @@ adjust_lnnoptrs (writedesc, readdesc, new_name) | |||
| 606 | return 0; | 580 | return 0; |
| 607 | } | 581 | } |
| 608 | 582 | ||
| 609 | extern unsigned start __asm__ ("start"); | ||
| 610 | |||
| 611 | /* | ||
| 612 | * Return the address of the start of the text segment prior to | ||
| 613 | * doing an unexec. After unexec the return value is undefined. | ||
| 614 | * See crt0.c for further explanation and _start. | ||
| 615 | * | ||
| 616 | */ | ||
| 617 | |||
| 618 | char * | ||
| 619 | start_of_text (void) | ||
| 620 | { | ||
| 621 | return ((char *) &start); | ||
| 622 | } | ||
| 623 | |||
| 624 | /* **************************************************************** | 583 | /* **************************************************************** |
| 625 | * unexec | 584 | * unexec |
| 626 | * | 585 | * |