Index: lib/Target/BPF/BTFDebug.cpp
===================================================================
--- lib/Target/BPF/BTFDebug.cpp
+++ lib/Target/BPF/BTFDebug.cpp
@@ -546,6 +546,10 @@
 }
 
 void BTFDebug::emitBTFSection() {
+  // Do not emit section if no types and only "" string.
+  if (!TypeEntries.size() && StringTable.getSize() == 1)
+    return;
+
   MCContext &Ctx = OS.getContext();
   OS.SwitchSection(Ctx.getELFSection(".BTF", ELF::SHT_PROGBITS, 0));
 
@@ -578,6 +582,10 @@
 }
 
 void BTFDebug::emitBTFExtSection() {
+  // Do not emit section if empty FuncInfoTable and LineInfoTable.
+  if (!FuncInfoTable.size() && !LineInfoTable.size())
+    return;
+
   MCContext &Ctx = OS.getContext();
   OS.SwitchSection(Ctx.getELFSection(".BTF.ext", ELF::SHT_PROGBITS, 0));
 
Index: test/CodeGen/BPF/BTF/array-1d-char.ll
===================================================================
--- test/CodeGen/BPF/BTF/array-1d-char.ll
+++ test/CodeGen/BPF/BTF/array-1d-char.ll
@@ -40,17 +40,6 @@
 ; CHECK-NEXT:        .byte   0
 ; CHECK-NEXT:        .ascii  "char"                  # string offset=21
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/array-1d-int.ll
===================================================================
--- test/CodeGen/BPF/BTF/array-1d-int.ll
+++ test/CodeGen/BPF/BTF/array-1d-int.ll
@@ -40,17 +40,6 @@
 ; CHECK-NEXT:        .byte   0
 ; CHECK-NEXT:        .ascii  "int"                   # string offset=21
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/array-2d-int.ll
===================================================================
--- test/CodeGen/BPF/BTF/array-2d-int.ll
+++ test/CodeGen/BPF/BTF/array-2d-int.ll
@@ -40,17 +40,6 @@
 ; CHECK-NEXT:        .byte   0
 ; CHECK-NEXT:        .ascii  "int"                   # string offset=21
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/array-size-0.ll
===================================================================
--- test/CodeGen/BPF/BTF/array-size-0.ll
+++ test/CodeGen/BPF/BTF/array-size-0.ll
@@ -42,17 +42,6 @@
 ; CHECK-NEXT:        .byte   0
 ; CHECK-NEXT:        .byte   116                     # string offset=21
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 2, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/array-typedef.ll
===================================================================
--- test/CodeGen/BPF/BTF/array-typedef.ll
+++ test/CodeGen/BPF/BTF/array-typedef.ll
@@ -52,17 +52,6 @@
 ; CHECK-NEXT:        .byte   0
 ; CHECK-NEXT:        .ascii  "unsigned int"          # string offset=32
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 3, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/char.ll
===================================================================
--- test/CodeGen/BPF/BTF/char.ll
+++ test/CodeGen/BPF/BTF/char.ll
@@ -28,17 +28,6 @@
 ; CHECK-NEXT:        .byte   0                       # string offset=0
 ; CHECK-NEXT:        .ascii  "char"                  # string offset=1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/empty-btf.ll
===================================================================
--- /dev/null
+++ test/CodeGen/BPF/BTF/empty-btf.ll
@@ -0,0 +1,22 @@
+; RUN: llc -march=bpfel -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
+; RUN: llc -march=bpfeb -filetype=asm -o - %s | FileCheck -check-prefixes=CHECK %s
+
+; Source code:
+;   int test(int arg) { return arg; }
+; Compilation flag:
+;   clang -target bpf -O2 -S -emit-llvm t.c
+
+; Function Attrs: norecurse nounwind readnone
+define dso_local i32 @test(i32 returned) local_unnamed_addr #0 {
+  ret i32 %0
+}
+
+; CHECK-NOT: BTF
+
+attributes #0 = { norecurse nounwind readnone }
+
+!llvm.module.flags = !{!0}
+!llvm.ident = !{!1}
+
+!0 = !{i32 1, !"wchar_size", i32 4}
+!1 = !{!"clang version 8.0.20181009 "}
Index: test/CodeGen/BPF/BTF/enum-basic.ll
===================================================================
--- test/CodeGen/BPF/BTF/enum-basic.ll
+++ test/CodeGen/BPF/BTF/enum-basic.ll
@@ -33,17 +33,6 @@
 ; CHECK-NEXT:        .byte   0
 ; CHECK-NEXT:        .byte   66                      # string offset=3
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !5, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/fwd-no-define.ll
===================================================================
--- test/CodeGen/BPF/BTF/fwd-no-define.ll
+++ test/CodeGen/BPF/BTF/fwd-no-define.ll
@@ -44,17 +44,6 @@
 ; CHECK-NEXT:        .byte   0
 ; CHECK-NEXT:        .ascii  "t1"                    # string offset=6
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 2, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/fwd-with-define.ll
===================================================================
--- test/CodeGen/BPF/BTF/fwd-with-define.ll
+++ test/CodeGen/BPF/BTF/fwd-with-define.ll
@@ -38,17 +38,6 @@
 ; CHECK-NEXT:        .byte   0
 ; CHECK-NEXT:        .byte   112                     # string offset=4
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 2, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/int.ll
===================================================================
--- test/CodeGen/BPF/BTF/int.ll
+++ test/CodeGen/BPF/BTF/int.ll
@@ -28,17 +28,6 @@
 ; CHECK-NEXT:        .byte   0                       # string offset=0
 ; CHECK-NEXT:        .ascii  "int"                   # string offset=1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/longlong.ll
===================================================================
--- test/CodeGen/BPF/BTF/longlong.ll
+++ test/CodeGen/BPF/BTF/longlong.ll
@@ -28,17 +28,6 @@
 ; CHECK-NEXT:        .byte   0                       # string offset=0
 ; CHECK-NEXT:        .ascii  "long long int"         # string offset=1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/ptr-const-void.ll
===================================================================
--- test/CodeGen/BPF/BTF/ptr-const-void.ll
+++ test/CodeGen/BPF/BTF/ptr-const-void.ll
@@ -28,17 +28,6 @@
 ; CHECK-NEXT:        .long   167772160               # 0xa000000
 ; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .byte   0                       # string offset=0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "p", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/ptr-func-1.ll
===================================================================
--- test/CodeGen/BPF/BTF/ptr-func-1.ll
+++ test/CodeGen/BPF/BTF/ptr-func-1.ll
@@ -28,17 +28,6 @@
 ; CHECK-NEXT:        .long   218103808               # 0xd000000
 ; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .byte   0                       # string offset=0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/ptr-func-2.ll
===================================================================
--- test/CodeGen/BPF/BTF/ptr-func-2.ll
+++ test/CodeGen/BPF/BTF/ptr-func-2.ll
@@ -44,17 +44,6 @@
 ; CHECK-NEXT:        .byte   0
 ; CHECK-NEXT:        .ascii  "char"                  # string offset=5
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/ptr-func-3.ll
===================================================================
--- test/CodeGen/BPF/BTF/ptr-func-3.ll
+++ test/CodeGen/BPF/BTF/ptr-func-3.ll
@@ -44,17 +44,6 @@
 ; CHECK-NEXT:        .byte   0
 ; CHECK-NEXT:        .ascii  "int"                   # string offset=7
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 2, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/ptr-int.ll
===================================================================
--- test/CodeGen/BPF/BTF/ptr-int.ll
+++ test/CodeGen/BPF/BTF/ptr-int.ll
@@ -31,18 +31,6 @@
 ; CHECK-NEXT:        .byte   0                       # string offset=0
 ; CHECK-NEXT:        .ascii  "int"                   # string offset=1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
-
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/ptr-void.ll
===================================================================
--- test/CodeGen/BPF/BTF/ptr-void.ll
+++ test/CodeGen/BPF/BTF/ptr-void.ll
@@ -25,17 +25,6 @@
 ; CHECK-NEXT:        .long   33554432                # 0x2000000
 ; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .byte   0                       # string offset=0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/ptr-volatile-const-void.ll
===================================================================
--- test/CodeGen/BPF/BTF/ptr-volatile-const-void.ll
+++ test/CodeGen/BPF/BTF/ptr-volatile-const-void.ll
@@ -31,17 +31,6 @@
 ; CHECK-NEXT:        .long   150994944               # 0x9000000
 ; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .byte   0                       # string offset=0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "p", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/ptr-volatile-void.ll
===================================================================
--- test/CodeGen/BPF/BTF/ptr-volatile-void.ll
+++ test/CodeGen/BPF/BTF/ptr-volatile-void.ll
@@ -28,17 +28,6 @@
 ; CHECK-NEXT:        .long   150994944               # 0x9000000
 ; CHECK-NEXT:        .long   0
 ; CHECK-NEXT:        .byte   0                       # string offset=0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "p", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/restrict-ptr.ll
===================================================================
--- test/CodeGen/BPF/BTF/restrict-ptr.ll
+++ test/CodeGen/BPF/BTF/restrict-ptr.ll
@@ -34,17 +34,6 @@
 ; CHECK-NEXT:        .byte   0                       # string offset=0
 ; CHECK-NEXT:        .ascii  "int"                   # string offset=1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "p", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/short.ll
===================================================================
--- test/CodeGen/BPF/BTF/short.ll
+++ test/CodeGen/BPF/BTF/short.ll
@@ -29,17 +29,6 @@
 ; CHECK-NEXT:        .byte   0                       # string offset=0
 ; CHECK-NEXT:        .ascii  "short"                 # string offset=1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/struct-anon.ll
===================================================================
--- test/CodeGen/BPF/BTF/struct-anon.ll
+++ test/CodeGen/BPF/BTF/struct-anon.ll
@@ -45,17 +45,6 @@
 ; CHECK-NEXT:        .byte   0
 ; CHECK-NEXT:        .ascii  "int"                   # string offset=3
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/struct-basic.ll
===================================================================
--- test/CodeGen/BPF/BTF/struct-basic.ll
+++ test/CodeGen/BPF/BTF/struct-basic.ll
@@ -51,17 +51,6 @@
 ; CHECK-NEXT:        .byte   0
 ; CHECK-NEXT:        .ascii  "int"                   # string offset=15
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/struct-bitfield-typedef.ll
===================================================================
--- test/CodeGen/BPF/BTF/struct-bitfield-typedef.ll
+++ test/CodeGen/BPF/BTF/struct-bitfield-typedef.ll
@@ -66,17 +66,6 @@
 ; CHECK-NEXT:        .byte   0
 ; CHECK-NEXT:        .ascii  "int"                   # string offset=23
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 3, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/struct-enum.ll
===================================================================
--- test/CodeGen/BPF/BTF/struct-enum.ll
+++ test/CodeGen/BPF/BTF/struct-enum.ll
@@ -53,17 +53,6 @@
 ; CHECK-NEXT:        .byte   0
 ; CHECK-NEXT:        .byte   66                      # string offset=13
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 2, type: !11, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/uchar.ll
===================================================================
--- test/CodeGen/BPF/BTF/uchar.ll
+++ test/CodeGen/BPF/BTF/uchar.ll
@@ -28,17 +28,6 @@
 ; CHECK-NEXT:        .byte   0                       # string offset=0
 ; CHECK-NEXT:        .ascii  "unsigned char"         # string offset=1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/uint.ll
===================================================================
--- test/CodeGen/BPF/BTF/uint.ll
+++ test/CodeGen/BPF/BTF/uint.ll
@@ -28,17 +28,6 @@
 ; CHECK-NEXT:        .byte   0                       # string offset=0
 ; CHECK-NEXT:        .ascii  "unsigned int"          # string offset=1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/ulonglong.ll
===================================================================
--- test/CodeGen/BPF/BTF/ulonglong.ll
+++ test/CodeGen/BPF/BTF/ulonglong.ll
@@ -28,17 +28,6 @@
 ; CHECK-NEXT:        .byte   0                       # string offset=0
 ; CHECK-NEXT:        .ascii  "long long unsigned int" # string offset=1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/union-array-typedef.ll
===================================================================
--- test/CodeGen/BPF/BTF/union-array-typedef.ll
+++ test/CodeGen/BPF/BTF/union-array-typedef.ll
@@ -69,17 +69,6 @@
 ; CHECK-NEXT:        .byte   0
 ; CHECK-NEXT:        .ascii  "int"                   # string offset=37
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 2, type: !6, isLocal: false, isDefinition: true)
Index: test/CodeGen/BPF/BTF/ushort.ll
===================================================================
--- test/CodeGen/BPF/BTF/ushort.ll
+++ test/CodeGen/BPF/BTF/ushort.ll
@@ -28,17 +28,6 @@
 ; CHECK-NEXT:        .byte   0                       # string offset=0
 ; CHECK-NEXT:        .ascii  "unsigned short"        # string offset=1
 ; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .section        .BTF.ext,"",@progbits
-; CHECK-NEXT:        .short  60319                   # 0xeb9f
-; CHECK-NEXT:        .byte   1
-; CHECK-NEXT:        .byte   0
-; CHECK-NEXT:        .long   24
-; CHECK-NEXT:        .long   0
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   4
-; CHECK-NEXT:        .long   8                       # FuncInfo
-; CHECK-NEXT:        .long   16                      # LineInfo
 
 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
 !1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)