Skip to content

Commit

Permalink
Fix relocation of got table.
Browse files Browse the repository at this point in the history
  • Loading branch information
stikonas authored and ekaitz-zarraga committed Oct 2, 2023
1 parent 900be40 commit f636cf3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tccelf.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f636cf3

Please sign in to comment.