From c876849144bede0af34c70490be322dd10cbb817 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Sun, 20 Jun 2021 18:51:36 +0900 Subject: [PATCH] Allow R_386_GOTPC relocations in non-allocated sections This is not logically correct, because PC-relative offsets make sense only against allocated sections. However, this is needed by Gentoo's dev-lang/gnat-gpl-2018-r3 package. --- arch_i386.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/arch_i386.cc b/arch_i386.cc index 7b4b3008..6c663cd5 100644 --- a/arch_i386.cc +++ b/arch_i386.cc @@ -279,6 +279,7 @@ void InputSection::apply_reloc_nonalloc(Context &ctx, u8 *base) { case R_386_PC8: case R_386_PC16: case R_386_PC32: + case R_386_GOTPC: if (ref) write(ref->frag->get_addr(ctx) + ref->addend); else