Skip to content

Commit

Permalink
Support R_X86_64_GOTOFF64 in non-memory-allocated sections
Browse files Browse the repository at this point in the history
Fixes #1003
  • Loading branch information
rui314 committed Mar 5, 2023
1 parent 77c4795 commit d2970e0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions elf/arch-x86-64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,9 @@ void InputSection<E>::apply_reloc_nonalloc(Context<E> &ctx, u8 *base) {
else
*(ul64 *)loc = S + A - ctx.dtp_addr;
break;
case R_X86_64_GOTOFF64:
*(ul64 *)loc = S + A - ctx.gotplt->shdr.sh_addr;
break;
case R_X86_64_GOTPC64:
// PC-relative relocation doesn't make sense for non-memory-allocated
// section, but GCC 6.3.0 seems to create this reloc for
Expand Down

0 comments on commit d2970e0

Please sign in to comment.