summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/BPF/BTFDebug.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/BPF/BTFDebug.cpp')
-rw-r--r--llvm/lib/Target/BPF/BTFDebug.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Target/BPF/BTFDebug.cpp b/llvm/lib/Target/BPF/BTFDebug.cpp
index db551e739bd..b2d5fc307ad 100644
--- a/llvm/lib/Target/BPF/BTFDebug.cpp
+++ b/llvm/lib/Target/BPF/BTFDebug.cpp
@@ -1076,6 +1076,11 @@ void BTFDebug::processGlobals(bool ProcessingMapDef) {
SmallVector<DIGlobalVariableExpression *, 1> GVs;
Global.getDebugInfo(GVs);
+
+ // No type information, mostly internal, skip it.
+ if (GVs.size() == 0)
+ continue;
+
uint32_t GVTypeId = 0;
for (auto *GVE : GVs) {
if (SecName.startswith(".maps"))
@@ -1087,7 +1092,7 @@ void BTFDebug::processGlobals(bool ProcessingMapDef) {
// Only support the following globals:
// . static variables
- // . non-static global variables with section attributes
+ // . non-static global variables
// Essentially means:
// . .bcc/.data/.rodata DataSec entities only contain static data
// . Other DataSec entities contain static or initialized global data.
@@ -1096,7 +1101,7 @@ void BTFDebug::processGlobals(bool ProcessingMapDef) {
// corresponding ELF section flags.
auto Linkage = Global.getLinkage();
if (Linkage != GlobalValue::InternalLinkage &&
- (Linkage != GlobalValue::ExternalLinkage || !Global.hasSection()))
+ Linkage != GlobalValue::ExternalLinkage)
continue;
uint32_t GVarInfo = Linkage == GlobalValue::ExternalLinkage
OpenPOWER on IntegriCloud