1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-22 02:20:51 +03:00

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.
This commit is contained in:
Rui Ueyama 2021-06-20 18:51:36 +09:00
parent 7a689d8361
commit c876849144

View File

@ -279,6 +279,7 @@ void InputSection<I386>::apply_reloc_nonalloc(Context<I386> &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