struct bfd_link_hash_entry *bh;
const struct elf_backend_data *bed;
- if (! is_elf_hash_table (info))
+ if (! is_elf_hash_table (info->hash))
return FALSE;
if (elf_hash_table (info)->dynamic_sections_created)
return FALSE;
}
- if (! info->traditional_format
- && info->hash->creator->flavour == bfd_target_elf_flavour)
+ if (! info->traditional_format)
{
s = bfd_make_section (abfd, ".eh_frame_hdr");
if (s == NULL
{
struct elf_link_hash_entry *h;
- if (info->hash->creator->flavour != bfd_target_elf_flavour)
+ if (!is_elf_hash_table (info->hash))
return TRUE;
h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, TRUE, FALSE);
Elf_External_Sym_Shndx eshndx;
char esym[sizeof (Elf64_External_Sym)];
- if (! is_elf_hash_table (info))
+ if (! is_elf_hash_table (info->hash))
return 0;
/* See if the entry exists already. */
else
olddef = TRUE;
- /* We need to rememeber if a symbol has a definition in a dynamic
+ /* We need to remember if a symbol has a definition in a dynamic
object or is weak in all dynamic objects. Internal and hidden
visibility will make it unavailable to dynamic objects. */
if (newdyn && (h->elf_link_hash_flags & ELF_LINK_DYNAMIC_DEF) == 0)
return TRUE;
}
- /* We need to treat weak definiton right, depending on if there is a
+ /* We need to treat weak definition right, depending on if there is a
definition from a dynamic object. */
if (bind == STB_WEAK)
{
h->size, abfd, bfd_link_hash_common, sym->st_size)))
return FALSE;
- /* If the predumed common symbol in the dynamic object is
+ /* If the presumed common symbol in the dynamic object is
larger, pretend that the new symbol has its size. */
if (h->size > *pvalue)
if (override)
{
- /* We are overridden by an old defition. We need to check if we
+ /* We are overridden by an old definition. We need to check if we
need to create the indirect symbol from the default name. */
hi = elf_link_hash_lookup (elf_hash_table (info), name, TRUE,
FALSE, FALSE);
{
/* Here SHORTNAME is a versioned name, so we don't expect to see
the type of override we do in the case above unless it is
- overridden by a versioned definiton. */
+ overridden by a versioned definition. */
if (hi->root.type != bfd_link_hash_defined
&& hi->root.type != bfd_link_hash_defweak)
(*_bfd_error_handler)
will force it local. */
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0
&& eif->info->shared
- && is_elf_hash_table (eif->info)
+ && is_elf_hash_table (eif->info->hash)
&& (eif->info->symbolic
|| ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
bfd *dynobj;
const struct elf_backend_data *bed;
- if (! is_elf_hash_table (eif->info))
+ if (! is_elf_hash_table (eif->info->hash))
return FALSE;
if (h->root.type == bfd_link_hash_warning)
dynamic linker will resolve them locally. */
return local_protected;
}
+
+/* Caches some TLS segment info, and ensures that the TLS segment vma is
+ aligned. Returns the first TLS output section. */
+
+struct bfd_section *
+_bfd_elf_tls_setup (bfd *obfd, struct bfd_link_info *info)
+{
+ struct bfd_section *sec, *tls;
+ unsigned int align = 0;
+
+ for (sec = obfd->sections; sec != NULL; sec = sec->next)
+ if ((sec->flags & SEC_THREAD_LOCAL) != 0)
+ break;
+ tls = sec;
+
+ for (; sec != NULL && (sec->flags & SEC_THREAD_LOCAL) != 0; sec = sec->next)
+ if (sec->alignment_power > align)
+ align = sec->alignment_power;
+
+ elf_hash_table (info)->tls_sec = tls;
+
+ /* Ensure the alignment of the first section is the largest alignment,
+ so that the tls segment starts aligned. */
+ if (tls != NULL)
+ tls->alignment_power = align;
+
+ return tls;
+}