diff options
Diffstat (limited to 'ld')
-rw-r--r-- | ld/objdump86.c | 9 | ||||
-rw-r--r-- | ld/writebin.c | 4 | ||||
-rw-r--r-- | ld/writex86.c | 3 | ||||
-rw-r--r-- | ld/x86_aout.h | 2 |
4 files changed, 14 insertions, 4 deletions
diff --git a/ld/objdump86.c b/ld/objdump86.c index 4979a1a..b29c24d 100644 --- a/ld/objdump86.c +++ b/ld/objdump86.c @@ -371,9 +371,16 @@ read_syms() nameoff = get_word(); symtype = get_word(); + if (nameoff == -1 || symtype == -1) { + printf("!!! EOF in symbol table\n"); + break; + } offset = get_sized((symtype>>14)&3); symtype &= 0x3FFF; - symnames[i] = symtab+nameoff; + if (nameoff > str_len || nameoff < 0) + symnames[i] = symtab + str_len; + else + symnames[i] = symtab+nameoff; if( !display_mode ) { diff --git a/ld/writebin.c b/ld/writebin.c index ef1cb7f..1b36ce7 100644 --- a/ld/writebin.c +++ b/ld/writebin.c @@ -1060,6 +1060,8 @@ bool_pt argbits32; bool_pt argstripflag; bool_pt arguzp; { - fatalerror("Native a.out generation not included, sorry"); + char * s = "WARNING: Native a.out generation not included, sorry\n"; + write(2, s, strlen(s)); + write_elks(outfilename, argsepid, argbits32, argstripflag, arguzp, 0); } #endif diff --git a/ld/writex86.c b/ld/writex86.c index 42158e4..c4cd3f5 100644 --- a/ld/writex86.c +++ b/ld/writex86.c @@ -415,7 +415,8 @@ bool_pt argxsym; { int i; extsym.n_sclass = 0; - extsym.n_value = 0; + memset((void*)&extsym.n_value,0, + sizeof(extsym.n_value)); for(i=sizeof extsym.n_name; i<strlen(symptr->name); i+=sizeof extsym.n_name) diff --git a/ld/x86_aout.h b/ld/x86_aout.h index 580e977..45bf0c7 100644 --- a/ld/x86_aout.h +++ b/ld/x86_aout.h @@ -101,7 +101,7 @@ struct reloc { struct nlist { /* symbol table entry */ char n_name[8]; /* symbol name */ - long n_value; /* value */ + Long n_value; /* value */ unsigned char n_sclass; /* storage class */ unsigned char n_numaux; /* number of auxiliary entries (not used) */ unsigned short n_type; /* language base and derived type (not used) */ |