diff options
author | Akira Hatanaka <ahatanaka@mips.com> | 2012-12-03 23:12:19 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@mips.com> | 2012-12-03 23:12:19 +0000 |
commit | a667aade366b724e19e359d9cb6b9b8651daaa1b (patch) | |
tree | a6b55fe7ffaeb2213c20d50a54973b8088e5a62e /llvm/lib/ExecutionEngine | |
parent | 4c128509a53afdc049dee5b6485ea398da08fbfa (diff) | |
download | bcm5719-llvm-a667aade366b724e19e359d9cb6b9b8651daaa1b.tar.gz bcm5719-llvm-a667aade366b724e19e359d9cb6b9b8651daaa1b.zip |
Runtime dynamic linker for MCJIT should support MIPS BigEndian architecture.
This small change adds support for that. It will make all MCJIT tests pass
in make-check on BigEndian platforms.
Patch by Petar Jovanovic.
llvm-svn: 169178
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r-- | llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp index 3685fece1b5..648de79b89a 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp @@ -347,7 +347,7 @@ uint8_t *RuntimeDyldImpl::createStubFunction(uint8_t *Addr) { uint32_t *StubAddr = (uint32_t*)Addr; *StubAddr = 0xe51ff004; // ldr pc,<label> return (uint8_t*)++StubAddr; - } else if (Arch == Triple::mipsel) { + } else if (Arch == Triple::mipsel or Arch == Triple::mips) { uint32_t *StubAddr = (uint32_t*)Addr; // 0: 3c190000 lui t9,%hi(addr). // 4: 27390000 addiu t9,t9,%lo(addr). diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp index f5fd2e0d7eb..f32e3871b82 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp @@ -677,7 +677,8 @@ void RuntimeDyldELF::processRelocationRef(const ObjRelocationInfo &Rel, RelType, 0); Section.StubOffset += getMaxStubSize(); } - } else if (Arch == Triple::mipsel && RelType == ELF::R_MIPS_26) { + } else if ((Arch == Triple::mipsel || Arch == Triple::mips) && + RelType == ELF::R_MIPS_26) { // This is an Mips branch relocation, need to use a stub function. DEBUG(dbgs() << "\t\tThis is a Mips branch relocation."); SectionEntry &Section = Sections[Rel.SectionID]; diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h index 829fd6c4c9a..cfeb2b4b6a0 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h @@ -168,7 +168,7 @@ protected: inline unsigned getMaxStubSize() { if (Arch == Triple::arm || Arch == Triple::thumb) return 8; // 32-bit instruction and 32-bit address - else if (Arch == Triple::mipsel) + else if (Arch == Triple::mipsel or Arch == Triple::mips) return 16; else if (Arch == Triple::ppc64) return 44; |