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 new file mode 100644 index 0000000..4c6b5c4 Binary files /dev/null and b/mld/vgcore.4024670 differ diff --git a/test/msim/test b/test/msim/test index 293d241..86953db 100644 Binary files a/test/msim/test and b/test/msim/test differ