|
|
381f6c |
diff -rup binutils.orig/bfd/elf32-ppc.c binutils-2.30/bfd/elf32-ppc.c
|
|
|
381f6c |
--- binutils.orig/bfd/elf32-ppc.c 2018-02-08 10:49:07.649185371 +0000
|
|
|
381f6c |
+++ binutils-2.30/bfd/elf32-ppc.c 2018-02-08 10:50:11.058395459 +0000
|
|
|
381f6c |
@@ -69,7 +69,7 @@ static bfd_reloc_status_type ppc_elf_unh
|
|
|
381f6c |
/* For new-style .glink and .plt. */
|
|
|
381f6c |
#define GLINK_PLTRESOLVE 16*4
|
|
|
381f6c |
#define GLINK_ENTRY_SIZE(htab, h) \
|
|
|
381f6c |
- (((!htab->params->speculate_indirect_jumps ? 6*4 : 4*4) \
|
|
|
381f6c |
+ ((4*4 \
|
|
|
381f6c |
+ (h != NULL \
|
|
|
381f6c |
&& h == htab->tls_get_addr \
|
|
|
381f6c |
&& !htab->params->no_tls_get_addr_opt ? 8*4 : 0) \
|
|
|
381f6c |
@@ -155,8 +155,6 @@ static const bfd_vma ppc_elf_vxworks_pic
|
|
|
381f6c |
#define BA 0x48000002
|
|
|
381f6c |
#define BCL_20_31 0x429f0005
|
|
|
381f6c |
#define BCTR 0x4e800420
|
|
|
381f6c |
-#define CRSETEQ 0x4c421242
|
|
|
381f6c |
-#define BEQCTRM 0x4dc20420
|
|
|
381f6c |
#define BEQLR 0x4d820020
|
|
|
381f6c |
#define CMPWI_11_0 0x2c0b0000
|
|
|
381f6c |
#define LIS_11 0x3d600000
|
|
|
381f6c |
@@ -2880,14 +2878,15 @@ ppc_elf_final_write_processing (bfd *abf
|
|
|
381f6c |
static bfd_boolean
|
|
|
381f6c |
is_nonpic_glink_stub (bfd *abfd, asection *glink, bfd_vma off)
|
|
|
381f6c |
{
|
|
|
381f6c |
- bfd_byte buf[3 * 4];
|
|
|
381f6c |
+ bfd_byte buf[4 * 4];
|
|
|
381f6c |
|
|
|
381f6c |
if (!bfd_get_section_contents (abfd, glink, buf, off, sizeof buf))
|
|
|
381f6c |
return FALSE;
|
|
|
381f6c |
|
|
|
381f6c |
return ((bfd_get_32 (abfd, buf + 0) & 0xffff0000) == LIS_11
|
|
|
381f6c |
&& (bfd_get_32 (abfd, buf + 4) & 0xffff0000) == LWZ_11_11
|
|
|
381f6c |
- && bfd_get_32 (abfd, buf + 8) == MTCTR_11);
|
|
|
381f6c |
+ && bfd_get_32 (abfd, buf + 8) == MTCTR_11
|
|
|
381f6c |
+ && bfd_get_32 (abfd, buf + 12) == BCTR);
|
|
|
381f6c |
}
|
|
|
381f6c |
|
|
|
381f6c |
static bfd_boolean
|
|
|
381f6c |
@@ -3366,7 +3365,7 @@ ppc_elf_link_hash_table_create (bfd *abf
|
|
|
381f6c |
{
|
|
|
381f6c |
struct ppc_elf_link_hash_table *ret;
|
|
|
381f6c |
static struct ppc_elf_params default_params
|
|
|
381f6c |
- = { PLT_OLD, 0, 1, 0, 1, 0, 0, 12, 0, 0, 0 };
|
|
|
381f6c |
+ = { PLT_OLD, 0, 0, 1, 0, 0, 12, 0, 0, 0 };
|
|
|
381f6c |
|
|
|
381f6c |
ret = bfd_zmalloc (sizeof (struct ppc_elf_link_hash_table));
|
|
|
381f6c |
if (ret == NULL)
|
|
|
381f6c |
@@ -7171,8 +7170,6 @@ ppc_elf_relax_section (bfd *abfd,
|
|
|
381f6c |
size = 4 * ARRAY_SIZE (stub_entry);
|
|
|
381f6c |
insn_offset = 0;
|
|
|
381f6c |
}
|
|
|
381f6c |
- if (!htab->params->speculate_indirect_jumps)
|
|
|
381f6c |
- size += 8;
|
|
|
381f6c |
stub_rtype = R_PPC_RELAX;
|
|
|
381f6c |
if (tsec == htab->elf.splt
|
|
|
381f6c |
|| tsec == htab->glink)
|
|
|
381f6c |
@@ -7454,26 +7451,6 @@ elf_finish_pointer_linker_section (bfd *
|
|
|
381f6c |
#define PPC_HI(v) (((v) >> 16) & 0xffff)
|
|
|
381f6c |
#define PPC_HA(v) PPC_HI ((v) + 0x8000)
|
|
|
381f6c |
|
|
|
381f6c |
-static inline bfd_byte *
|
|
|
381f6c |
-output_bctr (struct ppc_elf_link_hash_table *htab, bfd *obfd, bfd_byte *p)
|
|
|
381f6c |
-{
|
|
|
381f6c |
- if (!htab->params->speculate_indirect_jumps)
|
|
|
381f6c |
- {
|
|
|
381f6c |
- bfd_put_32 (obfd, CRSETEQ, p);
|
|
|
381f6c |
- p += 4;
|
|
|
381f6c |
- bfd_put_32 (obfd, BEQCTRM, p);
|
|
|
381f6c |
- p += 4;
|
|
|
381f6c |
- bfd_put_32 (obfd, B, p);
|
|
|
381f6c |
- p += 4;
|
|
|
381f6c |
- }
|
|
|
381f6c |
- else
|
|
|
381f6c |
- {
|
|
|
381f6c |
- bfd_put_32 (obfd, BCTR, p);
|
|
|
381f6c |
- p += 4;
|
|
|
381f6c |
- }
|
|
|
381f6c |
- return p;
|
|
|
381f6c |
-}
|
|
|
381f6c |
-
|
|
|
381f6c |
static void
|
|
|
381f6c |
write_glink_stub (struct elf_link_hash_entry *h, struct plt_entry *ent,
|
|
|
381f6c |
asection *plt_sec, unsigned char *p,
|
|
|
381f6c |
@@ -7541,7 +7518,8 @@ write_glink_stub (struct elf_link_hash_e
|
|
|
381f6c |
p += 4;
|
|
|
381f6c |
bfd_put_32 (output_bfd, MTCTR_11, p);
|
|
|
381f6c |
p += 4;
|
|
|
381f6c |
- p = output_bctr (htab, output_bfd, p);
|
|
|
381f6c |
+ bfd_put_32 (output_bfd, BCTR, p);
|
|
|
381f6c |
+ p += 4;
|
|
|
381f6c |
while (p < end)
|
|
|
381f6c |
{
|
|
|
381f6c |
bfd_put_32 (output_bfd, htab->params->ppc476_workaround ? BA : NOP, p);
|
|
|
381f6c |
@@ -8979,7 +8957,6 @@ ppc_elf_relocate_section (bfd *output_bf
|
|
|
381f6c |
stub = stub_entry;
|
|
|
381f6c |
size = ARRAY_SIZE (stub_entry);
|
|
|
381f6c |
}
|
|
|
381f6c |
- --size;
|
|
|
381f6c |
|
|
|
381f6c |
relocation += addend;
|
|
|
381f6c |
if (bfd_link_relocatable (info))
|
|
|
381f6c |
@@ -9004,7 +8981,6 @@ ppc_elf_relocate_section (bfd *output_bf
|
|
|
381f6c |
bfd_put_32 (input_bfd, insn, contents + insn_offset);
|
|
|
381f6c |
insn_offset += 4;
|
|
|
381f6c |
}
|
|
|
381f6c |
- output_bctr (htab, input_bfd, contents + insn_offset);
|
|
|
381f6c |
|
|
|
381f6c |
/* Rewrite the reloc and convert one of the trailing nop
|
|
|
381f6c |
relocs to describe this relocation. */
|
|
|
381f6c |
@@ -10713,7 +10689,8 @@ ppc_elf_finish_dynamic_sections (bfd *ou
|
|
|
381f6c |
p += 4;
|
|
|
381f6c |
bfd_put_32 (output_bfd, ADD_11_0_11, p);
|
|
|
381f6c |
p += 4;
|
|
|
381f6c |
- p = output_bctr (htab, output_bfd, p);
|
|
|
381f6c |
+ bfd_put_32 (output_bfd, BCTR, p);
|
|
|
381f6c |
+ p += 4;
|
|
|
381f6c |
while (p < endp)
|
|
|
381f6c |
{
|
|
|
381f6c |
bfd_put_32 (output_bfd,
|
|
|
381f6c |
diff -rup binutils.orig/bfd/elf32-ppc.h binutils-2.30/bfd/elf32-ppc.h
|
|
|
381f6c |
--- binutils.orig/bfd/elf32-ppc.h 2018-02-08 10:49:07.644185433 +0000
|
|
|
381f6c |
+++ binutils-2.30/bfd/elf32-ppc.h 2018-02-08 10:50:11.058395459 +0000
|
|
|
381f6c |
@@ -35,9 +35,6 @@ struct ppc_elf_params
|
|
|
381f6c |
/* Set if individual PLT call stubs should be aligned. */
|
|
|
381f6c |
int plt_stub_align;
|
|
|
381f6c |
|
|
|
381f6c |
- /* Clear if PLT call stubs should use a speculative execution barrier. */
|
|
|
381f6c |
- int speculate_indirect_jumps;
|
|
|
381f6c |
-
|
|
|
381f6c |
/* Whether to emit symbols for stubs. */
|
|
|
381f6c |
int emit_stub_syms;
|
|
|
381f6c |
|
|
|
381f6c |
diff -rup binutils.orig/bfd/elf64-ppc.c binutils-2.30/bfd/elf64-ppc.c
|
|
|
381f6c |
--- binutils.orig/bfd/elf64-ppc.c 2018-02-08 10:49:07.645185421 +0000
|
|
|
381f6c |
+++ binutils-2.30/bfd/elf64-ppc.c 2018-02-08 10:50:11.060395434 +0000
|
|
|
381f6c |
@@ -161,10 +161,6 @@ static bfd_vma opd_entry_value
|
|
|
381f6c |
#define LD_R11_0R11 0xe96b0000 /* ld %r11,xxx+16@l(%r11) */
|
|
|
381f6c |
#define BCTR 0x4e800420 /* bctr */
|
|
|
381f6c |
|
|
|
381f6c |
-#define CRSETEQ 0x4c421242 /* crset 4*%cr0+%eq */
|
|
|
381f6c |
-#define BEQCTRM 0x4dc20420 /* beqctr- */
|
|
|
381f6c |
-#define BEQCTRLM 0x4dc20421 /* beqctrl- */
|
|
|
381f6c |
-
|
|
|
381f6c |
#define ADDI_R11_R11 0x396b0000 /* addi %r11,%r11,off@l */
|
|
|
381f6c |
#define ADDIS_R2_R2 0x3c420000 /* addis %r2,%r2,off@ha */
|
|
|
381f6c |
#define ADDI_R2_R2 0x38420000 /* addi %r2,%r2,off@l */
|
|
|
381f6c |
@@ -193,8 +189,7 @@ static bfd_vma opd_entry_value
|
|
|
381f6c |
|
|
|
381f6c |
/* __glink_PLTresolve stub instructions. We enter with the index in R0. */
|
|
|
381f6c |
#define GLINK_PLTRESOLVE_SIZE(htab) \
|
|
|
381f6c |
- (8u + (htab->opd_abi ? 11 * 4 : 14 * 4) \
|
|
|
381f6c |
- + (!htab->params->speculate_indirect_jumps ? 2 * 4 : 0))
|
|
|
381f6c |
+ (8u + (htab->opd_abi ? 11 * 4 : 14 * 4))
|
|
|
381f6c |
/* 0: */
|
|
|
381f6c |
/* .quad plt0-1f */
|
|
|
381f6c |
/* __glink: */
|
|
|
381f6c |
@@ -9886,8 +9881,6 @@ size_global_entry_stubs (struct elf_link
|
|
|
381f6c |
unsigned int align_power;
|
|
|
381f6c |
|
|
|
381f6c |
stub_size = 16;
|
|
|
381f6c |
- if (!htab->params->speculate_indirect_jumps)
|
|
|
381f6c |
- stub_size += 8;
|
|
|
381f6c |
stub_off = s->size;
|
|
|
381f6c |
if (htab->params->plt_stub_align >= 0)
|
|
|
381f6c |
align_power = htab->params->plt_stub_align;
|
|
|
381f6c |
@@ -10453,8 +10446,6 @@ plt_stub_size (struct ppc_link_hash_tabl
|
|
|
381f6c |
size += 4;
|
|
|
381f6c |
if (PPC_HA (off) != 0)
|
|
|
381f6c |
size += 4;
|
|
|
381f6c |
- if (!htab->params->speculate_indirect_jumps)
|
|
|
381f6c |
- size += 8;
|
|
|
381f6c |
if (htab->opd_abi)
|
|
|
381f6c |
{
|
|
|
381f6c |
size += 4;
|
|
|
381f6c |
@@ -10476,11 +10467,7 @@ plt_stub_size (struct ppc_link_hash_tabl
|
|
|
381f6c |
size += 7 * 4;
|
|
|
381f6c |
if (ALWAYS_EMIT_R2SAVE
|
|
|
381f6c |
|| stub_entry->stub_type == ppc_stub_plt_call_r2save)
|
|
|
381f6c |
- {
|
|
|
381f6c |
- size += 6 * 4;
|
|
|
381f6c |
- if (!htab->params->speculate_indirect_jumps)
|
|
|
381f6c |
- size -= 4;
|
|
|
381f6c |
- }
|
|
|
381f6c |
+ size += 6 * 4;
|
|
|
381f6c |
}
|
|
|
381f6c |
return size;
|
|
|
381f6c |
}
|
|
|
381f6c |
@@ -10515,26 +10502,6 @@ plt_stub_pad (struct ppc_link_hash_table
|
|
|
381f6c |
return 0;
|
|
|
381f6c |
}
|
|
|
381f6c |
|
|
|
381f6c |
-static inline bfd_byte *
|
|
|
381f6c |
-output_bctr (struct ppc_link_hash_table *htab, bfd *obfd, bfd_byte *p)
|
|
|
381f6c |
-{
|
|
|
381f6c |
- if (!htab->params->speculate_indirect_jumps)
|
|
|
381f6c |
- {
|
|
|
381f6c |
- bfd_put_32 (obfd, CRSETEQ, p);
|
|
|
381f6c |
- p += 4;
|
|
|
381f6c |
- bfd_put_32 (obfd, BEQCTRM, p);
|
|
|
381f6c |
- p += 4;
|
|
|
381f6c |
- bfd_put_32 (obfd, B_DOT, p);
|
|
|
381f6c |
- p += 4;
|
|
|
381f6c |
- }
|
|
|
381f6c |
- else
|
|
|
381f6c |
- {
|
|
|
381f6c |
- bfd_put_32 (obfd, BCTR, p);
|
|
|
381f6c |
- p += 4;
|
|
|
381f6c |
- }
|
|
|
381f6c |
- return p;
|
|
|
381f6c |
-}
|
|
|
381f6c |
-
|
|
|
381f6c |
/* Build a .plt call stub. */
|
|
|
381f6c |
|
|
|
381f6c |
static inline bfd_byte *
|
|
|
381f6c |
@@ -10555,7 +10522,6 @@ build_plt_stub (struct ppc_link_hash_tab
|
|
|
381f6c |
if (!ALWAYS_USE_FAKE_DEP
|
|
|
381f6c |
&& plt_load_toc
|
|
|
381f6c |
&& plt_thread_safe
|
|
|
381f6c |
- && htab->params->speculate_indirect_jumps
|
|
|
381f6c |
&& !((stub_entry->h == htab->tls_get_addr_fd
|
|
|
381f6c |
|| stub_entry->h == htab->tls_get_addr)
|
|
|
381f6c |
&& htab->params->tls_get_addr_opt))
|
|
|
381f6c |
@@ -10710,7 +10676,7 @@ build_plt_stub (struct ppc_link_hash_tab
|
|
|
381f6c |
bfd_put_32 (obfd, B_DOT | (cmp_branch_off & 0x3fffffc), p), p += 4;
|
|
|
381f6c |
}
|
|
|
381f6c |
else
|
|
|
381f6c |
- p = output_bctr (htab, obfd, p);
|
|
|
381f6c |
+ bfd_put_32 (obfd, BCTR, p), p += 4;
|
|
|
381f6c |
return p;
|
|
|
381f6c |
}
|
|
|
381f6c |
|
|
|
381f6c |
@@ -10754,13 +10720,7 @@ build_tls_get_addr_stub (struct ppc_link
|
|
|
381f6c |
if (r != NULL)
|
|
|
381f6c |
r[0].r_offset += 2 * 4;
|
|
|
381f6c |
p = build_plt_stub (htab, stub_entry, p, offset, r);
|
|
|
381f6c |
- if (!htab->params->speculate_indirect_jumps)
|
|
|
381f6c |
- {
|
|
|
381f6c |
- p -= 4;
|
|
|
381f6c |
- bfd_put_32 (obfd, BEQCTRLM, p - 4);
|
|
|
381f6c |
- }
|
|
|
381f6c |
- else
|
|
|
381f6c |
- bfd_put_32 (obfd, BCTRL, p - 4);
|
|
|
381f6c |
+ bfd_put_32 (obfd, BCTRL, p - 4);
|
|
|
381f6c |
|
|
|
381f6c |
bfd_put_32 (obfd, LD_R2_0R1 + STK_TOC (htab), p), p += 4;
|
|
|
381f6c |
bfd_put_32 (obfd, LD_R11_0R1 + STK_LINKER (htab), p), p += 4;
|
|
|
381f6c |
@@ -11113,7 +11073,8 @@ ppc_build_one_stub (struct bfd_hash_entr
|
|
|
381f6c |
p += 4;
|
|
|
381f6c |
bfd_put_32 (htab->params->stub_bfd, MTCTR_R12, p);
|
|
|
381f6c |
p += 4;
|
|
|
381f6c |
- p = output_bctr (htab, htab->params->stub_bfd, p);
|
|
|
381f6c |
+ bfd_put_32 (htab->params->stub_bfd, BCTR, p);
|
|
|
381f6c |
+ p += 4;
|
|
|
381f6c |
break;
|
|
|
381f6c |
|
|
|
381f6c |
case ppc_stub_plt_call:
|
|
|
381f6c |
@@ -11446,8 +11407,6 @@ ppc_size_one_stub (struct bfd_hash_entry
|
|
|
381f6c |
if (PPC_LO (r2off) != 0)
|
|
|
381f6c |
size += 4;
|
|
|
381f6c |
}
|
|
|
381f6c |
- if (!htab->params->speculate_indirect_jumps)
|
|
|
381f6c |
- size += 8;
|
|
|
381f6c |
}
|
|
|
381f6c |
else if (info->emitrelocations)
|
|
|
381f6c |
{
|
|
|
381f6c |
@@ -13089,7 +13048,7 @@ build_global_entry_stubs (struct elf_lin
|
|
|
381f6c |
p += 4;
|
|
|
381f6c |
bfd_put_32 (s->owner, MTCTR_R12, p);
|
|
|
381f6c |
p += 4;
|
|
|
381f6c |
- output_bctr (htab, s->owner, p);
|
|
|
381f6c |
+ bfd_put_32 (s->owner, BCTR, p);
|
|
|
381f6c |
break;
|
|
|
381f6c |
}
|
|
|
381f6c |
return TRUE;
|
|
|
381f6c |
@@ -13218,7 +13177,8 @@ ppc64_elf_build_stubs (struct bfd_link_i
|
|
|
381f6c |
bfd_put_32 (htab->glink->owner, LD_R11_0R11 | 8, p);
|
|
|
381f6c |
p += 4;
|
|
|
381f6c |
}
|
|
|
381f6c |
- p = output_bctr (htab, htab->glink->owner, p);
|
|
|
381f6c |
+ bfd_put_32 (htab->glink->owner, BCTR, p);
|
|
|
381f6c |
+ p += 4;
|
|
|
381f6c |
BFD_ASSERT (p == htab->glink->contents + GLINK_PLTRESOLVE_SIZE (htab));
|
|
|
381f6c |
|
|
|
381f6c |
/* Build the .glink lazy link call stubs. */
|
|
|
381f6c |
diff -rup binutils.orig/bfd/elf64-ppc.h binutils-2.30/bfd/elf64-ppc.h
|
|
|
381f6c |
--- binutils.orig/bfd/elf64-ppc.h 2018-02-08 10:49:07.637185520 +0000
|
|
|
381f6c |
+++ binutils-2.30/bfd/elf64-ppc.h 2018-02-08 10:50:11.060395434 +0000
|
|
|
381f6c |
@@ -51,9 +51,6 @@ struct ppc64_elf_params
|
|
|
381f6c |
/* Set if PLT call stubs for localentry:0 functions should omit r2 save. */
|
|
|
381f6c |
int plt_localentry0;
|
|
|
381f6c |
|
|
|
381f6c |
- /* Clear if PLT call stubs should use a speculative execution barrier. */
|
|
|
381f6c |
- int speculate_indirect_jumps;
|
|
|
381f6c |
-
|
|
|
381f6c |
/* Whether to canonicalize .opd so that there are no overlapping
|
|
|
381f6c |
.opd entries. */
|
|
|
381f6c |
int non_overlapping_opd;
|
|
|
381f6c |
diff -rup binutils.orig/gold/options.h binutils-2.30/gold/options.h
|
|
|
381f6c |
--- binutils.orig/gold/options.h 2018-02-08 10:49:07.354189045 +0000
|
|
|
381f6c |
+++ binutils-2.30/gold/options.h 2018-02-08 10:50:11.060395434 +0000
|
|
|
381f6c |
@@ -1108,10 +1108,6 @@ class General_options
|
|
|
381f6c |
N_("(PowerPC64 only) Optimize calls to ELFv2 localentry:0 functions"),
|
|
|
381f6c |
N_("(PowerPC64 only) Don't optimize ELFv2 calls"));
|
|
|
381f6c |
|
|
|
381f6c |
- DEFINE_bool(speculate_indirect_jumps, options::TWO_DASHES, '\0', true,
|
|
|
381f6c |
- N_("(PowerPC only) PLT call stubs without speculation barrier"),
|
|
|
381f6c |
- N_("(PowerPC only) PLT call stubs with speculation barrier"));
|
|
|
381f6c |
-
|
|
|
381f6c |
DEFINE_bool(plt_static_chain, options::TWO_DASHES, '\0', false,
|
|
|
381f6c |
N_("(PowerPC64 only) PLT call stubs should load r11"),
|
|
|
381f6c |
N_("(PowerPC64 only) PLT call stubs should not load r11"));
|
|
|
381f6c |
diff -rup binutils.orig/gold/powerpc.cc binutils-2.30/gold/powerpc.cc
|
|
|
381f6c |
--- binutils.orig/gold/powerpc.cc 2018-02-08 10:49:07.355189033 +0000
|
|
|
381f6c |
+++ binutils-2.30/gold/powerpc.cc 2018-02-08 10:50:11.061395422 +0000
|
|
|
381f6c |
@@ -3781,8 +3781,6 @@ static const uint32_t b = 0x48000000;
|
|
|
381f6c |
static const uint32_t bcl_20_31 = 0x429f0005;
|
|
|
381f6c |
static const uint32_t bctr = 0x4e800420;
|
|
|
381f6c |
static const uint32_t bctrl = 0x4e800421;
|
|
|
381f6c |
-static const uint32_t beqctrm = 0x4dc20420;
|
|
|
381f6c |
-static const uint32_t beqctrlm = 0x4dc20421;
|
|
|
381f6c |
static const uint32_t beqlr = 0x4d820020;
|
|
|
381f6c |
static const uint32_t blr = 0x4e800020;
|
|
|
381f6c |
static const uint32_t bnectr_p4 = 0x4ce20420;
|
|
|
381f6c |
@@ -3792,7 +3790,6 @@ static const uint32_t cmpdi_11_0 = 0x2c2
|
|
|
381f6c |
static const uint32_t cmpwi_11_0 = 0x2c0b0000;
|
|
|
381f6c |
static const uint32_t cror_15_15_15 = 0x4def7b82;
|
|
|
381f6c |
static const uint32_t cror_31_31_31 = 0x4ffffb82;
|
|
|
381f6c |
-static const uint32_t crseteq = 0x4c421242;
|
|
|
381f6c |
static const uint32_t ld_0_1 = 0xe8010000;
|
|
|
381f6c |
static const uint32_t ld_0_12 = 0xe80c0000;
|
|
|
381f6c |
static const uint32_t ld_2_1 = 0xe8410000;
|
|
|
381f6c |
@@ -4168,24 +4165,6 @@ write_insn(unsigned char* p, uint32_t v)
|
|
|
381f6c |
elfcpp::Swap<32, big_endian>::writeval(p, v);
|
|
|
381f6c |
}
|
|
|
381f6c |
|
|
|
381f6c |
-template<bool big_endian>
|
|
|
381f6c |
-static unsigned char*
|
|
|
381f6c |
-output_bctr(unsigned char* p)
|
|
|
381f6c |
-{
|
|
|
381f6c |
- if (!parameters->options().speculate_indirect_jumps())
|
|
|
381f6c |
- {
|
|
|
381f6c |
- write_insn<big_endian>(p, crseteq);
|
|
|
381f6c |
- p += 4;
|
|
|
381f6c |
- write_insn<big_endian>(p, beqctrm);
|
|
|
381f6c |
- p += 4;
|
|
|
381f6c |
- write_insn<big_endian>(p, b);
|
|
|
381f6c |
- }
|
|
|
381f6c |
- else
|
|
|
381f6c |
- write_insn<big_endian>(p, bctr);
|
|
|
381f6c |
- p += 4;
|
|
|
381f6c |
- return p;
|
|
|
381f6c |
-}
|
|
|
381f6c |
-
|
|
|
381f6c |
template<int size>
|
|
|
381f6c |
static inline unsigned int
|
|
|
381f6c |
param_plt_align()
|
|
|
381f6c |
@@ -4454,7 +4433,6 @@ class Stub_table : public Output_relaxed
|
|
|
381f6c |
{
|
|
|
381f6c |
const Symbol* gsym = p->first.sym_;
|
|
|
381f6c |
return (4 * 4
|
|
|
381f6c |
- + (!parameters->options().speculate_indirect_jumps() ? 2 * 4 : 0)
|
|
|
381f6c |
+ (this->targ_->is_tls_get_addr_opt(gsym) ? 8 * 4 : 0));
|
|
|
381f6c |
}
|
|
|
381f6c |
|
|
|
381f6c |
@@ -4470,8 +4448,6 @@ class Stub_table : public Output_relaxed
|
|
|
381f6c |
got_addr += ppcobj->toc_base_offset();
|
|
|
381f6c |
Address off = plt_addr - got_addr;
|
|
|
381f6c |
unsigned int bytes = 4 * 4 + 4 * (ha(off) != 0);
|
|
|
381f6c |
- if (!parameters->options().speculate_indirect_jumps())
|
|
|
381f6c |
- bytes += 2 * 4;
|
|
|
381f6c |
const Symbol* gsym = p->first.sym_;
|
|
|
381f6c |
if (this->targ_->is_tls_get_addr_opt(gsym))
|
|
|
381f6c |
bytes += 13 * 4;
|
|
|
381f6c |
@@ -4502,8 +4478,6 @@ class Stub_table : public Output_relaxed
|
|
|
381f6c |
if (p->first.dest_ - loc + (1 << 25) < 2 << 25)
|
|
|
381f6c |
return 4;
|
|
|
381f6c |
unsigned int bytes = 16;
|
|
|
381f6c |
- if (!parameters->options().speculate_indirect_jumps())
|
|
|
381f6c |
- bytes += 8;
|
|
|
381f6c |
if (size == 32 && parameters->options().output_is_position_independent())
|
|
|
381f6c |
bytes += 16;
|
|
|
381f6c |
return bytes;
|
|
|
381f6c |
@@ -4955,8 +4929,7 @@ class Output_data_glink : public Output_
|
|
|
381f6c |
{
|
|
|
381f6c |
if (size == 64)
|
|
|
381f6c |
return (8
|
|
|
381f6c |
- + (this->targ_->abiversion() < 2 ? 11 * 4 : 14 * 4)
|
|
|
381f6c |
- + (!parameters->options().speculate_indirect_jumps() ? 2 * 4 : 0));
|
|
|
381f6c |
+ + (this->targ_->abiversion() < 2 ? 11 * 4 : 14 * 4));
|
|
|
381f6c |
return 16 * 4;
|
|
|
381f6c |
}
|
|
|
381f6c |
|
|
|
381f6c |
@@ -5033,8 +5006,7 @@ Output_data_glink<size, big_endian>::add
|
|
|
381f6c |
std::pair<typename Global_entry_stub_entries::iterator, bool> p
|
|
|
381f6c |
= this->global_entry_stubs_.insert(std::make_pair(gsym, off));
|
|
|
381f6c |
if (p.second)
|
|
|
381f6c |
- this->ge_size_
|
|
|
381f6c |
- = off + 16 + (!parameters->options().speculate_indirect_jumps() ? 8 : 0);
|
|
|
381f6c |
+ this->ge_size_ = off + 16;
|
|
|
381f6c |
}
|
|
|
381f6c |
|
|
|
381f6c |
template<int size, bool big_endian>
|
|
|
381f6c |
@@ -5223,10 +5195,7 @@ Stub_table<size, big_endian>::do_write(O
|
|
|
381f6c |
= plt_load_toc && this->targ_->plt_thread_safe();
|
|
|
381f6c |
bool use_fake_dep = false;
|
|
|
381f6c |
Address cmp_branch_off = 0;
|
|
|
381f6c |
- if (thread_safe
|
|
|
381f6c |
- && !parameters->options().speculate_indirect_jumps())
|
|
|
381f6c |
- use_fake_dep = true;
|
|
|
381f6c |
- else if (thread_safe)
|
|
|
381f6c |
+ if (thread_safe)
|
|
|
381f6c |
{
|
|
|
381f6c |
unsigned int pltindex
|
|
|
381f6c |
= ((pltoff - this->targ_->first_plt_entry_offset())
|
|
|
381f6c |
@@ -5274,7 +5243,7 @@ Stub_table<size, big_endian>::do_write(O
|
|
|
381f6c |
+ this->targ_->stk_linker()));
|
|
|
381f6c |
p += 4;
|
|
|
381f6c |
}
|
|
|
381f6c |
- use_fake_dep |= thread_safe;
|
|
|
381f6c |
+ use_fake_dep = thread_safe;
|
|
|
381f6c |
}
|
|
|
381f6c |
if (ha(off) != 0)
|
|
|
381f6c |
{
|
|
|
381f6c |
@@ -5365,14 +5334,7 @@ Stub_table<size, big_endian>::do_write(O
|
|
|
381f6c |
if (!cs->second.localentry0_
|
|
|
381f6c |
&& this->targ_->is_tls_get_addr_opt(gsym))
|
|
|
381f6c |
{
|
|
|
381f6c |
- if (!parameters->options().speculate_indirect_jumps())
|
|
|
381f6c |
- {
|
|
|
381f6c |
- write_insn<big_endian>(p, crseteq);
|
|
|
381f6c |
- p += 4;
|
|
|
381f6c |
- write_insn<big_endian>(p, beqctrlm);
|
|
|
381f6c |
- }
|
|
|
381f6c |
- else
|
|
|
381f6c |
- write_insn<big_endian>(p, bctrl);
|
|
|
381f6c |
+ write_insn<big_endian>(p, bctrl);
|
|
|
381f6c |
p += 4;
|
|
|
381f6c |
write_insn<big_endian>(p, ld_2_1 + this->targ_->stk_toc());
|
|
|
381f6c |
p += 4;
|
|
|
381f6c |
@@ -5391,7 +5353,7 @@ Stub_table<size, big_endian>::do_write(O
|
|
|
381f6c |
write_insn<big_endian>(p, b | (cmp_branch_off & 0x3fffffc));
|
|
|
381f6c |
}
|
|
|
381f6c |
else
|
|
|
381f6c |
- output_bctr<big_endian>(p);
|
|
|
381f6c |
+ write_insn<big_endian>(p, bctr);
|
|
|
381f6c |
}
|
|
|
381f6c |
}
|
|
|
381f6c |
|
|
|
381f6c |
@@ -5426,7 +5388,7 @@ Stub_table<size, big_endian>::do_write(O
|
|
|
381f6c |
write_insn<big_endian>(p, ld_12_12 + l(brltoff)), p += 4;
|
|
|
381f6c |
}
|
|
|
381f6c |
write_insn<big_endian>(p, mtctr_12), p += 4;
|
|
|
381f6c |
- output_bctr<big_endian>(p);
|
|
|
381f6c |
+ write_insn<big_endian>(p, bctr);
|
|
|
381f6c |
}
|
|
|
381f6c |
}
|
|
|
381f6c |
}
|
|
|
381f6c |
@@ -5522,7 +5484,7 @@ Stub_table<size, big_endian>::do_write(O
|
|
|
381f6c |
p += 4;
|
|
|
381f6c |
write_insn<big_endian>(p, mtctr_11);
|
|
|
381f6c |
p += 4;
|
|
|
381f6c |
- output_bctr<big_endian>(p);
|
|
|
381f6c |
+ write_insn<big_endian>(p, bctr);
|
|
|
381f6c |
}
|
|
|
381f6c |
}
|
|
|
381f6c |
|
|
|
381f6c |
@@ -5563,7 +5525,7 @@ Stub_table<size, big_endian>::do_write(O
|
|
|
381f6c |
p += 4;
|
|
|
381f6c |
write_insn<big_endian>(p, mtctr_12);
|
|
|
381f6c |
p += 4;
|
|
|
381f6c |
- output_bctr<big_endian>(p);
|
|
|
381f6c |
+ write_insn<big_endian>(p, bctr);
|
|
|
381f6c |
}
|
|
|
381f6c |
}
|
|
|
381f6c |
if (this->need_save_res_)
|
|
|
381f6c |
@@ -5630,7 +5592,7 @@ Output_data_glink<size, big_endian>::do_
|
|
|
381f6c |
write_insn<big_endian>(p, mtctr_12), p += 4;
|
|
|
381f6c |
write_insn<big_endian>(p, ld_11_11 + 8), p += 4;
|
|
|
381f6c |
}
|
|
|
381f6c |
- p = output_bctr<big_endian>(p);
|
|
|
381f6c |
+ write_insn<big_endian>(p, bctr), p += 4;
|
|
|
381f6c |
gold_assert(p == oview + this->pltresolve_size());
|
|
|
381f6c |
|
|
|
381f6c |
// Write lazy link call stubs.
|
|
|
381f6c |
@@ -5686,7 +5648,7 @@ Output_data_glink<size, big_endian>::do_
|
|
|
381f6c |
write_insn<big_endian>(p, addis_12_12 + ha(off)), p += 4;
|
|
|
381f6c |
write_insn<big_endian>(p, ld_12_12 + l(off)), p += 4;
|
|
|
381f6c |
write_insn<big_endian>(p, mtctr_12), p += 4;
|
|
|
381f6c |
- output_bctr<big_endian>(p);
|
|
|
381f6c |
+ write_insn<big_endian>(p, bctr);
|
|
|
381f6c |
}
|
|
|
381f6c |
}
|
|
|
381f6c |
else
|
|
|
381f6c |
@@ -5778,7 +5740,8 @@ Output_data_glink<size, big_endian>::do_
|
|
|
381f6c |
write_insn<big_endian>(p, add_11_0_11);
|
|
|
381f6c |
}
|
|
|
381f6c |
p += 4;
|
|
|
381f6c |
- p = output_bctr<big_endian>(p);
|
|
|
381f6c |
+ write_insn<big_endian>(p, bctr);
|
|
|
381f6c |
+ p += 4;
|
|
|
381f6c |
while (p < end_p)
|
|
|
381f6c |
{
|
|
|
381f6c |
write_insn<big_endian>(p, nop);
|
|
|
381f6c |
diff -rup binutils.orig/ld/emultempl/ppc32elf.em binutils-2.30/ld/emultempl/ppc32elf.em
|
|
|
381f6c |
--- binutils.orig/ld/emultempl/ppc32elf.em 2018-02-08 10:49:07.192191063 +0000
|
|
|
381f6c |
+++ binutils-2.30/ld/emultempl/ppc32elf.em 2018-02-08 10:50:11.062395410 +0000
|
|
|
381f6c |
@@ -38,7 +38,7 @@ static int notlsopt = 0;
|
|
|
381f6c |
/* Choose the correct place for .got. */
|
|
|
381f6c |
static int old_got = 0;
|
|
|
381f6c |
|
|
|
381f6c |
-static struct ppc_elf_params params = { PLT_UNSET, 0, 1, -1,
|
|
|
381f6c |
+static struct ppc_elf_params params = { PLT_UNSET, 0, -1,
|
|
|
381f6c |
0, 0, 0, 0, 0, 0, 0 };
|
|
|
381f6c |
|
|
|
381f6c |
static void
|
|
|
381f6c |
@@ -246,8 +246,6 @@ enum ppc32_opt
|
|
|
381f6c |
OPTION_NO_TLS_GET_ADDR_OPT,
|
|
|
381f6c |
OPTION_NEW_PLT,
|
|
|
381f6c |
OPTION_OLD_PLT,
|
|
|
381f6c |
- OPTION_SPECULATE_INDIRECT_JUMPS,
|
|
|
381f6c |
- OPTION_NO_SPECULATE_INDIRECT_JUMPS,
|
|
|
381f6c |
OPTION_PLT_ALIGN,
|
|
|
381f6c |
OPTION_NO_PLT_ALIGN,
|
|
|
381f6c |
OPTION_OLD_GOT,
|
|
|
381f6c |
@@ -269,8 +267,6 @@ if test -z "$VXWORKS_BASE_EM_FILE" ; the
|
|
|
381f6c |
PARSE_AND_LIST_LONGOPTS=${PARSE_AND_LIST_LONGOPTS}'
|
|
|
381f6c |
{ "secure-plt", no_argument, NULL, OPTION_NEW_PLT },
|
|
|
381f6c |
{ "bss-plt", no_argument, NULL, OPTION_OLD_PLT },
|
|
|
381f6c |
- { "speculate-indirect-jumps", no_argument, NULL, OPTION_SPECULATE_INDIRECT_JUMPS },
|
|
|
381f6c |
- { "no-speculate-indirect-jumps", no_argument, NULL, OPTION_NO_SPECULATE_INDIRECT_JUMPS },
|
|
|
381f6c |
{ "plt-align", optional_argument, NULL, OPTION_PLT_ALIGN },
|
|
|
381f6c |
{ "no-plt-align", no_argument, NULL, OPTION_NO_PLT_ALIGN },
|
|
|
381f6c |
{ "sdata-got", no_argument, NULL, OPTION_OLD_GOT },'
|
|
|
381f6c |
@@ -304,12 +300,6 @@ if test -z "$VXWORKS_BASE_EM_FILE" ; the
|
|
|
381f6c |
--bss-plt Force old-style BSS PLT.\n"
|
|
|
381f6c |
));
|
|
|
381f6c |
fprintf (file, _("\
|
|
|
381f6c |
- --speculate-indirect-jumps PLT call stubs without speculation barrier.\n"
|
|
|
381f6c |
- ));
|
|
|
381f6c |
- fprintf (file, _("\
|
|
|
381f6c |
- --no-speculate-indirect-jumps PLT call stubs with speculation barrier.\n"
|
|
|
381f6c |
- ));
|
|
|
381f6c |
- fprintf (file, _("\
|
|
|
381f6c |
--plt-align Align PLT call stubs to fit cache lines.\n"
|
|
|
381f6c |
));
|
|
|
381f6c |
fprintf (file, _("\
|
|
|
381f6c |
@@ -360,14 +350,6 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LI
|
|
|
381f6c |
params.plt_style = PLT_OLD;
|
|
|
381f6c |
break;
|
|
|
381f6c |
|
|
|
381f6c |
- case OPTION_SPECULATE_INDIRECT_JUMPS:
|
|
|
381f6c |
- params.speculate_indirect_jumps = 1;
|
|
|
381f6c |
- break;
|
|
|
381f6c |
-
|
|
|
381f6c |
- case OPTION_NO_SPECULATE_INDIRECT_JUMPS:
|
|
|
381f6c |
- params.speculate_indirect_jumps = 0;
|
|
|
381f6c |
- break;
|
|
|
381f6c |
-
|
|
|
381f6c |
case OPTION_PLT_ALIGN:
|
|
|
381f6c |
if (optarg != NULL)
|
|
|
381f6c |
{
|
|
|
381f6c |
diff -rup binutils.orig/ld/emultempl/ppc64elf.em binutils-2.30/ld/emultempl/ppc64elf.em
|
|
|
381f6c |
--- binutils.orig/ld/emultempl/ppc64elf.em 2018-02-08 10:49:07.192191063 +0000
|
|
|
381f6c |
+++ binutils-2.30/ld/emultempl/ppc64elf.em 2018-02-08 10:50:11.062395410 +0000
|
|
|
381f6c |
@@ -38,7 +38,7 @@ static struct ppc64_elf_params params =
|
|
|
381f6c |
&ppc_layout_sections_again,
|
|
|
381f6c |
1, -1, 0,
|
|
|
381f6c |
${DEFAULT_PLT_STATIC_CHAIN-0}, -1, 5,
|
|
|
381f6c |
- -1, 1, 0, -1, -1, 0};
|
|
|
381f6c |
+ -1, 0, -1, -1, 0};
|
|
|
381f6c |
|
|
|
381f6c |
/* Fake input file for stubs. */
|
|
|
381f6c |
static lang_input_statement_type *stub_file;
|
|
|
381f6c |
@@ -692,8 +692,6 @@ enum ppc64_opt
|
|
|
381f6c |
OPTION_NO_PLT_STATIC_CHAIN,
|
|
|
381f6c |
OPTION_PLT_THREAD_SAFE,
|
|
|
381f6c |
OPTION_NO_PLT_THREAD_SAFE,
|
|
|
381f6c |
- OPTION_SPECULATE_INDIRECT_JUMPS,
|
|
|
381f6c |
- OPTION_NO_SPECULATE_INDIRECT_JUMPS,
|
|
|
381f6c |
OPTION_PLT_ALIGN,
|
|
|
381f6c |
OPTION_NO_PLT_ALIGN,
|
|
|
381f6c |
OPTION_PLT_LOCALENTRY,
|
|
|
381f6c |
@@ -721,8 +719,6 @@ PARSE_AND_LIST_LONGOPTS=${PARSE_AND_LIST
|
|
|
381f6c |
{ "no-plt-static-chain", no_argument, NULL, OPTION_NO_PLT_STATIC_CHAIN },
|
|
|
381f6c |
{ "plt-thread-safe", no_argument, NULL, OPTION_PLT_THREAD_SAFE },
|
|
|
381f6c |
{ "no-plt-thread-safe", no_argument, NULL, OPTION_NO_PLT_THREAD_SAFE },
|
|
|
381f6c |
- { "speculate-indirect-jumps", no_argument, NULL, OPTION_SPECULATE_INDIRECT_JUMPS },
|
|
|
381f6c |
- { "no-speculate-indirect-jumps", no_argument, NULL, OPTION_NO_SPECULATE_INDIRECT_JUMPS },
|
|
|
381f6c |
{ "plt-align", optional_argument, NULL, OPTION_PLT_ALIGN },
|
|
|
381f6c |
{ "no-plt-align", no_argument, NULL, OPTION_NO_PLT_ALIGN },
|
|
|
381f6c |
{ "plt-localentry", optional_argument, NULL, OPTION_PLT_LOCALENTRY },
|
|
|
381f6c |
@@ -764,13 +760,7 @@ PARSE_AND_LIST_OPTIONS=${PARSE_AND_LIST_
|
|
|
381f6c |
--plt-thread-safe PLT call stubs with load-load barrier.\n"
|
|
|
381f6c |
));
|
|
|
381f6c |
fprintf (file, _("\
|
|
|
381f6c |
- --no-plt-thread-safe PLT call stubs without load-load barrier.\n"
|
|
|
381f6c |
- ));
|
|
|
381f6c |
- fprintf (file, _("\
|
|
|
381f6c |
- --speculate-indirect-jumps PLT call stubs without speculation barrier.\n"
|
|
|
381f6c |
- ));
|
|
|
381f6c |
- fprintf (file, _("\
|
|
|
381f6c |
- --no-speculate-indirect-jumps PLT call stubs with speculation barrier.\n"
|
|
|
381f6c |
+ --no-plt-thread-safe PLT call stubs without barrier.\n"
|
|
|
381f6c |
));
|
|
|
381f6c |
fprintf (file, _("\
|
|
|
381f6c |
--plt-align [=<align>] Align PLT call stubs to fit cache lines.\n"
|
|
|
381f6c |
@@ -860,14 +850,6 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LI
|
|
|
381f6c |
params.plt_thread_safe = 0;
|
|
|
381f6c |
break;
|
|
|
381f6c |
|
|
|
381f6c |
- case OPTION_SPECULATE_INDIRECT_JUMPS:
|
|
|
381f6c |
- params.speculate_indirect_jumps = 1;
|
|
|
381f6c |
- break;
|
|
|
381f6c |
-
|
|
|
381f6c |
- case OPTION_NO_SPECULATE_INDIRECT_JUMPS:
|
|
|
381f6c |
- params.speculate_indirect_jumps = 0;
|
|
|
381f6c |
- break;
|
|
|
381f6c |
-
|
|
|
381f6c |
case OPTION_PLT_ALIGN:
|
|
|
381f6c |
if (optarg != NULL)
|
|
|
381f6c |
{
|
|
|
381f6c |
diff -rup binutils.orig/ld/ld.texinfo binutils-2.30/ld/ld.texinfo
|
|
|
381f6c |
--- binutils.orig/ld/ld.texinfo 2018-02-08 10:49:07.203190926 +0000
|
|
|
381f6c |
+++ binutils-2.30/ld/ld.texinfo 2018-02-08 10:50:11.063395397 +0000
|
|
|
381f6c |
@@ -7646,15 +7646,6 @@ looks for calls to commonly used functio
|
|
|
381f6c |
seen, adds the necessary barriers. Use these options to change the
|
|
|
381f6c |
default behaviour.
|
|
|
381f6c |
|
|
|
381f6c |
-@cindex PowerPC64 PLT call stub speculative execution barrier
|
|
|
381f6c |
-@kindex --speculate-indirect-jumps
|
|
|
381f6c |
-@kindex --no-speculate-indirect-jumps
|
|
|
381f6c |
-@item --speculate-indirect-jumps
|
|
|
381f6c |
-@itemx --no-speculate-indirect-jumps
|
|
|
381f6c |
-Use these options to control whether all indirect branch instructions
|
|
|
381f6c |
-emitted by @code{ld}, such as those in the PLT, have a speculative
|
|
|
381f6c |
-execution barrier to mitigate Spectre variant 2 attacks.
|
|
|
381f6c |
-
|
|
|
381f6c |
@cindex PowerPC64 ELFv2 PLT localentry optimization
|
|
|
381f6c |
@kindex --plt-localentry
|
|
|
381f6c |
@kindex --no-plt-localentry
|
|
|
381f6c |
diff -rup binutils.orig/ld/testsuite/ld-powerpc/elfv2exe.d binutils-2.30/ld/testsuite/ld-powerpc/elfv2exe.d
|
|
|
381f6c |
--- binutils.orig/ld/testsuite/ld-powerpc/elfv2exe.d 2018-02-08 10:49:07.261190203 +0000
|
|
|
381f6c |
+++ binutils-2.30/ld/testsuite/ld-powerpc/elfv2exe.d 2018-02-08 10:50:11.063395397 +0000
|
|
|
381f6c |
@@ -1,6 +1,6 @@
|
|
|
381f6c |
#source: elfv2.s
|
|
|
381f6c |
#as: -a64
|
|
|
381f6c |
-#ld: -melf64ppc --speculate-indirect-jumps --defsym f2=0x1234 --defsym f3=0x10008888 --defsym f4=0x1200000 --defsym _start=f1
|
|
|
381f6c |
+#ld: -melf64ppc --defsym f2=0x1234 --defsym f3=0x10008888 --defsym f4=0x1200000 --defsym _start=f1
|
|
|
381f6c |
#objdump: -dr
|
|
|
381f6c |
|
|
|
381f6c |
.*
|
|
|
381f6c |
diff -rup binutils.orig/ld/testsuite/ld-powerpc/elfv2so.d binutils-2.30/ld/testsuite/ld-powerpc/elfv2so.d
|
|
|
381f6c |
--- binutils.orig/ld/testsuite/ld-powerpc/elfv2so.d 2018-02-08 10:49:07.264190166 +0000
|
|
|
381f6c |
+++ binutils-2.30/ld/testsuite/ld-powerpc/elfv2so.d 2018-02-08 10:50:11.063395397 +0000
|
|
|
381f6c |
@@ -1,6 +1,6 @@
|
|
|
381f6c |
#source: elfv2.s
|
|
|
381f6c |
#as: -a64
|
|
|
381f6c |
-#ld: -melf64ppc -shared --speculate-indirect-jumps
|
|
|
381f6c |
+#ld: -melf64ppc -shared
|
|
|
381f6c |
#objdump: -dr
|
|
|
381f6c |
|
|
|
381f6c |
.*
|
|
|
381f6c |
diff -rup binutils.orig/ld/testsuite/ld-powerpc/powerpc.exp binutils-2.30/ld/testsuite/ld-powerpc/powerpc.exp
|
|
|
381f6c |
--- binutils.orig/ld/testsuite/ld-powerpc/powerpc.exp 2018-02-08 10:49:07.261190203 +0000
|
|
|
381f6c |
+++ binutils-2.30/ld/testsuite/ld-powerpc/powerpc.exp 2018-02-08 10:50:11.063395397 +0000
|
|
|
381f6c |
@@ -121,11 +121,11 @@ set ppcelftests {
|
|
|
381f6c |
"tls32"}
|
|
|
381f6c |
{"TLS32 helper shared library" "-shared -melf32ppc tmpdir/tlslib32.o" "" "" {}
|
|
|
381f6c |
{} "libtlslib32.so"}
|
|
|
381f6c |
- {"TLS32 dynamic exec" "-melf32ppc --no-plt-align --speculate-indirect-jumps --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls32.o tmpdir/libtlslib32.so" "" "" {}
|
|
|
381f6c |
+ {"TLS32 dynamic exec" "-melf32ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls32.o tmpdir/libtlslib32.so" "" "" {}
|
|
|
381f6c |
{{readelf -WSsrl tlsexe32.r} {objdump -dr tlsexe32.d}
|
|
|
381f6c |
{objdump -sj.got tlsexe32.g} {objdump -sj.tdata tlsexe32.t}}
|
|
|
381f6c |
"tlsexe32"}
|
|
|
381f6c |
- {"TLS32 shared" "-shared -melf32ppc --no-plt-align --speculate-indirect-jumps --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls32.o" "" "" {}
|
|
|
381f6c |
+ {"TLS32 shared" "-shared -melf32ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls32.o" "" "" {}
|
|
|
381f6c |
{{readelf -WSsrl tlsso32.r} {objdump -dr tlsso32.d}
|
|
|
381f6c |
{objdump -sj.got tlsso32.g} {objdump -sj.tdata tlsso32.t}}
|
|
|
381f6c |
"tls32.so"}
|
|
|
381f6c |
@@ -147,7 +147,7 @@ set ppcelftests {
|
|
|
381f6c |
{"TLS32 DLL" "-shared -melf32ppc --version-script tlsdll.ver" ""
|
|
|
381f6c |
"-a32" {tlsdll_32.s}
|
|
|
381f6c |
{} "tlsdll32.so"}
|
|
|
381f6c |
- {"TLS32 opt 5" "-melf32ppc -shared --gc-sections --secure-plt --no-plt-align --speculate-indirect-jumps tmpdir/tlsdll32.so" "" "-a32" {tlsopt5_32.s}
|
|
|
381f6c |
+ {"TLS32 opt 5" "-melf32ppc -shared --gc-sections --secure-plt --no-plt-align tmpdir/tlsdll32.so" "" "-a32" {tlsopt5_32.s}
|
|
|
381f6c |
{{objdump -dr tlsopt5_32.d}}
|
|
|
381f6c |
"tlsopt5_32"}
|
|
|
381f6c |
{"Shared library with global symbol" "-shared -melf32ppc" "" "-a32" {sdalib.s}
|
|
|
381f6c |
@@ -174,15 +174,15 @@ set ppc64elftests {
|
|
|
381f6c |
{} "libtlslib.so"}
|
|
|
381f6c |
{"TLS helper old shared lib" "-shared -melf64ppc" "" "-a64" {oldtlslib.s}
|
|
|
381f6c |
{} "liboldlib.so"}
|
|
|
381f6c |
- {"TLS dynamic exec" "-melf64ppc --no-plt-align --speculate-indirect-jumps --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o tmpdir/libtlslib.so" "" "" {}
|
|
|
381f6c |
+ {"TLS dynamic exec" "-melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o tmpdir/libtlslib.so" "" "" {}
|
|
|
381f6c |
{{readelf -WSsrl tlsexe.r} {objdump -dr tlsexe.d}
|
|
|
381f6c |
{objdump -sj.got tlsexe.g} {objdump -sj.tdata tlsexe.t}}
|
|
|
381f6c |
"tlsexe"}
|
|
|
381f6c |
- {"TLS dynamic old" "-melf64ppc --no-plt-align --speculate-indirect-jumps --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o tmpdir/liboldlib.so" "" "" {}
|
|
|
381f6c |
+ {"TLS dynamic old" "-melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o tmpdir/liboldlib.so" "" "" {}
|
|
|
381f6c |
{{readelf -WSsrl tlsexe.r} {objdump -dr tlsexe.d}
|
|
|
381f6c |
{objdump -sj.got tlsexe.g} {objdump -sj.tdata tlsexe.t}}
|
|
|
381f6c |
"tlsexeold"}
|
|
|
381f6c |
- {"TLS shared" "-shared -melf64ppc --no-plt-align --speculate-indirect-jumps --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o" "" "" {}
|
|
|
381f6c |
+ {"TLS shared" "-shared -melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o" "" "" {}
|
|
|
381f6c |
{{readelf -WSsrl tlsso.r} {objdump -dr tlsso.d}
|
|
|
381f6c |
{objdump -sj.got tlsso.g} {objdump -sj.tdata tlsso.t}}
|
|
|
381f6c |
"tls.so"}
|
|
|
381f6c |
@@ -190,17 +190,17 @@ set ppc64elftests {
|
|
|
381f6c |
{{objdump -dr tlstoc.d} {objdump -sj.got tlstoc.g}
|
|
|
381f6c |
{objdump -sj.tdata tlstoc.t}}
|
|
|
381f6c |
"tlstoc"}
|
|
|
381f6c |
- {"TLSTOC dynamic exec" "-melf64ppc --no-plt-align --speculate-indirect-jumps --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o tmpdir/libtlslib.so" ""
|
|
|
381f6c |
+ {"TLSTOC dynamic exec" "-melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o tmpdir/libtlslib.so" ""
|
|
|
381f6c |
"" {}
|
|
|
381f6c |
{{readelf -WSsrl tlsexetoc.r} {objdump -dr tlsexetoc.d}
|
|
|
381f6c |
{objdump -sj.got tlsexetoc.g} {objdump -sj.tdata tlsexetoc.t}}
|
|
|
381f6c |
"tlsexetoc"}
|
|
|
381f6c |
- {"TLSTOC dynamic old" "-melf64ppc --no-plt-align --speculate-indirect-jumps --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o tmpdir/liboldlib.so" ""
|
|
|
381f6c |
+ {"TLSTOC dynamic old" "-melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o tmpdir/liboldlib.so" ""
|
|
|
381f6c |
"" {}
|
|
|
381f6c |
{{readelf -WSsrl tlsexetoc.r} {objdump -dr tlsexetoc.d}
|
|
|
381f6c |
{objdump -sj.got tlsexetoc.g} {objdump -sj.tdata tlsexetoc.t}}
|
|
|
381f6c |
"tlsexetocold"}
|
|
|
381f6c |
- {"TLSTOC shared" "-shared -melf64ppc --no-plt-align --speculate-indirect-jumps --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o" "" "" {}
|
|
|
381f6c |
+ {"TLSTOC shared" "-shared -melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o" "" "" {}
|
|
|
381f6c |
{{readelf -WSsrl tlstocso.r} {objdump -dr tlstocso.d}
|
|
|
381f6c |
{objdump -sj.got tlstocso.g} {objdump -sj.tdata tlstocso.t}}
|
|
|
381f6c |
"tlstoc.so"}
|
|
|
381f6c |
@@ -221,7 +221,7 @@ set ppc64elftests {
|
|
|
381f6c |
"tlsopt4"}
|
|
|
381f6c |
{"TLS DLL" "-shared -melf64ppc --version-script tlsdll.ver" "" "-a64" {tlsdll.s}
|
|
|
381f6c |
{} "tlsdll.so"}
|
|
|
381f6c |
- {"TLS opt 5" "-melf64ppc --no-plt-align --speculate-indirect-jumps -shared --gc-sections --no-plt-localentry tmpdir/tlsdll.so" "" "-a64" {tlsopt5.s}
|
|
|
381f6c |
+ {"TLS opt 5" "-melf64ppc --no-plt-align -shared --gc-sections --no-plt-localentry tmpdir/tlsdll.so" "" "-a64" {tlsopt5.s}
|
|
|
381f6c |
{{objdump -dr tlsopt5.d} {readelf -wf tlsopt5.wf}}
|
|
|
381f6c |
"tlsopt5"}
|
|
|
381f6c |
{"sym@tocbase" "-shared -melf64ppc" "" "-a64" {symtocbase-1.s symtocbase-2.s}
|
|
|
381f6c |
diff -rup binutils.orig/ld/testsuite/ld-powerpc/relbrlt.d binutils-2.30/ld/testsuite/ld-powerpc/relbrlt.d
|
|
|
381f6c |
--- binutils.orig/ld/testsuite/ld-powerpc/relbrlt.d 2018-02-08 10:49:07.262190191 +0000
|
|
|
381f6c |
+++ binutils-2.30/ld/testsuite/ld-powerpc/relbrlt.d 2018-02-08 10:50:11.063395397 +0000
|
|
|
381f6c |
@@ -1,6 +1,6 @@
|
|
|
381f6c |
#source: relbrlt.s
|
|
|
381f6c |
#as: -a64
|
|
|
381f6c |
-#ld: -melf64ppc --no-plt-align --speculate-indirect-jumps --no-ld-generated-unwind-info --emit-relocs
|
|
|
381f6c |
+#ld: -melf64ppc --no-plt-align --no-ld-generated-unwind-info --emit-relocs
|
|
|
381f6c |
#objdump: -Dr
|
|
|
381f6c |
|
|
|
381f6c |
.*
|