Mercurial > hg > xemacs-beta
comparison src/unexalpha.c @ 410:de805c49cfc1 r21-2-35
Import from CVS: tag r21-2-35
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:19:21 +0200 |
parents | 74fd4e045ea6 |
children | 697ef44129c6 |
comparison
equal
deleted
inserted
replaced
409:301b9ebbdf3b | 410:de805c49cfc1 |
---|---|
53 #define SEEK(_fd, _position, _error_message, _error_arg) \ | 53 #define SEEK(_fd, _position, _error_message, _error_arg) \ |
54 errno = EEOF; \ | 54 errno = EEOF; \ |
55 if (lseek (_fd, _position, L_SET) != _position) \ | 55 if (lseek (_fd, _position, L_SET) != _position) \ |
56 fatal_unexec (_error_message, _error_arg); | 56 fatal_unexec (_error_message, _error_arg); |
57 | 57 |
58 void *sbrk(); | |
59 | |
60 #define EEOF -1 | 58 #define EEOF -1 |
61 | 59 |
62 static struct scnhdr *text_section; | 60 static struct scnhdr *text_section; |
63 static struct scnhdr *init_section; | 61 static struct scnhdr *init_section; |
64 static struct scnhdr *finit_section; | 62 static struct scnhdr *finit_section; |
81 struct aouthdr aout; | 79 struct aouthdr aout; |
82 struct scnhdr section[_MIPS_NSCNS_MAX]; | 80 struct scnhdr section[_MIPS_NSCNS_MAX]; |
83 }; | 81 }; |
84 | 82 |
85 | 83 |
86 | |
87 /* Define name of label for entry point for the dumped executable. */ | 84 /* Define name of label for entry point for the dumped executable. */ |
88 | 85 |
89 #ifndef DEFAULT_ENTRY_ADDRESS | 86 #ifndef DEFAULT_ENTRY_ADDRESS |
90 #define DEFAULT_ENTRY_ADDRESS __start | 87 #define DEFAULT_ENTRY_ADDRESS __start |
91 #endif | 88 #endif |
89 EXTERN_C int DEFAULT_ENTRY_ADDRESS (void); | |
90 | |
92 | 91 |
93 int | 92 int |
94 unexec (char *new_name, char *a_name, | 93 unexec (char *new_name, char *a_name, |
95 unsigned long data_start, | 94 unsigned long data_start, |
96 unsigned long bss_start, | 95 unsigned long bss_start, |
206 | 205 |
207 nhdr.aout.dsize = brk - DATA_START; | 206 nhdr.aout.dsize = brk - DATA_START; |
208 nhdr.aout.bsize = 0; | 207 nhdr.aout.bsize = 0; |
209 if (entry_address == 0) | 208 if (entry_address == 0) |
210 { | 209 { |
211 extern int DEFAULT_ENTRY_ADDRESS (void); | |
212 nhdr.aout.entry = (unsigned long)DEFAULT_ENTRY_ADDRESS; | 210 nhdr.aout.entry = (unsigned long)DEFAULT_ENTRY_ADDRESS; |
213 } | 211 } |
214 else | 212 else |
215 nhdr.aout.entry = entry_address; | 213 nhdr.aout.entry = entry_address; |
216 | 214 |