libtcc: tcc_get_symbol uses the TCCState parameter
This allows using tcc_get_symbol on some other than the current TCCState. (Suggested by David Mertens)
This commit is contained in:
4
tccelf.c
4
tccelf.c
@ -162,8 +162,8 @@ static void *get_elf_sym_addr(TCCState *s, const char *name, int err)
|
||||
int sym_index;
|
||||
ElfW(Sym) *sym;
|
||||
|
||||
sym_index = find_elf_sym(symtab_section, name);
|
||||
sym = &((ElfW(Sym) *)symtab_section->data)[sym_index];
|
||||
sym_index = find_elf_sym(s->symtab, name);
|
||||
sym = &((ElfW(Sym) *)s->symtab->data)[sym_index];
|
||||
if (!sym_index || sym->st_shndx == SHN_UNDEF) {
|
||||
if (err)
|
||||
tcc_error("%s not defined", name);
|
||||
|
||||
Reference in New Issue
Block a user