aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-05-11 11:10:19 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-05-11 11:10:19 +0000
commitfd885f3a4d85dc33d794ca359ea91f31e3082717 (patch)
tree012c78d271e7eca621e78198dc5d675e62593a2d /gold
parent6750a3a77504bb879eb639c34a2911e704644ba4 (diff)
downloadgdb-fd885f3a4d85dc33d794ca359ea91f31e3082717.zip
gdb-fd885f3a4d85dc33d794ca359ea91f31e3082717.tar.gz
gdb-fd885f3a4d85dc33d794ca359ea91f31e3082717.tar.bz2
Handle R_X86_64_64 properly for x32
elfcpp/ PR gold/14091 * x86_64.h (R_X86_64_RELATIVE64): New. gold/ PR gold/14091 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of R_X86_64_64.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog7
-rw-r--r--gold/x86_64.cc4
2 files changed, 10 insertions, 1 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 9e28c62..7fffe40 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,10 @@
+2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gold/14091
+ * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
+ R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
+ R_X86_64_64.
+
2012-05-08 Cary Coutant <ccoutant@google.com>
* layout.cc (gdb_sections): Update GDB version, add .debug_addr.
diff --git a/gold/x86_64.cc b/gold/x86_64.cc
index 1339e6f..2ac29bf 100644
--- a/gold/x86_64.cc
+++ b/gold/x86_64.cc
@@ -2299,7 +2299,9 @@ Target_x86_64<size>::Scan::local(Symbol_table* symtab,
unsigned int r_sym = elfcpp::elf_r_sym<size>(reloc.get_r_info());
Reloc_section* rela_dyn = target->rela_dyn_section(layout);
rela_dyn->add_local_relative(object, r_sym,
- elfcpp::R_X86_64_RELATIVE,
+ (size == 32
+ ? elfcpp::R_X86_64_RELATIVE64
+ : elfcpp::R_X86_64_RELATIVE),
output_section, data_shndx,
reloc.get_r_offset(),
reloc.get_r_addend(), is_ifunc);