diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-09-02 07:16:33 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-09-02 07:18:55 -0700 |
commit | 9ff114ca5d2c2753f1ac110f8586d0040c27a7a3 (patch) | |
tree | f5d17bbdf1bc70f396096e2bdc826dac90ad0b4e /bfd/elf64-x86-64.c | |
parent | 503294e755498eb6545ca72b338c5037facab7f7 (diff) | |
download | gdb-9ff114ca5d2c2753f1ac110f8586d0040c27a7a3.zip gdb-9ff114ca5d2c2753f1ac110f8586d0040c27a7a3.tar.gz gdb-9ff114ca5d2c2753f1ac110f8586d0040c27a7a3.tar.bz2 |
x86: Add elf_x86_compute_jump_table_size
Share elf_x86_compute_jump_table_size in elf32-i386.c and
elf64-x86-64.c.
* elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
(elf_i386_allocate_dynrelocs): Replace
elf_i386_compute_jump_table_size with
elf_x86_compute_jump_table_size.
(elf_i386_size_dynamic_sections): Likewise.
* elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
(elf_x86_64_allocate_dynrelocs): Replace
elf_x86_64_compute_jump_table_size with
elf_x86_compute_jump_table_size.
(elf_x86_64_size_dynamic_sections): Likewise.
* elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
got_entry_size.
* elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
(elf_x86_compute_jump_table_size): New.
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r-- | bfd/elf64-x86-64.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 300e99a..dcebd68 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -973,9 +973,6 @@ static const struct elf_x86_64_backend_data elf_x86_64_arch_bed = && elf_tdata (bfd) != NULL \ && elf_object_id (bfd) == X86_64_ELF_DATA) -#define elf_x86_64_compute_jump_table_size(htab) \ - ((htab)->elf.srelplt->reloc_count * GOT_ENTRY_SIZE) - static bfd_boolean elf64_x86_64_elf_object_p (bfd *abfd) { @@ -2632,7 +2629,7 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) if (GOT_TLS_GDESC_P (tls_type)) { eh->tlsdesc_got = htab->elf.sgotplt->size - - elf_x86_64_compute_jump_table_size (htab); + - elf_x86_compute_jump_table_size (htab); htab->elf.sgotplt->size += 2 * GOT_ENTRY_SIZE; h->got.offset = (bfd_vma) -2; } @@ -3035,7 +3032,7 @@ elf_x86_64_size_dynamic_sections (bfd *output_bfd, if (GOT_TLS_GDESC_P (*local_tls_type)) { *local_tlsdesc_gotent = htab->elf.sgotplt->size - - elf_x86_64_compute_jump_table_size (htab); + - elf_x86_compute_jump_table_size (htab); htab->elf.sgotplt->size += 2 * GOT_ENTRY_SIZE; *local_got = (bfd_vma) -2; } @@ -3099,7 +3096,7 @@ elf_x86_64_size_dynamic_sections (bfd *output_bfd, if (htab->elf.srelplt) { htab->sgotplt_jump_table_size - = elf_x86_64_compute_jump_table_size (htab); + = elf_x86_compute_jump_table_size (htab); htab->next_irelative_index = htab->elf.srelplt->reloc_count - 1; } else if (htab->elf.irelplt) |