diff options
| author | grischka <grischka> | 2009-07-06 21:34:22 +0200 |
|---|---|---|
| committer | unknown <gr@.(none)> | 2009-07-18 21:55:15 +0200 |
| commit | 370cdeb628968fe1c9a53dbea0aae12c77008b67 (patch) | |
| tree | d187c5951848966a82f3a2c11ae9a2f2b17ecfbf /libtcc.c | |
| parent | bed17847bdfa872e219a12237e06df83e464bdba (diff) | |
| download | tinycc-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 'libtcc.c')
| -rw-r--r-- | libtcc.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -212,12 +212,9 @@ static int tcc_add_file_internal(TCCState *s, const char *filename, int flags); int tcc_output_coff(TCCState *s1, FILE *f); /* tccpe.c */ -void *resolve_sym(TCCState *s1, const char *sym, int type); int pe_load_def_file(struct TCCState *s1, int fd); int pe_test_res_file(void *v, int size); int pe_load_res_file(struct TCCState *s1, int fd); -void pe_add_runtime(struct TCCState *s1); -void pe_guess_outfile(char *objfilename, int output_type); int pe_output_file(struct TCCState *s1, const char *filename); /* tccasm.c */ @@ -306,7 +303,7 @@ static inline int toup(int c) return c; } -void *resolve_sym(TCCState *s1, const char *sym, int type); +void *resolve_sym(TCCState *s1, const char *sym); /********************************************************/ @@ -412,7 +409,7 @@ void *resolve_sym(TCCState *s1, const char *symbol, int type) #include <dlfcn.h> -void *resolve_sym(TCCState *s1, const char *sym, int type) +void *resolve_sym(TCCState *s1, const char *sym) { return dlsym(RTLD_DEFAULT, sym); } @@ -1666,15 +1663,15 @@ int tcc_relocate(TCCState *s1, void *ptr) s1->runtime_added = 1; s1->nb_errors = 0; #ifdef TCC_TARGET_PE - pe_add_runtime(s1); - relocate_common_syms(); - tcc_add_linker_symbols(s1); + pe_output_file(s1, NULL); #else tcc_add_runtime(s1); relocate_common_syms(); tcc_add_linker_symbols(s1); build_got_entries(s1); #endif + if (s1->nb_errors) + return -1; } offset = 0, mem = (unsigned long)ptr; |
