+2018-08-07 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_relocate_section): Don't skip first
+ instruction of __tls_get_addr_opt stub.
+ (plt_stub_size): Omit ALWAYS_EMIT_R2SAVE condition when
+ dealing with __tls_get_addr_opt stub.
+ (build_tls_get_addr_stub, ppc_size_one_stub): Likewise.
+
2018-08-06 Claudiu Zissulescu <claziss@synopsys.com>
* elf32-arc.c (arc_elf_merge_private_bfd_data): Complain about
&& htab->params->tls_get_addr_opt)
{
size += 7 * 4;
- if (ALWAYS_EMIT_R2SAVE
- || stub_entry->stub_type == ppc_stub_plt_call_r2save)
+ if (stub_entry->stub_type == ppc_stub_plt_call_r2save)
size += 6 * 4;
}
return size;
bfd_put_32 (obfd, MR_R3_R0, p), p += 4;
if (r != NULL)
r[0].r_offset += 7 * 4;
- if (!ALWAYS_EMIT_R2SAVE
- && stub_entry->stub_type != ppc_stub_plt_call_r2save)
+ if (stub_entry->stub_type != ppc_stub_plt_call_r2save)
return build_plt_stub (htab, stub_entry, p, offset, r);
bfd_put_32 (obfd, MFLR_R11, p), p += 4;
&& (stub_entry->h == htab->tls_get_addr_fd
|| stub_entry->h == htab->tls_get_addr)
&& htab->params->tls_get_addr_opt
- && (ALWAYS_EMIT_R2SAVE
- || stub_entry->stub_type == ppc_stub_plt_call_r2save))
+ && stub_entry->stub_type == ppc_stub_plt_call_r2save)
stub_entry->group->tls_get_addr_opt_bctrl
= stub_entry->stub_offset + size - 5 * 4;
&& ALWAYS_EMIT_R2SAVE)
|| stub_entry->stub_type == ppc_stub_plt_call_r2save
|| stub_entry->stub_type == ppc_stub_plt_call_both)
+ && !(h != NULL
+ && (h == htab->tls_get_addr_fd
+ || h == htab->tls_get_addr)
+ && htab->params->tls_get_addr_opt)
&& rel + 1 < relend
&& rel[1].r_offset == rel->r_offset + 4
&& ELF64_R_TYPE (rel[1].r_info) == R_PPC64_TOCSAVE)