From 1a4d4b76e803a32db1168e66ad8f8b26c29c8ea0 Mon Sep 17 00:00:00 2001 From: grischka Date: Tue, 12 Dec 2017 17:33:37 +0100 Subject: tccgen_begin/end_file This is supposed to make compilation and linking with multiple source files (tcc f1.c f2.S ...) behave just the same as linking object files. tccgen.c:put_extern_sym2(): - use put_elf_sym to enter new symbols unconditionally tccelf.c: - save section state before compilation - disable symbol hashing during compilation - merge symbols and update relocations after compilation tccpe.c: - re-create s1->uw_sym for each compilation (because it may change) --- tcc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tcc.h') diff --git a/tcc.h b/tcc.h index 926ac5d..4fc273b 100644 --- a/tcc.h +++ b/tcc.h @@ -1397,6 +1397,8 @@ ST_DATA Section *stab_section, *stabstr_section; ST_FUNC void tccelf_new(TCCState *s); ST_FUNC void tccelf_delete(TCCState *s); ST_FUNC void tccelf_stab_new(TCCState *s); +ST_FUNC void tccelf_begin_file(TCCState *s1); +ST_FUNC void tccelf_end_file(TCCState *s1); ST_FUNC Section *new_section(TCCState *s1, const char *name, int sh_type, int sh_flags); ST_FUNC void section_realloc(Section *sec, unsigned long new_size); @@ -1425,7 +1427,7 @@ 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 resolve_regular_syms(void); +ST_FUNC void resolve_common_syms(TCCState *s1); ST_FUNC void relocate_syms(TCCState *s1, Section *symtab, int do_resolve); ST_FUNC void relocate_section(TCCState *s1, Section *s); -- cgit v1.3.1