diff --git a/tccelf.c b/tccelf.c index 1f87946..f9a8ced 100644 --- a/tccelf.c +++ b/tccelf.c @@ -1446,8 +1446,10 @@ ST_FUNC void build_got_entries(TCCState *s1) break; } - if (!s1->got) + if (!s1->got) { build_got(s1); + sym = &((ElfW(Sym) *)symtab_section->data)[sym_index]; + } if (type == R_X86_64_GOT32 || type == R_X86_64_GOTPCREL || type == R_X86_64_PLT32) { unsigned long ofs;