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). --- tcc.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tcc.h') diff --git a/tcc.h b/tcc.h index 38bbda8..926ac5d 100644 --- a/tcc.h +++ b/tcc.h @@ -911,7 +911,6 @@ struct filespec { /* symbol was created by tccasm.c first */ #define VT_ASM (VT_VOID | VT_UNSIGNED) -#define VT_ASM_GLOBAL VT_DEFSIGN #define IS_ASM_SYM(sym) (((sym)->type.t & (VT_BTYPE | VT_ASM)) == VT_ASM) /* token values */ @@ -1426,11 +1425,10 @@ ST_FUNC void put_stabs_r(const char *str, int type, int other, int desc, unsigne ST_FUNC void put_stabn(int type, int other, int desc, int value); ST_FUNC void put_stabd(int type, int other, int desc); -ST_FUNC void relocate_common_syms(void); +ST_FUNC void resolve_regular_syms(void); ST_FUNC void relocate_syms(TCCState *s1, Section *symtab, int do_resolve); ST_FUNC void relocate_section(TCCState *s1, Section *s); -ST_FUNC void tcc_add_linker_symbols(TCCState *s1); ST_FUNC int tcc_object_type(int fd, ElfW(Ehdr) *h); ST_FUNC int tcc_load_object_file(TCCState *s1, int fd, unsigned long file_offset); ST_FUNC int tcc_load_archive(TCCState *s1, int fd); -- cgit v1.3.1