From 64b5ee2dea3a50ef52f9849364b7b1d6e94bf62d Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Sat, 12 Nov 2016 23:16:04 +0800 Subject: Rename add_elf_sym to set_elf_sym add_elf_sym is a confusing name because it is not clear what the function does compared to put_elf_sym. As a matter of fact, put_elf_sym also adds a symbol in a symbol table. Besides, "add_elf_sym" fails to convey that the function can be used to update a symbol (for instance its value). "set_elf_sym" seems like a more appropriate name: it will set a symbol to a given set of properties (value, size, etc.) and create a new one if non exist for that name as one would expect. --- tccpe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tccpe.c') diff --git a/tccpe.c b/tccpe.c index 5169099..49e983d 100644 --- a/tccpe.c +++ b/tccpe.c @@ -1494,7 +1494,7 @@ ST_FUNC SValue *pe_getimport(SValue *sv, SValue *v2) ST_FUNC int pe_putimport(TCCState *s1, int dllindex, const char *name, addr_t value) { - return add_elf_sym( + return set_elf_sym( s1->dynsymtab_section, value, dllindex, /* st_size */ @@ -1770,7 +1770,7 @@ static void pe_add_runtime(TCCState *s1, struct pe_info *pe) /* grab the startup code from libtcc1 */ if (TCC_OUTPUT_MEMORY != s1->output_type || PE_GUI == pe_type) - add_elf_sym(symtab_section, + set_elf_sym(symtab_section, 0, 0, ELFW(ST_INFO)(STB_GLOBAL, STT_NOTYPE), 0, SHN_UNDEF, start_symbol); -- cgit v1.3.1