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). --- tccpe.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tccpe.c') diff --git a/tccpe.c b/tccpe.c index a67023d..af4438d 100644 --- a/tccpe.c +++ b/tccpe.c @@ -1970,8 +1970,7 @@ ST_FUNC int pe_output_file(TCCState *s1, const char *filename) tcc_add_bcheck(s1); pe_add_runtime(s1, &pe); - relocate_common_syms(); /* assign bss addresses */ - tcc_add_linker_symbols(s1); + resolve_regular_syms(); pe_set_options(s1, &pe); ret = pe_check_symbols(&pe); -- cgit v1.3.1