ref: 50ea4ac5339f17f0abf777d46b1719334e399173
parent: 4c00c4e8204f98a5859ef6c0bfe8d2e4d6f168d2
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue May 29 14:34:00 EDT 2018
[as/coff32] Add support for aux symbol entries These aux enries are used to extend the information contained in the symbols. We don't care about them and it means that we can get rid of them without problems.
--- a/ld/coff32.c
+++ b/ld/coff32.c
@@ -239,7 +239,7 @@
readsyms(Obj *obj, long off)
{
int type;
- unsigned i;
+ unsigned i, n, aux;
FILHDR *hdr = obj->filhdr;;
if (fseek(obj->fp, off, SEEK_SET) == EOF)
@@ -256,6 +256,7 @@
outmem();
hdr = obj->filhdr;
+ aux = n = 0;
for (i = 0; i < hdr->f_nsyms; i++) {
Symbol *sym;
TUINT value;
@@ -265,7 +266,12 @@
if (fread(buff, SYMESZ, 1, obj->fp) != 1)
return -1;
+ if (aux > 0) {
+ aux--;
+ continue;
+ }
getsym(obj, buff, &ent);
+ aux = ent.n_numaux;
name = symname(obj, &ent);
type = typeof(obj, &ent);
sym = lookup(name);