+2014-06-03 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ADDIS_R12_R2): Define.
+ (build_plt_stub): Support fusion on ELFv2 stub.
+ (ppc_build_one_stub): Likewise for plt branch stubs.
+
2014-05-28 Alan Modra <amodra@gmail.com>
* elf32-rx.c (rx_table_map): Delete set but not used variables.
#define LD_R2_0R1 0xe8410000 /* ld %r2,0(%r1) */
+#define ADDIS_R12_R2 0x3d820000 /* addis %r12,%r2,xxx@ha */
#define ADDIS_R12_R12 0x3d8c0000 /* addis %r12,%r12,xxx@ha */
#define LD_R12_0R12 0xe98c0000 /* ld %r12,xxx@l(%r12) */
if (ALWAYS_EMIT_R2SAVE
|| stub_entry->stub_type == ppc_stub_plt_call_r2save)
bfd_put_32 (obfd, STD_R2_0R1 + STK_TOC (htab), p), p += 4;
- bfd_put_32 (obfd, ADDIS_R11_R2 | PPC_HA (offset), p), p += 4;
- bfd_put_32 (obfd, LD_R12_0R11 | PPC_LO (offset), p), p += 4;
+ if (plt_load_toc)
+ {
+ bfd_put_32 (obfd, ADDIS_R11_R2 | PPC_HA (offset), p), p += 4;
+ bfd_put_32 (obfd, LD_R12_0R11 | PPC_LO (offset), p), p += 4;
+ }
+ else
+ {
+ bfd_put_32 (obfd, ADDIS_R12_R2 | PPC_HA (offset), p), p += 4;
+ bfd_put_32 (obfd, LD_R12_0R12 | PPC_LO (offset), p), p += 4;
+ }
if (plt_load_toc
&& PPC_HA (offset + 8 + 8 * plt_static_chain) != PPC_HA (offset))
{
{
size = 16;
bfd_put_32 (htab->params->stub_bfd,
- ADDIS_R11_R2 | PPC_HA (off), loc);
+ ADDIS_R12_R2 | PPC_HA (off), loc);
loc += 4;
bfd_put_32 (htab->params->stub_bfd,
- LD_R12_0R11 | PPC_LO (off), loc);
+ LD_R12_0R12 | PPC_LO (off), loc);
}
else
{
{
size += 4;
bfd_put_32 (htab->params->stub_bfd,
- ADDIS_R11_R2 | PPC_HA (off), loc);
+ ADDIS_R12_R2 | PPC_HA (off), loc);
loc += 4;
bfd_put_32 (htab->params->stub_bfd,
- LD_R12_0R11 | PPC_LO (off), loc);
+ LD_R12_0R12 | PPC_LO (off), loc);
}
else
bfd_put_32 (htab->params->stub_bfd, LD_R12_0R2 | PPC_LO (off), loc);
+2014-06-03 Alan Modra <amodra@gmail.com>
+
+ * ppc64-tdep.c (ppc64_standard_linkage8): New.
+ (ppc64_skip_trampoline_code): Recognise ELFv2 stub supporting fusion.
+
2014-06-02 Doug Evans <dje@google.com>
Add support for skeletonless type units.
{ 0, 0, 0 }
};
+/* ELFv2 PLT call stub to access PLT entries more than +/- 32k from r2,
+ supporting fusion. */
+
+static struct ppc_insn_pattern ppc64_standard_linkage8[] =
+ {
+ /* std r2, 24(r1) <optional> */
+ { -1, insn_ds (62, 2, 1, 24, 0), 1 },
+
+ /* addis r12, r2, <any> */
+ { insn_d (-1, -1, -1, 0), insn_d (15, 12, 2, 0), 0 },
+
+ /* ld r12, <any>(r12) */
+ { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 12, 12, 0, 0), 0 },
+
+ /* mtctr r12 */
+ { insn_xfx (-1, -1, -1, -1), insn_xfx (31, 12, 9, 467), 0 },
+
+ /* bctr */
+ { -1, 0x4e800420, 0 },
+
+ { 0, 0, 0 }
+ };
+
/* When the dynamic linker is doing lazy symbol resolution, the first
call to a function in another object will go like this:
ARRAY_SIZE (ppc64_standard_linkage4))),
MAX (MAX (ARRAY_SIZE (ppc64_standard_linkage5),
ARRAY_SIZE (ppc64_standard_linkage6)),
- ARRAY_SIZE (ppc64_standard_linkage7))) - 1];
+ MAX (ARRAY_SIZE (ppc64_standard_linkage7),
+ ARRAY_SIZE (ppc64_standard_linkage8))))
+ - 1];
CORE_ADDR target;
- if (ppc_insns_match_pattern (frame, pc, ppc64_standard_linkage7, insns))
+ if (ppc_insns_match_pattern (frame, pc, ppc64_standard_linkage8, insns))
+ pc = ppc64_standard_linkage4_target (frame, pc, insns);
+ else if (ppc_insns_match_pattern (frame, pc, ppc64_standard_linkage7, insns))
pc = ppc64_standard_linkage3_target (frame, pc, insns);
else if (ppc_insns_match_pattern (frame, pc, ppc64_standard_linkage6, insns))
pc = ppc64_standard_linkage4_target (frame, pc, insns);
+2014-06-03 Alan Modra <amodra@gmail.com>
+
+ * powerpc.cc (addis_12_2): Define.
+ (Stub_table::do_write): Support fusion on ELFv2 stubs.
+
2014-06-03 Alan Modra <amodra@gmail.com>
* testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
static const uint32_t addis_11_2 = 0x3d620000;
static const uint32_t addis_11_11 = 0x3d6b0000;
static const uint32_t addis_11_30 = 0x3d7e0000;
+static const uint32_t addis_12_2 = 0x3d820000;
static const uint32_t addis_12_12 = 0x3d8c0000;
static const uint32_t b = 0x48000000;
static const uint32_t bcl_20_31 = 0x429f0005;
{
write_insn<big_endian>(p, std_2_1 + this->targ_->stk_toc());
p += 4;
- write_insn<big_endian>(p, addis_11_2 + ha(off));
- p += 4;
- write_insn<big_endian>(p, ld_12_11 + l(off));
- p += 4;
+ if (plt_load_toc)
+ {
+ write_insn<big_endian>(p, addis_11_2 + ha(off));
+ p += 4;
+ write_insn<big_endian>(p, ld_12_11 + l(off));
+ p += 4;
+ }
+ else
+ {
+ write_insn<big_endian>(p, addis_12_2 + ha(off));
+ p += 4;
+ write_insn<big_endian>(p, ld_12_12 + l(off));
+ p += 4;
+ }
if (plt_load_toc
&& ha(off + 8 + 8 * static_chain) != ha(off))
{
}
else
{
- write_insn<big_endian>(p, addis_11_2 + ha(brltoff)), p += 4;
- write_insn<big_endian>(p, ld_12_11 + l(brltoff)), p += 4;
+ write_insn<big_endian>(p, addis_12_2 + ha(brltoff)), p += 4;
+ write_insn<big_endian>(p, ld_12_12 + l(brltoff)), p += 4;
}
write_insn<big_endian>(p, mtctr_12), p += 4;
write_insn<big_endian>(p, bctr);
+2014-06-03 Alan Modra <amodra@gmail.com>
+
+ * ld-powerpc/elfv2exe.d: Update for changed plt call stubs.
+
2014-05-28 Matthew Fortune <matthew.fortune@imgtec.com>
* lib/ld-lib.exp: Add objcopy_objects command to run_dump_test.
Disassembly of section \.text:
0+100000c0 <.*\.plt_branch\.f2>:
-.*: (ff ff 62 3d|3d 62 ff ff) addis r11,r2,-1
-.*: (f0 7f 8b e9|e9 8b 7f f0) ld r12,32752\(r11\)
+.*: (ff ff 82 3d|3d 82 ff ff) addis r12,r2,-1
+.*: (f0 7f 8c e9|e9 8c 7f f0) ld r12,32752\(r12\)
.*: (a6 03 89 7d|7d 89 03 a6) mtctr r12
.*: (20 04 80 4e|4e 80 04 20) bctr
0+100000d0 <.*\.plt_branch\.f4>:
-.*: (ff ff 62 3d|3d 62 ff ff) addis r11,r2,-1
-.*: (f8 7f 8b e9|e9 8b 7f f8) ld r12,32760\(r11\)
+.*: (ff ff 82 3d|3d 82 ff ff) addis r12,r2,-1
+.*: (f8 7f 8c e9|e9 8c 7f f8) ld r12,32760\(r12\)
.*: (a6 03 89 7d|7d 89 03 a6) mtctr r12
.*: (20 04 80 4e|4e 80 04 20) bctr