+2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
+ with htab->is_vxworks.
+ (elf_i386_size_dynamic_sections): Likewise.
+ (elf_i386_relocate_section): Likewise.
+ (elf_i386_finish_dynamic_symbol): Likewise.
+ (elf_i386_finish_dynamic_sections): Likewise.
+
2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
* elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
struct elf_dyn_relocs *p;
unsigned plt_entry_size;
bfd_boolean resolved_to_zero;
- const struct elf_i386_backend_data *bed;
if (h->root.type == bfd_link_hash_indirect)
return TRUE;
if (htab == NULL)
return FALSE;
- bed = get_elf_i386_backend_data (info->output_bfd);
-
plt_entry_size = htab->plt.plt_entry_size;
resolved_to_zero = UNDEFINED_WEAK_RESOLVED_TO_ZERO (info,
}
}
- if (bed->os == is_vxworks && !bfd_link_pic (info))
+ if (htab->is_vxworks && !bfd_link_pic (info))
{
/* VxWorks has a second set of relocations for each PLT entry
in executables. They go in a separate relocation section,
}
}
- if (bed->os == is_vxworks)
+ if (htab->is_vxworks)
{
struct elf_dyn_relocs **pp;
for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
linker script /DISCARD/, so we'll be discarding
the relocs too. */
}
- else if ((get_elf_i386_backend_data (output_bfd)->os
- == is_vxworks)
+ else if (htab->is_vxworks
&& strcmp (p->sec->output_section->name,
".tls_vars") == 0)
{
return FALSE;
}
}
- if (get_elf_i386_backend_data (output_bfd)->os == is_vxworks
+ if (htab->is_vxworks
&& !elf_vxworks_add_dynamic_entries (output_bfd, info))
return FALSE;
}
local_tlsdesc_gotents = elf_x86_local_tlsdesc_gotent (input_bfd);
/* We have to handle relocations in vxworks .tls_vars sections
specially, because the dynamic loader is 'weird'. */
- is_vxworks_tls = ((get_elf_i386_backend_data (output_bfd)->os
- == is_vxworks)
+ is_vxworks_tls = (htab->is_vxworks
&& bfd_link_pic (info)
&& !strcmp (input_section->output_section->name,
".tls_vars"));
{
struct elf_x86_link_hash_table *htab;
unsigned plt_entry_size;
- const struct elf_i386_backend_data *abed;
struct elf_x86_link_hash_entry *eh;
bfd_boolean local_undefweak;
bfd_boolean use_plt_second;
if (htab == NULL)
return FALSE;
- abed = get_elf_i386_backend_data (output_bfd);
plt_entry_size = htab->plt.plt_entry_size;
/* Use the second PLT section only if there is .plt section. */
resolved_plt->contents + plt_offset
+ htab->plt.plt_got_offset);
- if (abed->os == is_vxworks)
+ if (htab->is_vxworks)
{
int s, k, reloc_index;
switch (dyn.d_tag)
{
default:
- if (abed->os == is_vxworks
+ if (htab->is_vxworks
&& elf_vxworks_finish_dynamic_entry (output_bfd, &dyn))
break;
continue;
htab->elf.splt->contents
+ htab->lazy_plt->plt0_got2_offset);
- if (abed->os == is_vxworks)
+ if (htab->is_vxworks)
{
Elf_Internal_Rela rel;
int num_plts = (htab->elf.splt->size