22 lines · plain
1RUN: yaml2obj %p/Inputs/only-keep-sections.yaml -o %t.in.exe2 3RUN: llvm-objcopy --only-section .debug_discardable %t.in.exe %t.out.exe4RUN: llvm-objdump --section-headers -t %t.out.exe | FileCheck %s --check-prefixes=SECTIONS,SECTIONS-DEBUG,SYMBOLS,SYMBOLS-DEBUG5 6Adding another section stripping option makes it return the intersection of7kept 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.exe10RUN: llvm-objdump --section-headers -t %t.combination.exe | FileCheck %s --check-prefixes=SECTIONS,SECTIONS-TEXT,SYMBOLS,SYMBOLS-TEXT11 12SECTIONS: Sections:13SECTIONS-NEXT: Idx Name14SECTIONS-DEBUG-NEXT: .debug_discardable15SECTIONS-TEXT-NEXT: .text16SECTIONS-EMPTY:17 18SYMBOLS: SYMBOL TABLE:19SYMBOLS-DEBUG-NEXT: debug_discardable_sym20SYMBOLS-TEXT-NEXT: main21SYMBOLS-EMPTY:22