aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-x86.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-09-02 07:23:46 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-09-02 07:24:42 -0700
commitfe53b4a4c47df9c0bb2fa7f0de5a241f21cf352c (patch)
tree13bc3da154360da074c04ee5407516b55782ec7c /bfd/elfxx-x86.h
parent9ff114ca5d2c2753f1ac110f8586d0040c27a7a3 (diff)
downloadgdb-fe53b4a4c47df9c0bb2fa7f0de5a241f21cf352c.zip
gdb-fe53b4a4c47df9c0bb2fa7f0de5a241f21cf352c.tar.gz
gdb-fe53b4a4c47df9c0bb2fa7f0de5a241f21cf352c.tar.bz2
x86: Add is_x86_elf
Share is_x86_elf in elf32-i386.c and elf64-x86-64.c. * elf32-i386.c (is_i386_elf): Removed. (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf. (elf_i386_size_dynamic_sections): Likewise. (elf_i386_relocate_section): Likewise. * elf64-x86-64.c (is_x86_64_elf): Removed. (elf_x86_64_check_relocs): Replace is_x86_64_elf with is_x86_elf. (elf_x86_64_size_dynamic_sections): Likewise. (elf_x86_64_relocate_section): Likewise. * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize target_id. * elfxx-x86.h (elf_x86_link_hash_table): Add target_id. (is_x86_elf): New.
Diffstat (limited to 'bfd/elfxx-x86.h')
-rw-r--r--bfd/elfxx-x86.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h
index a95b5c6..e383135 100644
--- a/bfd/elfxx-x86.h
+++ b/bfd/elfxx-x86.h
@@ -313,6 +313,7 @@ struct elf_x86_link_hash_table
bfd_vma (*r_info) (bfd_vma, bfd_vma);
bfd_vma (*r_sym) (bfd_vma);
+ enum elf_target_id target_id;
unsigned int sizeof_reloc;
unsigned int got_entry_size;
unsigned int pointer_r_type;
@@ -386,6 +387,11 @@ struct elf_x86_plt
#define elf_x86_compute_jump_table_size(htab) \
((htab)->elf.srelplt->reloc_count * (htab)->got_entry_size)
+#define is_x86_elf(bfd, htab) \
+ (bfd_get_flavour (bfd) == bfd_target_elf_flavour \
+ && elf_tdata (bfd) != NULL \
+ && elf_object_id (bfd) == (htab)->target_id)
+
extern bfd_boolean _bfd_x86_elf_mkobject
(bfd *);