x86: Check target_id instead of elf_machine_code
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 30 Aug 2017 18:13:32 +0000 (11:13 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 30 Aug 2017 18:13:32 +0000 (11:13 -0700)
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
bfd/elfxx-x86.c

index 095373e6b3df5f1296b721a3b3c4bce0ef9c9c6d..9c7e2ba9d5babf3ebe0363d42ba2d7c14875437c 100644 (file)
@@ -1,3 +1,8 @@
+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.
index ccd6e1058ae2f5f7d54badb96b939003b8739946..d040ee35143ca995f7bb4e4a4d501c48578f91bb 100644 (file)
@@ -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;