+2019-09-28 Alan Modra <amodra@gmail.com>
+
+ PR 16794
+ * i386.cc (Target_i386::Relocate::relocate <R_386_GOTOFF>): Don't
+ ignore addend, apply using pcrel32.
+ * x86_64.cc (Target_x86_64::Relocate::relocate <R_X86_64_GOTOFF64>):
+ Similarly use pcrel64.
+
2019-09-24 Nick Clifton <nickc@redhat.com>
* descriptors.cc: Include <string>
case elfcpp::R_386_GOTOFF:
{
- elfcpp::Elf_types<32>::Elf_Addr value;
- value = (psymval->value(object, 0)
- - target->got_plt_section()->address());
- Relocate_functions<32, false>::rel32(view, value);
+ elfcpp::Elf_types<32>::Elf_Addr reladdr;
+ reladdr = target->got_plt_section()->address();
+ Relocate_functions<32, false>::pcrel32(view, object, psymval, reladdr);
}
break;
case elfcpp::R_X86_64_GOTOFF64:
{
- typename elfcpp::Elf_types<size>::Elf_Addr value;
- value = (psymval->value(object, 0)
- - target->got_plt_section()->address());
- Reloc_funcs::rela64(view, value, addend);
+ typename elfcpp::Elf_types<size>::Elf_Addr reladdr;
+ reladdr = target->got_plt_section()->address();
+ Reloc_funcs::pcrela64(view, object, psymval, addend, reladdr);
}
break;