diff options
-rw-r--r-- | lld/ELF/Target.cpp | 2 | ||||
-rw-r--r-- | lld/test/elf2/ppc64-toc-restore.s | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index 861c97d1102..78a82992f61 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -271,7 +271,7 @@ void PPC64TargetInfo::writePltEntry(uint8_t *Buf, uint64_t GotEntryAddr, // be a pointer to the function descriptor in the .opd section. Using // this scheme is simpler, but requires an extra indirection per PLT dispatch. - write32be(Buf, 0xf8410000); // std %r2, 40(%r1) + write32be(Buf, 0xf8410028); // std %r2, 40(%r1) write32be(Buf + 4, 0x3d620000 | applyPPCHa(Off)); // addis %r11, %r2, X@ha write32be(Buf + 8, 0xe98b0000 | applyPPCLo(Off)); // ld %r12, X@l(%r11) write32be(Buf + 12, 0xe96c0000); // ld %r11,0(%r12) diff --git a/lld/test/elf2/ppc64-toc-restore.s b/lld/test/elf2/ppc64-toc-restore.s index 986a4e203f2..9e2dc46e8ad 100644 --- a/lld/test/elf2/ppc64-toc-restore.s +++ b/lld/test/elf2/ppc64-toc-restore.s @@ -52,4 +52,11 @@ last: // CHECK: Disassembly of section .plt: // CHECK: .plt: -// CHECK: 20020: +// CHECK: 20020: f8 41 00 28 std 2, 40(1) +// CHECK: 20024: 3d 62 00 00 addis 11, 2, 0 +// CHECK: 20028: e9 8b 80 00 ld 12, -32768(11) +// CHECK: 2002c: e9 6c 00 00 ld 11, 0(12) +// CHECK: 20030: 7d 69 03 a6 mtctr 11 +// CHECK: 20034: e8 4c 00 08 ld 2, 8(12) +// CHECK: 20038: e9 6c 00 10 ld 11, 16(12) +// CHECK: 2003c: 4e 80 04 20 bctr |