aboutsummaryrefslogtreecommitdiff
path: root/tccelf.c
diff options
context:
space:
mode:
authorgrischka <grischka>2009-07-06 21:34:22 +0200
committerunknown <gr@.(none)>2009-07-18 21:55:15 +0200
commit370cdeb628968fe1c9a53dbea0aae12c77008b67 (patch)
treed187c5951848966a82f3a2c11ae9a2f2b17ecfbf /tccelf.c
parentbed17847bdfa872e219a12237e06df83e464bdba (diff)
downloadtinycc-370cdeb628968fe1c9a53dbea0aae12c77008b67.tar.gz
tinycc-370cdeb628968fe1c9a53dbea0aae12c77008b67.tar.bz2
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
Diffstat (limited to 'tccelf.c')
-rw-r--r--tccelf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tccelf.c b/tccelf.c
index 1b0ed13..f0c12c3 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -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);