blob: 42492ed80ff95760cae718f9cb12f6efb80a025f [file] [log] [blame]
Martin Storsjoe8305172019-01-19 19:42:54 +00001RUN: yaml2obj %p/Inputs/only-keep-sections.yaml > %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: