llvm.org GIT mirror llvm / d64a2c4
[LLVM][MIPS] Fix createStubFunction to emit JR encoding based on Arch. Reviewers: vkalintiris, dsanders Subscribers: jaydeep, bhushan, mohit.bhakkad, slthakur, llvm-commits Differential Revision: https://reviews.llvm.org/D21172 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275559 91177308-0d34-0410-b5e6-96231b3b80d8 Nitesh Jain 4 years ago
2 changed file(s) with 9 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
815815 // 8: 03200008 jr t9.
816816 // c: 00000000 nop.
817817 const unsigned LuiT9Instr = 0x3c190000, AdduiT9Instr = 0x27390000;
818 const unsigned JrT9Instr = 0x03200008, NopInstr = 0x0;
818 const unsigned NopInstr = 0x0;
819 unsigned JrT9Instr = 0x03200008;
820 if ((AbiVariant & ELF::EF_MIPS_ARCH) == ELF::EF_MIPS_ARCH_32R6)
821 JrT9Instr = 0x03200009;
819822
820823 writeBytesUnaligned(LuiT9Instr, Addr, 4);
821824 writeBytesUnaligned(AdduiT9Instr, Addr+4, 4);
14011401 // Create a new stub function.
14021402 DEBUG(dbgs() << " Create a new stub function\n");
14031403 Stubs[Value] = Section.getStubOffset();
1404
1405 unsigned AbiVariant;
1406 O.getPlatformFlags(AbiVariant);
1407
14041408 uint8_t *StubTargetAddr = createStubFunction(
1405 Section.getAddressWithOffset(Section.getStubOffset()));
1409 Section.getAddressWithOffset(Section.getStubOffset()), AbiVariant);
14061410
14071411 // Creating Hi and Lo relocations for the filled stub instructions.
14081412 RelocationEntry REHi(SectionID, StubTargetAddr - Section.getAddress(),