diff options
author | Freya Murphy <freya@freyacat.org> | 2024-09-23 10:28:35 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-09-23 10:28:35 -0400 |
commit | b6526332c680d8208c81d300bcfbcad10bc0f33b (patch) | |
tree | 769f00354aa35c1e811a20d75b49340a5d54a8fc | |
parent | fix symtab map bad offset (diff) | |
download | mips-b6526332c680d8208c81d300bcfbcad10bc0f33b.tar.gz mips-b6526332c680d8208c81d300bcfbcad10bc0f33b.tar.bz2 mips-b6526332c680d8208c81d300bcfbcad10bc0f33b.zip |
symtab never return null symbol
Diffstat (limited to '')
-rw-r--r-- | mld/symtab.c | 3 | ||||
-rw-r--r-- | mld/vgcore.4024670 | bin | 8847360 -> 0 bytes |
2 files changed, 2 insertions, 1 deletions
diff --git a/mld/symtab.c b/mld/symtab.c index 992802c..9417673 100644 --- a/mld/symtab.c +++ b/mld/symtab.c @@ -50,11 +50,12 @@ int symtab_push(struct symbol_table *symtab, const Elf32_Sym *sym) int symtab_get(struct symbol_table *symtab, Elf32_Sym **res, const char *name, int32_t obj_idx) { - for (size_t i = 0; i < symtab->len; i++) { + for (size_t i = 1; i < symtab->len; i++) { Elf32_Sym *sym = &symtab->syms[i]; 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 && diff --git a/mld/vgcore.4024670 b/mld/vgcore.4024670 Binary files differdeleted file mode 100644 index 4c6b5c4..0000000 --- a/mld/vgcore.4024670 +++ /dev/null |