X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Funexalpha.c;h=9602c1077a02b0b62ccefdfecf5bf59f533689b3;hb=3aca7317dd930beecbddba646284279744087e69;hp=9200f162edd51df2c8c8fb8ec9fcc8b75208ef4b;hpb=6883ee56ec887c2c48abe5b06b5e66aa74031910;p=chise%2Fxemacs-chise.git- diff --git a/src/unexalpha.c b/src/unexalpha.c index 9200f16..9602c10 100644 --- a/src/unexalpha.c +++ b/src/unexalpha.c @@ -31,6 +31,7 @@ Boston, MA 02111-1307, USA. */ #include #include #include +#include #include #include #include @@ -54,9 +55,6 @@ static void mark_x (char *); if (lseek (_fd, _position, L_SET) != _position) \ fatal_unexec (_error_message, _error_arg); -extern int errno; -extern char *strerror (); - void *sbrk(); #define EEOF -1 @@ -92,9 +90,11 @@ struct headers { #define DEFAULT_ENTRY_ADDRESS __start #endif -unexec (new_name, a_name, data_start, bss_start, entry_address) - char *new_name, *a_name; - unsigned long data_start, bss_start, entry_address; +int +unexec (char *new_name, char *a_name, + unsigned long data_start, + unsigned long bss_start, + unsigned long entry_address) { int new, old; char * oldptr; @@ -102,7 +102,6 @@ unexec (new_name, a_name, data_start, bss_start, entry_address) struct stat stat; long pagesize, brk; long newsyms, symrel; - int nread; int i; long vaddr, scnptr; #define BUFSIZE 8192 @@ -209,7 +208,7 @@ unexec (new_name, a_name, data_start, bss_start, entry_address) nhdr.aout.bsize = 0; if (entry_address == 0) { - extern DEFAULT_ENTRY_ADDRESS (); + extern int DEFAULT_ENTRY_ADDRESS (void); nhdr.aout.entry = (unsigned long)DEFAULT_ENTRY_ADDRESS; } else @@ -365,15 +364,15 @@ unexec (new_name, a_name, data_start, bss_start, entry_address) */ - -update_dynamic_symbols (old, new_name, new, newsyms, nsyms, symoff, stroff) - char *old; /* Pointer to old executable */ - char *new_name; /* Name of new executable */ - int new; /* File descriptor for new executable */ - long newsyms; /* Offset of Symbol table in new executable */ - int nsyms; /* Number of symbol table entries */ - long symoff; /* Offset of External Symbols in old file */ - long stroff; /* Offset of string table in old file */ +int +update_dynamic_symbols ( + char *old, /* Pointer to old executable */ + char *new_name, /* Name of new executable */ + int new, /* File descriptor for new executable */ + long newsyms, /* Offset of Symbol table in new executable */ + int nsyms, /* Number of symbol table entries */ + long symoff, /* Offset of External Symbols in old file */ + long stroff) /* Offset of string table in old file */ { long i; int found = 0;