diff options
author | Owen Anderson <resistor@mac.com> | 2010-12-09 01:51:07 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-12-09 01:51:07 +0000 |
commit | 3e6ee1db3e28c2ccdda2641d801009720d3beb5f (patch) | |
tree | cdfe4c3fe562fc059fd983fca312de911c6c4081 /llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp | |
parent | 6233189713798c3bba3410dc3a5255a1961a4ba4 (diff) | |
download | bcm5719-llvm-3e6ee1db3e28c2ccdda2641d801009720d3beb5f.tar.gz bcm5719-llvm-3e6ee1db3e28c2ccdda2641d801009720d3beb5f.zip |
Fix Thumb2 fixups for ldr.
llvm-svn: 121350
Diffstat (limited to 'llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp b/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp index 8fbeb0e6e0d..9684fb1de84 100644 --- a/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp +++ b/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp @@ -47,6 +47,7 @@ public: const static MCFixupKindInfo Infos[] = { // name off bits flags { "fixup_arm_ldst_pcrel_12", 1, 24, MCFixupKindInfo::FKF_IsPCRel }, + { "fixup_t2_ldst_pcrel_12", 0, 32, MCFixupKindInfo::FKF_IsPCRel }, { "fixup_arm_pcrel_10", 1, 24, MCFixupKindInfo::FKF_IsPCRel }, { "fixup_t2_pcrel_10", 0, 32, MCFixupKindInfo::FKF_IsPCRel }, { "fixup_arm_adr_pcrel_12", 1, 24, MCFixupKindInfo::FKF_IsPCRel }, @@ -508,7 +509,12 @@ getAddrModeImm12OpValue(const MCInst &MI, unsigned OpIdx, else Expr = MO2.getExpr(); - MCFixupKind Kind = MCFixupKind(ARM::fixup_arm_ldst_pcrel_12); + const ARMSubtarget &Subtarget = TM.getSubtarget<ARMSubtarget>(); + MCFixupKind Kind; + if (Subtarget.isThumb2()) + Kind = MCFixupKind(ARM::fixup_t2_ldst_pcrel_12); + else + Kind = MCFixupKind(ARM::fixup_arm_ldst_pcrel_12); Fixups.push_back(MCFixup::Create(0, Expr, Kind)); ++MCNumCPRelocations; |