| 1 |
# RUN: yaml2obj %s -o %t |
| 2 |
# RUN: llvm-objcopy --strip-all-gnu --allow-broken-links %t %t2 |
| 3 |
# RUN: llvm-strip --strip-all-gnu --allow-broken-links %t -o %t3 |
| 4 |
# RUN: llvm-readobj --file-headers --sections %t2 | FileCheck %s |
| 5 |
# RUN: cmp %t2 %t3 |
| 6 |
|
| 7 |
# Show that the debug section in a segment was removed, to match GNU. |
| 8 |
# First validate that the offset in use is correct. |
| 9 |
# RUN: llvm-objcopy %t %t4 |
| 10 |
# RUN: od -t x1 -N 4 -j 120 %t4 | FileCheck %s --ignore-case --check-prefix=COPY-BYTES |
| 11 |
# RUN: od -t x1 -N 4 -j 120 %t2 | FileCheck %s --ignore-case --check-prefix=STRIP-BYTES |
| 12 |
|
| 13 |
!ELF |
| 14 |
FileHeader: |
| 15 |
Class: ELFCLASS64 |
| 16 |
Data: ELFDATA2LSB |
| 17 |
Type: ET_REL |
| 18 |
Machine: EM_X86_64 |
| 19 |
Sections: |
| 20 |
- Name: .debug_in_segment |
| 21 |
Type: SHT_PROGBITS |
| 22 |
Flags: [ ] |
| 23 |
Content: "deadbeef" |
| 24 |
- Name: .dynstr |
| 25 |
Type: SHT_STRTAB |
| 26 |
Flags: [ SHF_ALLOC ] |
| 27 |
- Name: .symtab |
| 28 |
Type: SHT_SYMTAB |
| 29 |
Flags: [ SHF_ALLOC ] |
| 30 |
- Name: .text |
| 31 |
Type: SHT_PROGBITS |
| 32 |
Flags: [ SHF_ALLOC, SHF_EXECINSTR ] |
| 33 |
Size: 4 |
| 34 |
- Name: .debug_info |
| 35 |
Type: SHT_PROGBITS |
| 36 |
Flags: [ ] |
| 37 |
AddressAlign: 0x1 |
| 38 |
Size: 4 |
| 39 |
- Name: .debug_loc |
| 40 |
Type: SHT_PROGBITS |
| 41 |
Flags: [ SHF_ALLOC ] |
| 42 |
AddressAlign: 0x1 |
| 43 |
Size: 4 |
| 44 |
- Name: .comment |
| 45 |
Type: SHT_PROGBITS |
| 46 |
- Name: .random_section_name |
| 47 |
Type: SHT_PROGBITS |
| 48 |
- Name: .debug_not_a_real_debug_section |
| 49 |
Type: SHT_PROGBITS |
| 50 |
- Name: .rel.text |
| 51 |
Type: SHT_REL |
| 52 |
Info: .text |
| 53 |
- Name: .rela.text |
| 54 |
Type: SHT_RELA |
| 55 |
Info: .text |
| 56 |
ProgramHeaders: |
| 57 |
# Use an arbitrary segment type to show that the segment type is unimportant. |
| 58 |
- Type: 0x61234567 |
| 59 |
FirstSec: .debug_in_segment |
| 60 |
LastSec: .debug_in_segment |
| 61 |
|
| 62 |
# CHECK: SectionHeaderCount: 8 |
| 63 |
|
| 64 |
# CHECK: Name: .dynstr |
| 65 |
# CHECK: Name: .symtab |
| 66 |
# CHECK: Name: .text |
| 67 |
# CHECK: Name: .debug_loc |
| 68 |
# CHECK: Name: .comment |
| 69 |
# CHECK: Name: .random_section_name |
| 70 |
# CHECK: Name: .shstrtab |
| 71 |
|
| 72 |
# COPY-BYTES: de ad be ef |
| 73 |
# STRIP-BYTES: 00 00 00 00 |