+2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
+
+ * 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.
+
2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
* elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
&& elf_tdata (bfd) != NULL \
&& elf_object_id (bfd) == I386_ELF_DATA)
-#define elf_i386_compute_jump_table_size(htab) \
- ((htab)->elf.srelplt->reloc_count * 4)
-
/* Return TRUE if the TLS access code sequence support transition
from R_TYPE. */
if (GOT_TLS_GDESC_P (tls_type))
{
eh->tlsdesc_got = htab->elf.sgotplt->size
- - elf_i386_compute_jump_table_size (htab);
+ - elf_x86_compute_jump_table_size (htab);
htab->elf.sgotplt->size += 8;
h->got.offset = (bfd_vma) -2;
}
if (GOT_TLS_GDESC_P (*local_tls_type))
{
*local_tlsdesc_gotent = htab->elf.sgotplt->size
- - elf_i386_compute_jump_table_size (htab);
+ - elf_x86_compute_jump_table_size (htab);
htab->elf.sgotplt->size += 8;
*local_got = (bfd_vma) -2;
}
&& 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)
{
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;
}
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;
}
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)
ret->r_info = elf64_r_info;
ret->r_sym = elf64_r_sym;
ret->sizeof_reloc = sizeof (Elf64_External_Rela);
+ ret->got_entry_size = 8;
ret->pointer_r_type = R_X86_64_64;
ret->dynamic_interpreter = ELF64_DYNAMIC_INTERPRETER;
ret->dynamic_interpreter_size = sizeof ELF64_DYNAMIC_INTERPRETER;
if (bed->target_id == X86_64_ELF_DATA)
{
ret->sizeof_reloc = sizeof (Elf32_External_Rela);
+ ret->got_entry_size = 8;
ret->pointer_r_type = R_X86_64_32;
ret->dynamic_interpreter = ELFX32_DYNAMIC_INTERPRETER;
ret->dynamic_interpreter_size
else
{
ret->sizeof_reloc = sizeof (Elf32_External_Rel);
+ ret->got_entry_size = 4;
ret->pointer_r_type = R_386_32;
ret->dynamic_interpreter = ELF32_DYNAMIC_INTERPRETER;
ret->dynamic_interpreter_size
bfd_vma (*r_info) (bfd_vma, bfd_vma);
bfd_vma (*r_sym) (bfd_vma);
unsigned int sizeof_reloc;
+ unsigned int got_entry_size;
unsigned int pointer_r_type;
int dynamic_interpreter_size;
const char *dynamic_interpreter;
#define elf_x86_local_tlsdesc_gotent(abfd) \
(elf_x86_tdata (abfd)->local_tlsdesc_gotent)
+#define elf_x86_compute_jump_table_size(htab) \
+ ((htab)->elf.srelplt->reloc_count * (htab)->got_entry_size)
+
extern bfd_boolean _bfd_x86_elf_mkobject
(bfd *);