Fix relocation of got table.

This commit is contained in:
Andrius Štikonas 2023-10-01 18:39:43 +01:00 committed by Ekaitz Zarraga
parent 900be40e8b
commit f636cf3d48
1 changed files with 2 additions and 3 deletions

View File

@ -1844,7 +1844,7 @@ static int final_sections_reloc(TCCState *s1)
/* On X86 gdb 7.3 works in any case but gdb 6.6 will crash if SHF_ALLOC
checking is removed */
#else
if (s->reloc && s != s1->got)
if (s->reloc)
/* On X86_64 gdb 7.3 will crash if SHF_ALLOC checking is present */
#endif
relocate_section(s1, s);
@ -2226,8 +2226,7 @@ static int elf_output_file(TCCState *s1, const char *filename)
}
}
/* if building executable or DLL, then relocate each section
except the GOT which is already relocated */
/* if building executable or DLL, then relocate each section */
if (file_type != TCC_OUTPUT_OBJ) {
ret = final_sections_reloc(s1);
if (ret)