From 8490c54dbd756130962825adf32ab955137da8a4 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Sun, 10 Dec 2017 06:18:27 +0100 Subject: Fix some multi-file corner cases with asm for this we have to create also asm symbols as VT_STATIC initially except if there's an indication that it should be global (.globl or undefined at end of unit). For this to work we need to be able to globalize symbols after they were local and enter them into the ELF hash tables, and also adjust the symbols that were potentially already used in relocs when they were still local. The easiest is to do a proper symbol resolution step also in multi-file mode, for regular symbols (the non-dynamic ones, i.e. not from shared libs). --- tccrun.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tccrun.c') diff --git a/tccrun.c b/tccrun.c index d0501a0..72b3994 100644 --- a/tccrun.c +++ b/tccrun.c @@ -188,8 +188,7 @@ static int tcc_relocate_ex(TCCState *s1, void *ptr, addr_t ptr_diff) pe_output_file(s1, NULL); #else tcc_add_runtime(s1); - relocate_common_syms(); - tcc_add_linker_symbols(s1); + resolve_regular_syms(); build_got_entries(s1); #endif if (s1->nb_errors) -- cgit v1.3.1