summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorRon Lieberman <ronl@codeaurora.org>2016-08-13 23:41:11 +0000
committerRon Lieberman <ronl@codeaurora.org>2016-08-13 23:41:11 +0000
commit822ee88ab88d8ce07c806c7311f79bcbde7fe6d0 (patch)
tree0861607322cc84fb2294f058965b2de649d9a506 /llvm/lib
parent466a64e2987cdab261f0c9bf25f0ddddc37f716f (diff)
downloadbcm5719-llvm-822ee88ab88d8ce07c806c7311f79bcbde7fe6d0.tar.gz
bcm5719-llvm-822ee88ab88d8ce07c806c7311f79bcbde7fe6d0.zip
Fix unsupported relocation type R_HEX_6_X' for symbol .rodata
LowerTargetConstantPool is not properly setting the TargetFlag to indicate desired relocation. Coding error, the offset parameter was omitted, so the TargetFlag was used as the offset, and the TargetFlag defaulted to zero. This only affects -fpic compilation, and only those items created in a Constant Pool, for example a vector of constants. Halide ran into this issue. llvm-svn: 278614
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Hexagon/HexagonISelLowering.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
index 717cde353ef..d3a5ce1a7a7 100644
--- a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
@@ -1414,11 +1414,18 @@ HexagonTargetLowering::LowerConstantPool(SDValue Op, SelectionDAG &DAG) const {
bool IsPositionIndependent = isPositionIndependent();
unsigned char TF = IsPositionIndependent ? HexagonII::MO_PCREL : 0;
+ unsigned Offset = 0;
SDValue T;
if (CPN->isMachineConstantPoolEntry())
- T = DAG.getTargetConstantPool(CPN->getMachineCPVal(), ValTy, Align, TF);
+ T = DAG.getTargetConstantPool(CPN->getMachineCPVal(), ValTy, Align, Offset,
+ TF);
else
- T = DAG.getTargetConstantPool(CPN->getConstVal(), ValTy, Align, TF);
+ T = DAG.getTargetConstantPool(CPN->getConstVal(), ValTy, Align, Offset,
+ TF);
+
+ assert(cast<ConstantPoolSDNode>(T)->getTargetFlags() == TF &&
+ "Inconsistent target flag encountered");
+
if (IsPositionIndependent)
return DAG.getNode(HexagonISD::AT_PCREL, SDLoc(Op), ValTy, T);
return DAG.getNode(HexagonISD::CP, SDLoc(Op), ValTy, T);
OpenPOWER on IntegriCloud