aboutsummaryrefslogtreecommitdiff
path: root/tccelf.c
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2016-11-12 23:16:09 +0800
committerThomas Preud'homme <robotux@celest.fr>2016-12-03 17:26:51 +0000
commit097cf3aa5ee370bab50d6d15cef9b0af55a1a3a2 (patch)
tree3bf02360980492571e777b334dc1e9a8bdd61969 /tccelf.c
parentc4bec037be0da6bfd19484c34cc19e358cbb6822 (diff)
downloadtinycc-097cf3aa5ee370bab50d6d15cef9b0af55a1a3a2.tar.gz
tinycc-097cf3aa5ee370bab50d6d15cef9b0af55a1a3a2.tar.bz2
Control symbol table of which to relocate symbols
Pass pointer to symbol table to relocate the symbols of in relocate_syms
Diffstat (limited to 'tccelf.c')
-rw-r--r--tccelf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tccelf.c b/tccelf.c
index b9f1634..7d656e5 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -652,13 +652,13 @@ ST_FUNC void relocate_common_syms(void)
/* relocate symbol table, resolve undefined symbols if do_resolve is
true and output error if undefined symbol. */
-ST_FUNC void relocate_syms(TCCState *s1, int do_resolve)
+ST_FUNC void relocate_syms(TCCState *s1, Section *symtab, int do_resolve)
{
ElfW(Sym) *sym;
int sym_bind, sh_num;
const char *name;
- for_each_elem(symtab_section, 1, sym, ElfW(Sym)) {
+ for_each_elem(symtab, 1, sym, ElfW(Sym)) {
sh_num = sym->st_shndx;
if (sh_num == SHN_UNDEF) {
name = (char *) strtab_section->data + sym->st_name;
@@ -1898,7 +1898,7 @@ static int final_sections_reloc(TCCState *s1)
int i;
Section *s;
- relocate_syms(s1, 0);
+ relocate_syms(s1, s1->symtab, 0);
if (s1->nb_errors != 0)
return -1;