2017-10-11 02:47:09 +08:00
|
|
|
# RUN: yaml2obj %s > %t
|
2018-05-11 12:30:57 +08:00
|
|
|
# RUN: cp %t %t1
|
|
|
|
|
2018-04-24 13:43:32 +08:00
|
|
|
# RUN: llvm-objcopy -R .test2 %t %t2
|
2017-10-11 02:47:09 +08:00
|
|
|
# RUN: llvm-readobj -file-headers -sections %t2 | FileCheck %s
|
|
|
|
|
2018-05-11 12:30:57 +08:00
|
|
|
# Verify that the first run of llvm-objcopy
|
|
|
|
# has not modified the input binary.
|
|
|
|
# RUN: cmp %t %t1
|
|
|
|
|
|
|
|
# RUN: llvm-objcopy -remove-section=.test2 %t1 %t3
|
|
|
|
# RUN: cmp %t2 %t3
|
|
|
|
|
2017-10-11 02:47:09 +08:00
|
|
|
!ELF
|
|
|
|
FileHeader:
|
|
|
|
Class: ELFCLASS64
|
|
|
|
Data: ELFDATA2LSB
|
|
|
|
Type: ET_REL
|
|
|
|
Machine: EM_X86_64
|
|
|
|
Sections:
|
|
|
|
- Name: .test1
|
|
|
|
Type: SHT_PROGBITS
|
|
|
|
Flags: [ ]
|
|
|
|
- Name: .test2
|
|
|
|
Type: SHT_PROGBITS
|
|
|
|
Flags: [ ]
|
|
|
|
- Name: .test3
|
|
|
|
Type: SHT_PROGBITS
|
|
|
|
Flags: [ ]
|
|
|
|
|
|
|
|
# CHECK: SectionHeaderCount: 6
|
|
|
|
|
|
|
|
# CHECK: Sections [
|
|
|
|
# CHECK: Section {
|
|
|
|
# CHECK: Index: 0
|
|
|
|
# CHECK: Name: (0)
|
|
|
|
# CHECK: Type: SHT_NULL (0x0)
|
|
|
|
# CHECK: Flags [ (0x0)
|
|
|
|
# CHECK: ]
|
|
|
|
# CHECK: Address: 0x0
|
|
|
|
# CHECK: Offset:
|
|
|
|
# CHECK: Size:
|
|
|
|
# CHECK: Link: 0
|
|
|
|
# CHECK: Info: 0
|
|
|
|
# CHECK: AddressAlignment: 0
|
|
|
|
# CHECK: EntrySize: 0
|
|
|
|
# CHECK: }
|
|
|
|
# CHECK: Section {
|
|
|
|
# CHECK: Index: 1
|
|
|
|
# CHECK: Name: .test1
|
|
|
|
# CHECK: Type: SHT_PROGBITS (0x1)
|
|
|
|
# CHECK: Flags [ (0x0)
|
|
|
|
# CHECK: ]
|
|
|
|
# CHECK: Address: 0x0
|
|
|
|
# CHECK: Offset:
|
|
|
|
# CHECK: Size:
|
|
|
|
# CHECK: Link: 0
|
|
|
|
# CHECK: Info: 0
|
|
|
|
# CHECK: AddressAlignment: 0
|
|
|
|
# CHECK: EntrySize: 0
|
|
|
|
# CHECK: }
|
|
|
|
# CHECK: Section {
|
|
|
|
# CHECK: Index: 2
|
|
|
|
# CHECK: Name: .test3
|
|
|
|
# CHECK: Type: SHT_PROGBITS (0x1)
|
|
|
|
# CHECK: Flags [ (0x0)
|
|
|
|
# CHECK: ]
|
|
|
|
# CHECK: Address: 0x0
|
|
|
|
# CHECK: Offset:
|
|
|
|
# CHECK: Size:
|
|
|
|
# CHECK: Link: 0
|
|
|
|
# CHECK: Info: 0
|
|
|
|
# CHECK: AddressAlignment: 0
|
|
|
|
# CHECK: EntrySize: 0
|
|
|
|
# CHECK: }
|
|
|
|
# CHECK: Section {
|
|
|
|
# CHECK: Index: 3
|
|
|
|
# CHECK: Name: .symtab
|
|
|
|
# CHECK: Type: SHT_SYMTAB (0x2)
|
|
|
|
# CHECK: Flags [ (0x0)
|
|
|
|
# CHECK: ]
|
|
|
|
# CHECK: Address: 0x0
|
|
|
|
# CHECK: Offset:
|
|
|
|
# CHECK: Size:
|
|
|
|
# CHECK: Link: 4
|
|
|
|
# CHECK: Info: 1
|
|
|
|
# CHECK: AddressAlignment: 8
|
|
|
|
# CHECK: EntrySize: 24
|
|
|
|
# CHECK: }
|
|
|
|
# CHECK: Section {
|
|
|
|
# CHECK: Index: 4
|
|
|
|
# CHECK: Name: .strtab
|
|
|
|
# CHECK: Type: SHT_STRTAB (0x3)
|
|
|
|
# CHECK: Flags [ (0x0)
|
|
|
|
# CHECK: ]
|
|
|
|
# CHECK: Address: 0x0
|
|
|
|
# CHECK: Offset:
|
|
|
|
# CHECK: Size:
|
|
|
|
# CHECK: Link: 0
|
|
|
|
# CHECK: Info: 0
|
|
|
|
# CHECK: AddressAlignment: 1
|
|
|
|
# CHECK: EntrySize: 0
|
|
|
|
# CHECK: }
|
|
|
|
# CHECK: Section {
|
|
|
|
# CHECK: Index: 5
|
|
|
|
# CHECK: Name: .shstrtab
|
|
|
|
# CHECK: Type: SHT_STRTAB (0x3)
|
|
|
|
# CHECK: Flags [ (0x0)
|
|
|
|
# CHECK: ]
|
|
|
|
# CHECK: Address: 0x0
|
|
|
|
# CHECK: Offset:
|
|
|
|
# CHECK: Size:
|
|
|
|
# CHECK: Link: 0
|
|
|
|
# CHECK: Info: 0
|
|
|
|
# CHECK: AddressAlignment: 1
|
|
|
|
# CHECK: EntrySize: 0
|
|
|
|
# CHECK: }
|
|
|
|
# CHECK: ]
|