1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/test/tools/llvm-objcopy/remove-symtab.test
Jake Ehrlich c58d77a269 [llvm-objcopy] Add support for removing sections
This change adds support for removing sections using the -R field (as
GNU objcopy does as well). This change should let us add many helpful
tests and is a proper stepping stone for adding more general kinds of
stripping.

Differential Revision: https://reviews.llvm.org/D38260

llvm-svn: 315346
2017-10-10 18:47:09 +00:00

58 lines
1.5 KiB
Plaintext

# RUN: yaml2obj %s > %t
# RUN: llvm-objcopy -R .symtab %t %t2
# RUN: llvm-readobj -file-headers -sections %t2 | FileCheck %s
!ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
#CHECK: SectionHeaderCount: 3
#CHECK: Sections [
#CHECK-NEXT: Section {
#CHECK-NEXT: Index: 0
#CHECK-NEXT: Name: (0)
#CHECK-NEXT: Type: SHT_NULL (0x0)
#CHECK-NEXT: Flags [ (0x0)
#CHECK-NEXT: ]
#CHECK-NEXT: Address: 0x0
#CHECK-NEXT: Offset: 0x0
#CHECK-NEXT: Size: 0
#CHECK-NEXT: Link: 0
#CHECK-NEXT: Info: 0
#CHECK-NEXT: AddressAlignment: 0
#CHECK-NEXT: EntrySize: 0
#CHECK-NEXT: }
#CHECK-NEXT: Section {
#CHECK-NEXT: Index: 1
#CHECK-NEXT: Name: .strtab
#CHECK-NEXT: Type: SHT_STRTAB (0x3)
#CHECK-NEXT: Flags [ (0x0)
#CHECK-NEXT: ]
#CHECK-NEXT: Address: 0x0
#CHECK-NEXT: Offset:
#CHECK-NEXT: Size: 1
#CHECK-NEXT: Link: 0
#CHECK-NEXT: Info: 0
#CHECK-NEXT: AddressAlignment: 1
#CHECK-NEXT: EntrySize: 0
#CHECK-NEXT: }
#CHECK-NEXT: Section {
#CHECK-NEXT: Index: 2
#CHECK-NEXT: Name: .shstrtab (1)
#CHECK-NEXT: Type: SHT_STRTAB (0x3)
#CHECK-NEXT: Flags [ (0x0)
#CHECK-NEXT: ]
#CHECK-NEXT: Address: 0x0
#CHECK-NEXT: Offset:
#CHECK-NEXT: Size:
#CHECK-NEXT: Link: 0
#CHECK-NEXT: Info: 0
#CHECK-NEXT: AddressAlignment: 1
#CHECK-NEXT: EntrySize: 0
#CHECK-NEXT: }
#CHECK-NEXT: ]