diff --git a/lld/ELF/Arch/Mips.cpp b/lld/ELF/Arch/Mips.cpp --- a/lld/ELF/Arch/Mips.cpp +++ b/lld/ELF/Arch/Mips.cpp @@ -331,9 +331,15 @@ : (Config->ZHazardplt ? 0x03200408 : 0x03200008); write32(Buf, 0x3c0f0000); // lui $15, %hi(.got.plt entry) - write32(Buf + 4, 0x8df90000); // l[wd] $25, %lo(.got.plt entry)($15) + if (ELFT::Is64Bits) { + write32(Buf + 4, 0xddf90000); // ld $25, %lo(.got.plt entry)($15) + } else + write32(Buf + 4, 0x8df90000); // lw $25, %lo(.got.plt entry)($15) write32(Buf + 8, JrInst); // jr $25 / jr.hb $25 - write32(Buf + 12, 0x25f80000); // addiu $24, $15, %lo(.got.plt entry) + if (ELFT::Is64Bits) { + write32(Buf + 12, 0x65f80000); // daddiu $24, $15, %lo(.got.plt entry) + } else + write32(Buf + 12, 0x25f80000); // addiu $24, $15, %lo(.got.plt entry) writeValue(Buf, GotPltEntryAddr + 0x8000, 16, 16); writeValue(Buf + 4, GotPltEntryAddr, 16, 0); writeValue(Buf + 12, GotPltEntryAddr, 16, 0);