1 RUN: yaml2obj %p/Inputs/only-keep-sections.yaml > %t.in.exe
3 RUN: llvm-objcopy --only-section .debug_discardable %t.in.exe %t.out.exe
4 RUN: llvm-objdump --section-headers -t %t.out.exe | FileCheck %s --check-prefixes=SECTIONS,SECTIONS-DEBUG,SYMBOLS,SYMBOLS-DEBUG
6 Adding another section stripping option makes it return the intersection of
7 kept sections - in this case keeping only .text.
9 RUN: llvm-objcopy --only-section .debug_discardable --only-section .text --strip-debug %t.in.exe %t.combination.exe
10 RUN: llvm-objdump --section-headers -t %t.combination.exe | FileCheck %s --check-prefixes=SECTIONS,SECTIONS-TEXT,SYMBOLS,SYMBOLS-TEXT
13 SECTIONS-NEXT: Idx Name
14 SECTIONS-DEBUG-NEXT: .debug_discardable
15 SECTIONS-TEXT-NEXT: .text
18 SYMBOLS: SYMBOL TABLE:
19 SYMBOLS-DEBUG-NEXT: debug_discardable_sym
20 SYMBOLS-TEXT-NEXT: main