Jake Ehrlich | 1bfefc1 | 2017-11-13 22:13:08 +0000 | [diff] [blame] | 1 | # RUN: yaml2obj %s > %t |
Alexander Shaposhnikov | d7eaf27 | 2018-06-04 18:55:41 +0000 | [diff] [blame^] | 2 | # RUN: cp %t %t3 |
Jake Ehrlich | 1bfefc1 | 2017-11-13 22:13:08 +0000 | [diff] [blame] | 3 | # RUN: llvm-objcopy -strip-debug %t %t2 |
| 4 | # RUN: llvm-readobj -file-headers -sections -symbols %t2 | FileCheck %s |
| 5 | |
Alexander Shaposhnikov | d7eaf27 | 2018-06-04 18:55:41 +0000 | [diff] [blame^] | 6 | # Verify that the previous run of llvm-objcopy has not modified the input. |
| 7 | # RUN: cmp %t %t3 |
Alexander Shaposhnikov | cca6998 | 2018-05-07 19:32:09 +0000 | [diff] [blame] | 8 | |
Alexander Shaposhnikov | cca6998 | 2018-05-07 19:32:09 +0000 | [diff] [blame] | 9 | # RUN: llvm-strip -strip-debug %t3 |
Alexander Shaposhnikov | cca6998 | 2018-05-07 19:32:09 +0000 | [diff] [blame] | 10 | # RUN: cmp %t2 %t3 |
| 11 | |
Alexander Shaposhnikov | d7eaf27 | 2018-06-04 18:55:41 +0000 | [diff] [blame^] | 12 | # RUN: cp %t %t4 |
| 13 | # RUN: llvm-strip -d %t4 |
| 14 | # RUN: cmp %t2 %t4 |
| 15 | |
| 16 | # RUN: cp %t %t5 |
| 17 | # RUN: llvm-strip -g %t5 |
| 18 | # RUN: cmp %t2 %t5 |
| 19 | |
| 20 | # RUN: cp %t %t6 |
| 21 | # RUN: llvm-strip -S %t6 |
| 22 | # RUN: cmp %t2 %t6 |
| 23 | |
Jake Ehrlich | 1bfefc1 | 2017-11-13 22:13:08 +0000 | [diff] [blame] | 24 | !ELF |
| 25 | FileHeader: |
| 26 | Class: ELFCLASS64 |
| 27 | Data: ELFDATA2LSB |
| 28 | Type: ET_REL |
| 29 | Machine: EM_X86_64 |
| 30 | Sections: |
| 31 | - Name: .debugfoo |
| 32 | Type: SHT_PROGBITS |
| 33 | Content: "00000000" |
| 34 | - Name: .text |
| 35 | Type: SHT_PROGBITS |
| 36 | Flags: [ SHF_ALLOC, SHF_EXECINSTR ] |
| 37 | AddressAlign: 0x0000000000000010 |
| 38 | Content: "00000000" |
| 39 | Symbols: |
| 40 | Global: |
| 41 | - Name: foo |
| 42 | Section: .text |
| 43 | - Name: debugfoo |
| 44 | Section: .debugfoo |
| 45 | |
| 46 | # CHECK: SectionHeaderCount: 5 |
| 47 | |
| 48 | # CHECK: Name: .text |
| 49 | # CHECK: Name: .symtab |
| 50 | # CHECK: Name: .strtab |
| 51 | # CHECK: Name: .shstrtab |
| 52 | |
| 53 | # Check that *only* foo is copied and not debugfoo |
| 54 | # CHECK: Symbols [ |
| 55 | # CHECK-NEXT: Symbol { |
| 56 | # CHECK-NEXT: Name: |
| 57 | # CHECK-NEXT: Value: |
| 58 | # CHECK-NEXT: Size: |
| 59 | # CHECK-NEXT: Binding: |
| 60 | # CHECK-NEXT: Type: |
| 61 | # CHECK-NEXT: Other: |
| 62 | # CHECK-NEXT: Section: Undefined |
| 63 | # CHECK-NEXT: } |
| 64 | # CHECK-NEXT: Symbol { |
| 65 | # CHECK-NEXT: Name: foo |
| 66 | # CHECK-NEXT: Value: |
| 67 | # CHECK-NEXT: Size: |
| 68 | # CHECK-NEXT: Binding: Global |
| 69 | # CHECK-NEXT: Type: |
| 70 | # CHECK-NEXT: Other: |
| 71 | # CHECK-NEXT: Section: .text |
| 72 | # CHECK-NEXT: } |
| 73 | # CHECK-NEXT: ] |