diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-10-14 11:32:29 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-10-14 11:32:52 -0700 |
commit | 851b6fa13707d187e068c8773f21d376391387a9 (patch) | |
tree | dd1c0760f2b6f885909eb2a22e5213e9fc7ab645 /bfd/elfxx-x86.h | |
parent | 9577f60b5a19ce93536f49cba3af4be39e39c327 (diff) | |
download | gdb-851b6fa13707d187e068c8773f21d376391387a9.zip gdb-851b6fa13707d187e068c8773f21d376391387a9.tar.gz gdb-851b6fa13707d187e068c8773f21d376391387a9.tar.bz2 |
x86: Add elf_x86_backend_data
Add plt0_pad_byte and target_os fields to elf_x86_link_hash_table.
Replace elf_i386_backend_data and elf_x86_64_backend_data with
elf_x86_backend_data.
* elf32-i386.c (elf_i386_backend_data): Removed.
(get_elf_i386_backend_data): Likewise.
(elf_i386_arch_bed): Replace elf_i386_backend_data with
elf_x86_backend_data.
(elf_i386_get_synthetic_symtab): Likewise.
(elf_i386_nacl_arch_bed): Likewise.
(elf_i386_vxworks_arch_bed): Likewise.
(elf_i386_relocate_section): Check target_os instead of
is_vxworks.
(elf_i386_finish_dynamic_symbol): Likewise.
(elf_i386_finish_dynamic_sections): Use htab->plt0_pad_byte.
Check target_os instead of is_vxworks.
(elf_i386_link_setup_gnu_properties): Remove normal_target and
is_vxworks. Initialize plt0_pad_byte.
* elf64-x86-64.c (elf_x86_64_backend_data); Removed.
(get_elf_x86_64_arch_data): Likewise.
(get_elf_x86_64_backend_data): Likewise.
(elf_x86_64_arch_bed): Replace elf_x86_64_backend_data with
elf_x86_backend_data.
(elf_x86_64_get_synthetic_symtab): Likewise.
(elf_x86_64_nacl_arch_bed): Likewise.
(elf_x86_64_link_setup_gnu_properties): Remove is_vxworks and
normal_target. Initialize plt0_pad_byte.
* elfxx-x86.c (elf_x86_allocate_dynrelocs): Check target_os
instead of is_vxworks.
(_bfd_x86_elf_size_dynamic_sections): Likewise.
(_bfd_x86_elf_finish_dynamic_sections): Likewise.
(_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
(_bfd_x86_elf_link_hash_table_create): Initialize target_os.
(_bfd_x86_elf_link_setup_gnu_properties): Remove is_vxworks.
Update normal_target. Set up plt0_pad_byte. Check target_os
instead of is_vxworks.
* elfxx-x86.h (elf_x86_target_os): New.
(elf_x86_backend_data): Likewise.
(get_elf_x86_backend_data): Likewise.
(elf_x86_link_hash_table): Remove is_vxworks. Add plt0_pad_byte
and target_os.
(elf_x86_init_table): Remove normal_target and is_vxworks. Add
plt0_pad_byte.
Diffstat (limited to 'bfd/elfxx-x86.h')
-rw-r--r-- | bfd/elfxx-x86.h | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h index a6a8455..8d2a731 100644 --- a/bfd/elfxx-x86.h +++ b/bfd/elfxx-x86.h @@ -403,6 +403,13 @@ struct elf_x86_plt_layout #define elf_x86_hash_entry(ent) \ ((struct elf_x86_link_hash_entry *)(ent)) +enum elf_x86_target_os +{ + is_normal, + is_vxworks, + is_nacl +}; + /* x86 ELF linker hash table. */ struct elf_x86_link_hash_table @@ -458,10 +465,6 @@ struct elf_x86_link_hash_table to read-only sections. */ bfd_boolean readonly_dynrelocs_against_ifunc; - /* TRUE if this is a VxWorks x86 target. This is only used for - i386. */ - bfd_boolean is_vxworks; - /* The (unloaded but important) .rel.plt.unloaded section on VxWorks. This is used for i386 only. */ asection *srelplt2; @@ -476,10 +479,15 @@ struct elf_x86_link_hash_table yet. This is only used for x86-64. */ bfd_vma tlsdesc_plt; + /* Value used to fill the unused bytes of the first PLT entry. This + is only used for i386. */ + bfd_byte plt0_pad_byte; + bfd_vma (*r_info) (bfd_vma, bfd_vma); bfd_vma (*r_sym) (bfd_vma); bfd_boolean (*is_reloc_section) (const char *); enum elf_target_id target_id; + enum elf_x86_target_os target_os; unsigned int sizeof_reloc; unsigned int dt_reloc; unsigned int dt_reloc_sz; @@ -491,6 +499,18 @@ struct elf_x86_link_hash_table const char *tls_get_addr; }; +/* Architecture-specific backend data for x86. */ + +struct elf_x86_backend_data +{ + /* Target system. */ + enum elf_x86_target_os target_os; +}; + +#define get_elf_x86_backend_data(abfd) \ + ((const struct elf_x86_backend_data *) \ + get_elf_backend_data (abfd)->arch_data) + struct elf_x86_init_table { /* The lazy PLT layout. */ @@ -505,11 +525,7 @@ struct elf_x86_init_table /* The non-lazy PLT layout for IBT. */ const struct elf_x86_non_lazy_plt_layout *non_lazy_ibt_plt; - /* TRUE if this is a normal x86 target. */ - bfd_boolean normal_target; - - /* TRUE if this is a VxWorks x86 target. */ - bfd_boolean is_vxworks; + bfd_byte plt0_pad_byte; bfd_vma (*r_info) (bfd_vma, bfd_vma); bfd_vma (*r_sym) (bfd_vma); |