mirror of
https://github.com/open-simh/simtools.git
synced 2026-01-26 12:11:47 +00:00
Added some robustness for when dumpobj is run on files which are...
almost an object file, such as an object library.
This commit is contained in:
12
dumpobj.c
12
dumpobj.c
@@ -47,8 +47,10 @@ DAMAGE.
|
||||
|
||||
#define WORD(cp) ((*(cp) & 0xff) + ((*((cp)+1) & 0xff) << 8))
|
||||
|
||||
#define NPSECTS 256
|
||||
|
||||
int psectid = 0;
|
||||
char *psects[256];
|
||||
char *psects[NPSECTS];
|
||||
FILE *bin = NULL;
|
||||
int badbin = 0;
|
||||
int xferad = 1;
|
||||
@@ -367,6 +369,7 @@ void got_gsd(
|
||||
flags);
|
||||
psects[psectid] = strdup(name);
|
||||
trim(psects[psectid++]);
|
||||
psectid %= NPSECTS;
|
||||
break;
|
||||
case 6:
|
||||
sprintf(gsdline, "\tIDENT %s=%o flags=%o\n", name, value, flags);
|
||||
@@ -406,6 +409,10 @@ void got_endgsd(
|
||||
(void)cp;
|
||||
(void)len;
|
||||
|
||||
if (nr_gsds == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
qsort(all_gsds, nr_gsds, sizeof(char *), compare_gsdlines);
|
||||
|
||||
printf("GSD:\n");
|
||||
@@ -418,6 +425,9 @@ void got_endgsd(
|
||||
printf("ENDGSD\n");
|
||||
|
||||
free(all_gsds);
|
||||
all_gsds = NULL;
|
||||
nr_gsds = 0;
|
||||
gsdsize = 0;
|
||||
}
|
||||
|
||||
unsigned last_text_addr = 0;
|
||||
|
||||
Reference in New Issue
Block a user