1 # RUN: yaml2obj %s > %t
2 # RUN: llvm-objcopy --strip-sections %t %t2
3 # RUN: llvm-readobj --file-headers --program-headers %t2 | FileCheck %s
4 # RUN: od -t x1 -j 4096 -N 12 %t2 | FileCheck %s --ignore-case --check-prefix=DATA
6 ## Sanity check the DATA-NOT line by showing that "fe ed fa ce" appears
7 ## if --strip-sections is not specified.
8 # RUN: llvm-objcopy %t %t3
9 # RUN: od -t x1 -j 4096 -N 12 %t3 | FileCheck %s --ignore-case --check-prefix=VALIDATE
11 ## Check that llvm-strip --strip-sections is equivalent to
12 ## llvm-objcopy --strip-sections.
13 # RUN: llvm-strip --strip-sections %t -o %t4
25 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
26 AddressAlign: 0x0000000000001000
28 - Name: .non_alloc_in_segment
32 - Name: .non_alloc_not_in_segment
41 - Section: .non_alloc_in_segment
43 # DATA: {{^[^[:blank:]]+}} de ad be ef ca fe ba be
44 # DATA-NOT: fe ed fa ce
46 # VALIDATE: {{^[^[:blank:]]+}} de ad be ef ca fe ba be fe ed fa ce
50 # CHECK-NEXT: Magic: (7F 45 4C 46)
51 # CHECK-NEXT: Class: 64-bit (0x2)
52 # CHECK-NEXT: DataEncoding: LittleEndian (0x1)
53 # CHECK-NEXT: FileVersion: 1
54 # CHECK-NEXT: OS/ABI: SystemV (0x0)
55 # CHECK-NEXT: ABIVersion: 0
56 # CHECK-NEXT: Unused: (00 00 00 00 00 00 00)
58 # CHECK-NEXT: Type: Executable (0x2)
59 # CHECK-NEXT: Machine: EM_X86_64 (0x3E)
60 # CHECK-NEXT: Version: 1
61 # CHECK-NEXT: Entry: 0x0
62 # CHECK-NEXT: ProgramHeaderOffset: 0x40
63 # CHECK-NEXT: SectionHeaderOffset: 0x0
64 # CHECK-NEXT: Flags [ (0x0)
66 # CHECK-NEXT: HeaderSize: 64
67 # CHECK-NEXT: ProgramHeaderEntrySize: 56
68 # CHECK-NEXT: ProgramHeaderCount: 1
69 # CHECK-NEXT: SectionHeaderEntrySize: 0
70 # CHECK-NEXT: SectionHeaderCount: 0
71 # CHECK-NEXT: StringTableSectionIndex: 0
74 # CHECK: ProgramHeaders [
75 # CHECK-NEXT: ProgramHeader {
76 # CHECK-NEXT: Type: PT_LOAD (0x1)
77 # CHECK-NEXT: Offset: 0x1000
78 # CHECK-NEXT: VirtualAddress: 0x0
79 # CHECK-NEXT: PhysicalAddress: 0x0
80 # CHECK-NEXT: FileSize: 8
81 # CHECK-NEXT: MemSize: 8
82 # CHECK-NEXT: Flags [ (0x5)
83 # CHECK-NEXT: PF_R (0x4)
84 # CHECK-NEXT: PF_X (0x1)
86 # CHECK-NEXT: Alignment: 4096