tccpe: build IAT vector with with -run too

This prepares for x86_64 where we need the vector
for far jumps.  Also, resolve DLL symbols in place
This commit is contained in:
grischka
2009-07-06 21:34:22 +02:00
committed by unknown
parent bed17847bd
commit 370cdeb628
4 changed files with 42 additions and 68 deletions

View File

@ -432,7 +432,6 @@ static void relocate_syms(TCCState *s1, int do_resolve)
ElfW(Sym) *sym, *esym, *sym_end;
int sym_bind, sh_num, sym_index;
const char *name;
unsigned long addr;
sym_end = (ElfW(Sym) *)(symtab_section->data + symtab_section->data_offset);
for(sym = (ElfW(Sym) *)symtab_section->data + 1;
@ -442,12 +441,15 @@ static void relocate_syms(TCCState *s1, int do_resolve)
if (sh_num == SHN_UNDEF) {
name = strtab_section->data + sym->st_name;
if (do_resolve) {
#ifndef _WIN32
unsigned long addr;
name = symtab_section->link->data + sym->st_name;
addr = (unsigned long)resolve_sym(s1, name, ELFW(ST_TYPE)(sym->st_info));
addr = (unsigned long)resolve_sym(s1, name);
if (addr) {
sym->st_value = addr;
goto found;
}
#endif
} else if (s1->dynsym) {
/* if dynamic symbol exist, then use it */
sym_index = find_elf_sym(s1->dynsym, name);