diff options
Diffstat (limited to 'llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp')
| -rw-r--r-- | llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp b/llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp index b363179e25b..3321464a1dd 100644 --- a/llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp +++ b/llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp @@ -11,19 +11,15 @@ // ldd r2, r1, 0 // add r3, struct_base_reg, r2 // -// Here @global should either present a AMA (abstruct member access) or -// a patchable extern variable. And these two kinds of accesses -// are subject to bpf load time patching. After this pass, the +// Here @global should represent an AMA (abstruct member access). +// Such an access is subject to bpf load time patching. After this pass, the // code becomes // ld_imm64 r1, @global // add r3, struct_base_reg, r1 // // Eventually, at BTF output stage, a relocation record will be generated // for ld_imm64 which should be replaced later by bpf loader: -// r1 = <calculated offset> or <to_be_patched_extern_val> -// add r3, struct_base_reg, r1 -// or -// ld_imm64 r1, <to_be_patched_extern_val> +// r1 = <calculated field_info> // add r3, struct_base_reg, r1 // //===----------------------------------------------------------------------===// @@ -120,15 +116,6 @@ bool BPFMISimplifyPatchable::removeLD() { if (GVar->hasAttribute(BPFCoreSharedInfo::AmaAttr)) { assert(ImmVal == 0); IsCandidate = true; - } else if (!GVar->hasInitializer() && GVar->hasExternalLinkage() && - GVar->getSection() == - BPFCoreSharedInfo::PatchableExtSecName) { - if (ImmVal == 0) - IsCandidate = true; - else - errs() << "WARNING: unhandled patchable extern " - << GVar->getName() << " with load offset " << ImmVal - << "\n"; } } } |

