From eacfca90f1ff457d3a7be9d593040218b6208d2b Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 23 Aug 2016 12:20:59 +0930 Subject: R_OR1K_GOTOFF_* relocations PR 20475 * elf32-or1k.c (or1k_elf_relocate_section): Offset from _GLOBAL_OFFSET_TABLE_, not start of .got section. --- bfd/elf32-or1k.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bfd/elf32-or1k.c') diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c index 0035f8e..3351ba6 100644 --- a/bfd/elf32-or1k.c +++ b/bfd/elf32-or1k.c @@ -998,7 +998,10 @@ or1k_elf_relocate_section (bfd *output_bfd, case R_OR1K_GOTOFF_HI16: /* Relocation is offset from GOT. */ BFD_ASSERT (sgot != NULL); - relocation -= sgot->output_section->vma; + relocation + -= (htab->root.hgot->root.u.def.value + + htab->root.hgot->root.u.def.section->output_offset + + htab->root.hgot->root.u.def.section->output_section->vma); break; case R_OR1K_INSN_REL_26: -- cgit v1.1