comparison src/unexalpha.c @ 306:9ea74add5d37 r21-0b51

Import from CVS: tag r21-0b51
author cvs
date Mon, 13 Aug 2007 10:41:58 +0200
parents e11d67e05968
children 972bbb6d6ca2
comparison
equal deleted inserted replaced
305:18920a7e9a86 306:9ea74add5d37
90 90
91 #ifndef DEFAULT_ENTRY_ADDRESS 91 #ifndef DEFAULT_ENTRY_ADDRESS
92 #define DEFAULT_ENTRY_ADDRESS __start 92 #define DEFAULT_ENTRY_ADDRESS __start
93 #endif 93 #endif
94 94
95 unexec (new_name, a_name, data_start, bss_start, entry_address) 95 int
96 char *new_name, *a_name; 96 unexec (char *new_name, char *a_name,
97 unsigned long data_start, bss_start, entry_address; 97 unsigned long data_start,
98 unsigned long bss_start,
99 unsigned long entry_address)
98 { 100 {
99 int new, old; 101 int new, old;
100 char * oldptr; 102 char * oldptr;
101 struct headers ohdr, nhdr; 103 struct headers ohdr, nhdr;
102 struct stat stat; 104 struct stat stat;
103 long pagesize, brk; 105 long pagesize, brk;
104 long newsyms, symrel; 106 long newsyms, symrel;
105 int nread;
106 int i; 107 int i;
107 long vaddr, scnptr; 108 long vaddr, scnptr;
108 #define BUFSIZE 8192 109 #define BUFSIZE 8192
109 char buffer[BUFSIZE]; 110 char buffer[BUFSIZE];
110 111
363 _edata 364 _edata
364 _end 365 _end
365 366
366 */ 367 */
367 368
368 369 int
369 update_dynamic_symbols (old, new_name, new, newsyms, nsyms, symoff, stroff) 370 update_dynamic_symbols (
370 char *old; /* Pointer to old executable */ 371 char *old, /* Pointer to old executable */
371 char *new_name; /* Name of new executable */ 372 char *new_name, /* Name of new executable */
372 int new; /* File descriptor for new executable */ 373 int new, /* File descriptor for new executable */
373 long newsyms; /* Offset of Symbol table in new executable */ 374 long newsyms, /* Offset of Symbol table in new executable */
374 int nsyms; /* Number of symbol table entries */ 375 int nsyms, /* Number of symbol table entries */
375 long symoff; /* Offset of External Symbols in old file */ 376 long symoff, /* Offset of External Symbols in old file */
376 long stroff; /* Offset of string table in old file */ 377 long stroff) /* Offset of string table in old file */
377 { 378 {
378 long i; 379 long i;
379 int found = 0; 380 int found = 0;
380 EXTR n_end, n_edata; 381 EXTR n_end, n_edata;
381 382