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.
This commit is contained in:
Thomas Preud'homme
2016-11-12 23:16:04 +08:00
parent 9e6610b0aa
commit 64b5ee2dea
5 changed files with 29 additions and 29 deletions

View File

@ -1199,7 +1199,7 @@ LIBTCCAPI int tcc_add_symbol(TCCState *s, const char *name, const void *val)
So it is handled here as if it were in a DLL. */
pe_putimport(s, 0, name, (uintptr_t)val);
#else
add_elf_sym(symtab_section, (uintptr_t)val, 0,
set_elf_sym(symtab_section, (uintptr_t)val, 0,
ELFW(ST_INFO)(STB_GLOBAL, STT_NOTYPE), 0,
SHN_ABS, name);
#endif