mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 16:19:52 +00:00
ARM: fix WoA PEI instruction selection
The ARM::BLX instruction is an ARM mode instruction. The Windows on ARM target is limited to Thumb instructions. Correctly use the thumb mode tBLXr instruction. This would manifest as an errant write into the object file as the instruction is 4-bytes in length rather than 2. The result would be a corrupted object file that would eventually result in an executable that would crash at runtime. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208152 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -319,7 +319,8 @@ void ARMFrameLowering::emitPrologue(MachineFunction &MF) const {
|
||||
BuildMI(MBB, MBBI, dl, TII.get(ARM::t2MOVi32imm), ARM::R12)
|
||||
.addExternalSymbol("__chkstk");
|
||||
|
||||
BuildMI(MBB, MBBI, dl, TII.get(ARM::BLX))
|
||||
BuildMI(MBB, MBBI, dl, TII.get(ARM::tBLXr))
|
||||
.addImm((unsigned)ARMCC::AL).addReg(0)
|
||||
.addReg(ARM::R12, RegState::Kill)
|
||||
.addReg(ARM::R4, RegState::Implicit);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user