[PATCH] D61586: [mips] fix segment fault for plt on mips64.
Qiao Pengcheng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 6 18:19:23 PDT 2019
QiaoPengcheng updated this revision to Diff 198384.
QiaoPengcheng added a comment.
updateing the patch for coding-style.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61586/new/
https://reviews.llvm.org/D61586
Files:
lld/ELF/Arch/Mips.cpp
Index: lld/ELF/Arch/Mips.cpp
===================================================================
--- lld/ELF/Arch/Mips.cpp
+++ lld/ELF/Arch/Mips.cpp
@@ -331,9 +331,17 @@
: (Config->ZHazardplt ? 0x03200408 : 0x03200008);
write32<E>(Buf, 0x3c0f0000); // lui $15, %hi(.got.plt entry)
- write32<E>(Buf + 4, 0x8df90000); // l[wd] $25, %lo(.got.plt entry)($15)
+ if (ELFT::Is64Bits) {
+ write32<E>(Buf + 4, 0xddf90000); // ld $25, %lo(.got.plt entry)($15)
+ } else {
+ write32<E>(Buf + 4, 0x8df90000); // lw $25, %lo(.got.plt entry)($15)
+ }
write32<E>(Buf + 8, JrInst); // jr $25 / jr.hb $25
- write32<E>(Buf + 12, 0x25f80000); // addiu $24, $15, %lo(.got.plt entry)
+ if (ELFT::Is64Bits) {
+ write32<E>(Buf + 12, 0x65f80000); // daddiu $24, $15, %lo(.got.plt entry)
+ } else {
+ write32<E>(Buf + 12, 0x25f80000); // addiu $24, $15, %lo(.got.plt entry)
+ }
writeValue<E>(Buf, GotPltEntryAddr + 0x8000, 16, 16);
writeValue<E>(Buf + 4, GotPltEntryAddr, 16, 0);
writeValue<E>(Buf + 12, GotPltEntryAddr, 16, 0);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61586.198384.patch
Type: text/x-patch
Size: 1083 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190507/c796e95f/attachment.bin>
More information about the llvm-commits
mailing list