summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/BPF/BPFISelLowering.cpp
diff options
context:
space:
mode:
authorAlexei Starovoitov <alexei.starovoitov@gmail.com>2017-11-19 01:35:00 +0000
committerAlexei Starovoitov <alexei.starovoitov@gmail.com>2017-11-19 01:35:00 +0000
commit9a67245d881f4cf89fd8f897ae2cd0bccec49496 (patch)
treebe1166344599d69ad93901682d2f9d9ecf0f5e76 /llvm/lib/Target/BPF/BPFISelLowering.cpp
parent9a94dfc457443b263ded785722bdd085cb05ab22 (diff)
downloadbcm5719-llvm-9a67245d881f4cf89fd8f897ae2cd0bccec49496.tar.gz
bcm5719-llvm-9a67245d881f4cf89fd8f897ae2cd0bccec49496.zip
[bpf] allow direct and indirect calls
kernel verifier is becoming smarter and soon will support direct and indirect function calls. Remove obsolete error from BPF backend. Make call to use PCRel_4 fixup. 'bpf to bpf' calls are distinguished from 'bpf to kernel' calls by insn->src_reg == BPF_PSEUDO_CALL == 1 which is used as relocation indicator similar to ld_imm64->src_reg == BPF_PSEUDO_MAP_FD == 1 The actual 'call' instruction remains the same for both 'bpf to kernel' and 'bpf to bpf' calls. Signed-off-by: Alexei Starovoitov <ast@kernel.org> llvm-svn: 318614
Diffstat (limited to 'llvm/lib/Target/BPF/BPFISelLowering.cpp')
-rw-r--r--llvm/lib/Target/BPF/BPFISelLowering.cpp7
1 files changed, 0 insertions, 7 deletions
diff --git a/llvm/lib/Target/BPF/BPFISelLowering.cpp b/llvm/lib/Target/BPF/BPFISelLowering.cpp
index 995f206529f..f9078fae028 100644
--- a/llvm/lib/Target/BPF/BPFISelLowering.cpp
+++ b/llvm/lib/Target/BPF/BPFISelLowering.cpp
@@ -330,13 +330,6 @@ SDValue BPFTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
// Likewise ExternalSymbol -> TargetExternalSymbol.
if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee)) {
auto GV = G->getGlobal();
- fail(CLI.DL, DAG,
- "A call to global function '" + StringRef(GV->getName())
- + "' is not supported. "
- + (GV->isDeclaration() ?
- "Only calls to predefined BPF helpers are allowed." :
- "Please use __attribute__((always_inline) to make sure"
- " this function is inlined."));
Callee = DAG.getTargetGlobalAddress(G->getGlobal(), CLI.DL, PtrVT,
G->getOffset(), 0);
} else if (ExternalSymbolSDNode *E = dyn_cast<ExternalSymbolSDNode>(Callee)) {
OpenPOWER on IntegriCloud