[llvm-commits] [PATCH] ARM: conditional BL should use fixup_arm_condbranch

Kristof Beyls kristof.beyls at arm.com
Mon Mar 19 09:26:12 PDT 2012


Hi Mans,

It think that this patch needs a regression test.

Thanks,

Kristof

> -----Original Message-----
> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-
> bounces at cs.uiuc.edu] On Behalf Of Mans Rullgard
> Sent: 19 March 2012 13:47
> To: llvm-commits at cs.uiuc.edu
> Subject: [llvm-commits] [PATCH] ARM: conditional BL should use
> fixup_arm_condbranch
> 
> 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
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits








More information about the llvm-commits mailing list