}
count = relplt->size / sizeof (Elf32_External_Rela);
- stub_vma = glink_vma - (bfd_vma) count * 16;
/* If the stubs are those for -shared/-pie then we might have
multiple stubs for each plt entry. If that is the case then
there is no way to associate stubs with their plt entries short
if (s == NULL)
return -1;
+ stub_vma = glink_vma;
names = (char *) (s + count + 1 + (resolv_vma != 0));
- p = relplt->relocation;
- for (i = 0; i < count; i++, p++)
+ p = relplt->relocation + count - 1;
+ for (i = 0; i < count; i++)
{
size_t len;
s->flags |= BSF_GLOBAL;
s->flags |= BSF_SYNTHETIC;
s->section = glink;
+ stub_vma -= 16;
+ if (strcmp ((*p->sym_ptr_ptr)->name, "__tls_get_addr_opt") == 0)
+ stub_vma -= 32;
s->value = stub_vma - glink->vma;
s->name = names;
s->udata.p = NULL;
memcpy (names, "@plt", sizeof ("@plt"));
names += sizeof ("@plt");
++s;
- stub_vma += 16;
+ --p;
}
/* Add a symbol at the start of the glink branch table. */
htab = ppc_elf_hash_table (info);
htab->tls_get_addr = elf_link_hash_lookup (&htab->elf, "__tls_get_addr",
FALSE, FALSE, TRUE);
+ if (htab->plt_type != PLT_NEW)
+ htab->params->no_tls_get_addr_opt = TRUE;
+
if (!htab->params->no_tls_get_addr_opt)
{
struct elf_link_hash_entry *opt, *tga;