diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-05-07 03:03:27 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-05-07 03:03:27 +0000 |
commit | acd0338c61f6c9c7ea46501152ea40afae8e9386 (patch) | |
tree | a8156e93c18a1269abfa1121db3ab0c3cfb4faad /llvm/lib | |
parent | d968717126480d8fab681d4bf8ade59ba20b0ef7 (diff) | |
download | bcm5719-llvm-acd0338c61f6c9c7ea46501152ea40afae8e9386.tar.gz bcm5719-llvm-acd0338c61f6c9c7ea46501152ea40afae8e9386.zip |
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.
llvm-svn: 208152
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/ARM/ARMFrameLowering.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp index 5a114a94e6f..8da7fb89401 100644 --- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp +++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp @@ -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; |