This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[committed, PATCH] x86: Check target_id instead of elf_machine_code
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Date: Wed, 30 Aug 2017 11:17:03 -0700
- Subject: [committed, PATCH] x86: Check target_id instead of elf_machine_code
- Authentication-results: sourceware.org; auth=none
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Since both elf32-i386.c and elf64-x86-64.c support targets with
different ELF_MACHINE_CODEs, _bfd_x86_elf_link_hash_table_create
should check target_id instead of elf_machine_code.
* elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
target_id instead of elf_machine_code.
---
bfd/ChangeLog | 5 +++++
bfd/elfxx-x86.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 095373e6b3..9c7e2ba9d5 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
+ * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
+ target_id instead of elf_machine_code.
+
+2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
+
* elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
(elf_i386_lazy_plt_layout): Likewise.
(elf_i386_non_lazy_plt_layout): Likewise.
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index ccd6e1058a..d040ee3514 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -278,7 +278,7 @@ _bfd_x86_elf_link_hash_table_create (bfd *abfd)
{
ret->r_info = elf32_r_info;
ret->r_sym = elf32_r_sym;
- if (bed->elf_machine_code == EM_X86_64)
+ if (bed->target_id == X86_64_ELF_DATA)
{
ret->pointer_r_type = R_X86_64_32;
ret->dynamic_interpreter = ELFX32_DYNAMIC_INTERPRETER;
--
2.13.5