aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gold/ChangeLog6
-rw-r--r--gold/x86_64.cc7
2 files changed, 11 insertions, 2 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index f0ee1f7..a9dd87b 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,9 @@
+2014-05-27 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gold/16945
+ * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
+ for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
+
2014-05-15 Alan Modra <amodra@gmail.com>
* powerpc.cc (do_plt_fde_location): Handle zero length .glink.
diff --git a/gold/x86_64.cc b/gold/x86_64.cc
index 479fb42..f58c843 100644
--- a/gold/x86_64.cc
+++ b/gold/x86_64.cc
@@ -3327,7 +3327,9 @@ Target_x86_64<size>::Relocate::relocate(
// We need to subtract the size of the GOT section to get
// the actual offset to use in the relocation.
bool have_got_offset = false;
- unsigned int got_offset = 0;
+ // Since the actual offset is always negative, we use signed int to
+ // support 64-bit GOT relocations.
+ int got_offset = 0;
switch (r_type)
{
case elfcpp::R_X86_64_GOT32:
@@ -3430,7 +3432,8 @@ Target_x86_64<size>::Relocate::relocate(
gold_assert(gsym->has_plt_offset()
|| gsym->final_value_is_known());
typename elfcpp::Elf_types<size>::Elf_Addr got_address;
- got_address = target->got_section(NULL, NULL)->address();
+ // This is the address of GLOBAL_OFFSET_TABLE.
+ got_address = target->got_plt_section()->address();
Relocate_functions<size, false>::rela64(view, object, psymval,
addend - got_address);
}