25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: file_ecoff.c,v 1.1 2007/04/10 16:33:44 debug Exp $ |
* $Id: file_ecoff.c,v 1.2 2007/06/15 17:02:39 debug Exp $ |
29 |
* |
* |
30 |
* ECOFF file support. |
* ECOFF file support. |
31 |
*/ |
*/ |
307 |
* mat%20Specification.txt |
* mat%20Specification.txt |
308 |
* for more details. |
* for more details. |
309 |
*/ |
*/ |
310 |
ms_sym_buf = malloc(sizeof(struct ms_sym) * f_nsyms); |
CHECK_ALLOCATION(ms_sym_buf = |
311 |
if (ms_sym_buf == NULL) { |
malloc(sizeof(struct ms_sym) * f_nsyms)); |
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
312 |
fseek(f, f_symptr, SEEK_SET); |
fseek(f, f_symptr, SEEK_SET); |
313 |
len = fread(ms_sym_buf, 1, |
len = fread(ms_sym_buf, 1, |
314 |
sizeof(struct ms_sym) * f_nsyms, f); |
sizeof(struct ms_sym) * f_nsyms, f); |
377 |
debug("%i symbols @ 0x%08x (strings @ 0x%08x)\n", |
debug("%i symbols @ 0x%08x (strings @ 0x%08x)\n", |
378 |
iextMax, cbExtOffset, cbSsExtOffset); |
iextMax, cbExtOffset, cbSsExtOffset); |
379 |
|
|
380 |
symbol_data = malloc(issExtMax + 2); |
CHECK_ALLOCATION(symbol_data = malloc(issExtMax + 2)); |
|
if (symbol_data == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
381 |
memset(symbol_data, 0, issExtMax + 2); |
memset(symbol_data, 0, issExtMax + 2); |
382 |
fseek(f, cbSsExtOffset, SEEK_SET); |
fseek(f, cbSsExtOffset, SEEK_SET); |
383 |
fread(symbol_data, 1, issExtMax + 1, f); |
fread(symbol_data, 1, issExtMax + 1, f); |
384 |
|
|
385 |
nsymbols = iextMax; |
nsymbols = iextMax; |
386 |
|
|
387 |
extsyms = malloc(iextMax * sizeof(struct ecoff_extsym)); |
CHECK_ALLOCATION(extsyms = |
388 |
if (extsyms == NULL) { |
malloc(iextMax * sizeof(struct ecoff_extsym))); |
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
389 |
memset(extsyms, 0, iextMax * sizeof(struct ecoff_extsym)); |
memset(extsyms, 0, iextMax * sizeof(struct ecoff_extsym)); |
390 |
fseek(f, cbExtOffset, SEEK_SET); |
fseek(f, cbExtOffset, SEEK_SET); |
391 |
fread(extsyms, 1, iextMax * sizeof(struct ecoff_extsym), f); |
fread(extsyms, 1, iextMax * sizeof(struct ecoff_extsym), f); |