diff options
author | Freya Murphy <freya@freyacat.org> | 2024-09-23 10:25:01 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-09-23 10:25:01 -0400 |
commit | f918f8fe1c1844749d75e5b874972bdd73a6b5bf (patch) | |
tree | b6874041ee27563131f2b18857384e8c7cd561c3 /mld | |
parent | make _start global in runtime (diff) | |
download | mips-f918f8fe1c1844749d75e5b874972bdd73a6b5bf.tar.gz mips-f918f8fe1c1844749d75e5b874972bdd73a6b5bf.tar.bz2 mips-f918f8fe1c1844749d75e5b874972bdd73a6b5bf.zip |
fix symtab map bad offset
Diffstat (limited to '')
-rw-r--r-- | mld/symtab.c | 5 | ||||
-rw-r--r-- | mld/vgcore.4024670 | bin | 0 -> 8847360 bytes |
2 files changed, 3 insertions, 2 deletions
diff --git a/mld/symtab.c b/mld/symtab.c index 5abad2a..992802c 100644 --- a/mld/symtab.c +++ b/mld/symtab.c @@ -55,12 +55,13 @@ int symtab_get(struct symbol_table *symtab, Elf32_Sym **res, const char *name, const char *symname = symtab->strtab->data + B32(sym->st_name); if (strcmp(name, symname) != 0) continue; - // only allow retrevial of local variables from the // same object if (sym->st_info >> 4 != STB_GLOBAL && symtab->map != NULL && obj_idx >= 0) { - struct object *obj = symtab->map->meta[i]; + // we need to change the index by one since + // symbol tables always start will a NULl symbol + struct object *obj = symtab->map->meta[i - 1]; if (obj->index != (uint32_t)obj_idx) continue; } else if (obj_idx < 0 && sym->st_info >> 4 != STB_GLOBAL) { diff --git a/mld/vgcore.4024670 b/mld/vgcore.4024670 Binary files differnew file mode 100644 index 0000000..4c6b5c4 --- /dev/null +++ b/mld/vgcore.4024670 |