[BPF] Support weak global variables for BTF
authorYonghong Song <yhs@fb.com>
Sat, 7 Dec 2019 07:00:41 +0000 (23:00 -0800)
committerYonghong Song <yhs@fb.com>
Sat, 7 Dec 2019 16:58:19 +0000 (08:58 -0800)
commit5ea611daf9cb51ba3d6492e50a6b568348fb62c0
treeb57af16ead8b4d16e061c43759c20008d7158ee6
parentd714aa0dfdb16270fc279e8e91d4a83ace531529
[BPF] Support weak global variables for BTF

Generate types for global variables with "weak" attribute.
Keep allocation scope the same for both weak and non-weak
globals as ELF symbol table can determine whether a global
symbol is weak or not.

Differential Revision: https://reviews.llvm.org/D71162
llvm/lib/Target/BPF/BTFDebug.cpp
llvm/test/CodeGen/BPF/BTF/weak-global-2.ll [new file with mode: 0644]
llvm/test/CodeGen/BPF/BTF/weak-global.ll [new file with mode: 0644]