Share _bfd_x86_elf_mkobject in elf32-i386.c and elf64-x86-64.c.
* elf32-i386.c (elf_i386_mkobject): Removed.
(bfd_elf32_mkobject): Likewise.
* elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
(bfd_elf64_mkobject): Likewise.
(bfd_elf32_mkobject): Likewise.
* elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
(_bfd_x86_elf_mkobject): New.
(bfd_elf64_mkobject): Likewise.
(bfd_elf32_mkobject): Likewise.
+2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_i386_mkobject): Removed.
+ (bfd_elf32_mkobject): Likewise.
+ * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
+ (bfd_elf64_mkobject): Likewise.
+ (bfd_elf32_mkobject): Likewise.
+ * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
+ (_bfd_x86_elf_mkobject): New.
+ (bfd_elf64_mkobject): Likewise.
+ (bfd_elf32_mkobject): Likewise.
+
2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
* elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
&& elf_tdata (bfd) != NULL \
&& elf_object_id (bfd) == I386_ELF_DATA)
-static bfd_boolean
-elf_i386_mkobject (bfd *abfd)
-{
- return bfd_elf_allocate_object (abfd,
- sizeof (struct elf_x86_obj_tdata),
- I386_ELF_DATA);
-}
-
#define elf_i386_compute_jump_table_size(htab) \
((htab)->elf.srelplt->reloc_count * 4)
#define elf_info_to_howto elf_i386_info_to_howto_rel
#define elf_info_to_howto_rel elf_i386_info_to_howto_rel
-#define bfd_elf32_mkobject elf_i386_mkobject
-
#define bfd_elf32_bfd_is_local_label_name elf_i386_is_local_label_name
#define bfd_elf32_bfd_reloc_type_lookup elf_i386_reloc_type_lookup
#define bfd_elf32_bfd_reloc_name_lookup elf_i386_reloc_name_lookup
&& elf_tdata (bfd) != NULL \
&& elf_object_id (bfd) == X86_64_ELF_DATA)
-static bfd_boolean
-elf_x86_64_mkobject (bfd *abfd)
-{
- return bfd_elf_allocate_object (abfd, sizeof (struct elf_x86_obj_tdata),
- X86_64_ELF_DATA);
-}
-
#define elf_x86_64_compute_jump_table_size(htab) \
((htab)->elf.srelplt->reloc_count * GOT_ENTRY_SIZE)
#define elf_backend_size_dynamic_sections elf_x86_64_size_dynamic_sections
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
#define elf_backend_object_p elf64_x86_64_elf_object_p
-#define bfd_elf64_mkobject elf_x86_64_mkobject
#define bfd_elf64_get_synthetic_symtab elf_x86_64_get_synthetic_symtab
#define elf_backend_section_from_shdr \
elf_x86_64_reloc_type_lookup
#define bfd_elf32_bfd_reloc_name_lookup \
elf_x86_64_reloc_name_lookup
-#define bfd_elf32_mkobject \
- elf_x86_64_mkobject
#define bfd_elf32_get_synthetic_symtab \
elf_x86_64_get_synthetic_symtab
#define ELF64_DYNAMIC_INTERPRETER "/lib/ld64.so.1"
#define ELFX32_DYNAMIC_INTERPRETER "/lib/ldx32.so.1"
+bfd_boolean
+_bfd_x86_elf_mkobject (bfd *abfd)
+{
+ return bfd_elf_allocate_object (abfd,
+ sizeof (struct elf_x86_obj_tdata),
+ get_elf_backend_data (abfd)->target_id);
+}
+
/* _TLS_MODULE_BASE_ needs to be treated especially when linking
executables. Rather than setting it to the beginning of the TLS
section, we have to set it to the end. This function may be called
#define elf_x86_local_tlsdesc_gotent(abfd) \
(elf_x86_tdata (abfd)->local_tlsdesc_gotent)
+extern bfd_boolean _bfd_x86_elf_mkobject
+ (bfd *);
+
extern void _bfd_x86_elf_set_tls_module_base
(struct bfd_link_info *);
extern bfd * _bfd_x86_elf_link_setup_gnu_properties
(struct bfd_link_info *, struct elf_x86_plt_layout_table *);
+#define bfd_elf64_mkobject \
+ _bfd_x86_elf_mkobject
+#define bfd_elf32_mkobject \
+ _bfd_x86_elf_mkobject
#define bfd_elf64_bfd_link_hash_table_create \
_bfd_x86_elf_link_hash_table_create
#define bfd_elf32_bfd_link_hash_table_create \