• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1RUN: yaml2obj %p/Inputs/only-keep-sections.yaml -o %t.in.exe
2
3RUN: llvm-objcopy --only-section .debug_discardable %t.in.exe %t.out.exe
4RUN: llvm-objdump --section-headers -t %t.out.exe | FileCheck %s --check-prefixes=SECTIONS,SECTIONS-DEBUG,SYMBOLS,SYMBOLS-DEBUG
5
6Adding another section stripping option makes it return the intersection of
7kept sections - in this case keeping only .text.
8
9RUN: llvm-objcopy --only-section .debug_discardable --only-section .text --strip-debug %t.in.exe %t.combination.exe
10RUN: llvm-objdump --section-headers -t %t.combination.exe | FileCheck %s --check-prefixes=SECTIONS,SECTIONS-TEXT,SYMBOLS,SYMBOLS-TEXT
11
12SECTIONS:            Sections:
13SECTIONS-NEXT:       Idx Name
14SECTIONS-DEBUG-NEXT: .debug_discardable
15SECTIONS-TEXT-NEXT:  .text
16SECTIONS-EMPTY:
17
18SYMBOLS:            SYMBOL TABLE:
19SYMBOLS-DEBUG-NEXT: debug_discardable_sym
20SYMBOLS-TEXT-NEXT:  main
21SYMBOLS-EMPTY:
22