Martin Storsjo | e830517 | 2019-01-19 19:42:54 +0000 | [diff] [blame] | 1 | RUN: yaml2obj %p/Inputs/only-keep-sections.yaml > %t.in.exe |
| 2 | |
| 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 |
| 5 | |
| 6 | Adding another section stripping option makes it return the intersection of |
| 7 | kept sections - in this case keeping only .text. |
| 8 | |
| 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 |
| 11 | |
| 12 | SECTIONS: Sections: |
| 13 | SECTIONS-NEXT: Idx Name |
| 14 | SECTIONS-DEBUG-NEXT: .debug_discardable |
| 15 | SECTIONS-TEXT-NEXT: .text |
| 16 | SECTIONS-EMPTY: |
| 17 | |
| 18 | SYMBOLS: SYMBOL TABLE: |
| 19 | SYMBOLS-DEBUG-NEXT: debug_discardable_sym |
| 20 | SYMBOLS-TEXT-NEXT: main |
| 21 | SYMBOLS-EMPTY: |