+2003-02-11 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (ppc64_elf_check_relocs): Match versioned
+ .__tls_get_addr too.
+ (ppc64_elf_tls_setup): Ensure cached tls_get_addr is not indirect.
+
2003-02-10 Kaz kojima <kkojima@rr.iij4u.or.jp>
* elf32-sh.c (elf_sh_dyn_relocs): Add tls_tpoff32 field.
return FALSE;
if (h == htab->tls_get_addr)
sec->has_tls_reloc = 1;
- else if (strcmp (h->root.root.string, ".__tls_get_addr") == 0)
+ else if ((strncmp (h->root.root.string, ".__tls_get_addr", 15)
+ == 0)
+ && (h->root.root.string[15] == 0
+ || h->root.root.string[15] == '@'))
{
htab->tls_get_addr = h;
sec->has_tls_reloc = 1;
htab = ppc_hash_table (info);
htab->tls_sec = tls;
+
+ if (htab->tls_get_addr != NULL)
+ {
+ struct elf_link_hash_entry *h = htab->tls_get_addr;
+
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+ htab->tls_get_addr = h;
+ }
+
return tls != NULL;
}