summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp38
1 files changed, 6 insertions, 32 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
index d047697583a..2b69f1a0269 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
@@ -861,7 +861,7 @@ uint8_t *RuntimeDyldImpl::createStubFunction(uint8_t *Addr,
// and stubs for branches Thumb - ARM and ARM - Thumb.
writeBytesUnaligned(0xe51ff004, Addr, 4); // ldr pc,<label>
return Addr + 4;
- } else if (IsMipsO32ABI || IsMipsN32ABI) {
+ } else if (IsMipsO32ABI) {
// 0: 3c190000 lui t9,%hi(addr).
// 4: 27390000 addiu t9,t9,%lo(addr).
// 8: 03200008 jr t9.
@@ -869,39 +869,13 @@ uint8_t *RuntimeDyldImpl::createStubFunction(uint8_t *Addr,
const unsigned LuiT9Instr = 0x3c190000, AdduiT9Instr = 0x27390000;
const unsigned NopInstr = 0x0;
unsigned JrT9Instr = 0x03200008;
- if ((AbiVariant & ELF::EF_MIPS_ARCH) == ELF::EF_MIPS_ARCH_32R6 ||
- (AbiVariant & ELF::EF_MIPS_ARCH) == ELF::EF_MIPS_ARCH_64R6)
- JrT9Instr = 0x03200009;
+ if ((AbiVariant & ELF::EF_MIPS_ARCH) == ELF::EF_MIPS_ARCH_32R6)
+ JrT9Instr = 0x03200009;
writeBytesUnaligned(LuiT9Instr, Addr, 4);
- writeBytesUnaligned(AdduiT9Instr, Addr + 4, 4);
- writeBytesUnaligned(JrT9Instr, Addr + 8, 4);
- writeBytesUnaligned(NopInstr, Addr + 12, 4);
- return Addr;
- } else if (IsMipsN64ABI) {
- // 0: 3c190000 lui t9,%highest(addr).
- // 4: 67390000 daddiu t9,t9,%higher(addr).
- // 8: 0019CC38 dsll t9,t9,16.
- // c: 67390000 daddiu t9,t9,%hi(addr).
- // 10: 0019CC38 dsll t9,t9,16.
- // 14: 67390000 daddiu t9,t9,%lo(addr).
- // 18: 03200008 jr t9.
- // 1c: 00000000 nop.
- const unsigned LuiT9Instr = 0x3c190000, DaddiuT9Instr = 0x67390000,
- DsllT9Instr = 0x19CC38;
- const unsigned NopInstr = 0x0;
- unsigned JrT9Instr = 0x03200008;
- if ((AbiVariant & ELF::EF_MIPS_ARCH) == ELF::EF_MIPS_ARCH_64R6)
- JrT9Instr = 0x03200009;
-
- writeBytesUnaligned(LuiT9Instr, Addr, 4);
- writeBytesUnaligned(DaddiuT9Instr, Addr + 4, 4);
- writeBytesUnaligned(DsllT9Instr, Addr + 8, 4);
- writeBytesUnaligned(DaddiuT9Instr, Addr + 12, 4);
- writeBytesUnaligned(DsllT9Instr, Addr + 16, 4);
- writeBytesUnaligned(DaddiuT9Instr, Addr + 20, 4);
- writeBytesUnaligned(JrT9Instr, Addr + 24, 4);
- writeBytesUnaligned(NopInstr, Addr + 28, 4);
+ writeBytesUnaligned(AdduiT9Instr, Addr+4, 4);
+ writeBytesUnaligned(JrT9Instr, Addr+8, 4);
+ writeBytesUnaligned(NopInstr, Addr+12, 4);
return Addr;
} else if (Arch == Triple::ppc64 || Arch == Triple::ppc64le) {
// Depending on which version of the ELF ABI is in use, we need to
OpenPOWER on IntegriCloud