[BPF] put not-section-attribute externs into BTF ".extern" data section
authorYonghong Song <yhs@fb.com>
Tue, 10 Dec 2019 19:05:22 +0000 (11:05 -0800)
committerYonghong Song <yhs@fb.com>
Tue, 10 Dec 2019 19:45:17 +0000 (11:45 -0800)
commit7d0e8930ed08b5f938a317f13d8fc994dd8c551c
treedfbf1dd3217f19e1e03fea5e0e7864415a8a85e1
parentd0789e6346e489cd84b37ec58964feb0db015de7
[BPF] put not-section-attribute externs into BTF ".extern" data section

Currently for extern variables with section attribute, those
BTF_KIND_VARs will not be placed in any DataSec. This is
inconvenient as any other generated BTF_KIND_VAR belongs to
one DataSec. This patch put these extern variables into
".extern" section so bpf loader can have a consistent
processing mechanism for all data sections and variables.
llvm/lib/Target/BPF/BTFDebug.cpp
llvm/test/CodeGen/BPF/BTF/extern-var-func-weak.ll
llvm/test/CodeGen/BPF/BTF/extern-var-func.ll
llvm/test/CodeGen/BPF/BTF/extern-var-struct-weak.ll
llvm/test/CodeGen/BPF/BTF/extern-var-struct.ll