[llvm-commits] [PATCH] ARM: conditional BL should use fixup_arm_condbranch
Mans Rullgard
mans at mansr.com
Mon Mar 19 06:47:09 PDT 2012
Using fixup_arm_bl results in an R_ARM_CALL relocation which is not
allowed for conditional BL instructions.
---
lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp b/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp
index 4445dcd..cf18508 100644
--- a/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp
+++ b/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp
@@ -597,8 +597,12 @@ uint32_t ARMMCCodeEmitter::
getARMBLTargetOpValue(const MCInst &MI, unsigned OpIdx,
SmallVectorImpl<MCFixup> &Fixups) const {
const MCOperand MO = MI.getOperand(OpIdx);
- if (MO.isExpr())
+ if (MO.isExpr()) {
+ if (HasConditionalBranch(MI))
+ return ::getBranchTargetOpValue(MI, OpIdx,
+ ARM::fixup_arm_condbranch, Fixups);
return ::getBranchTargetOpValue(MI, OpIdx, ARM::fixup_arm_bl, Fixups);
+ }
return MO.getImm() >> 2;
}
--
1.7.8.5
More information about the llvm-commits
mailing list