1 # RUN: yaml2obj %s -o %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 ## Validate 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
40 LastSec: .non_alloc_in_segment
42 # DATA: {{^[^[:blank:]]+}} de ad be ef ca fe ba be
43 # DATA-NOT: fe ed fa ce
45 # VALIDATE: {{^[^[:blank:]]+}} de ad be ef ca fe ba be fe ed fa ce
49 # CHECK-NEXT: Magic: (7F 45 4C 46)
50 # CHECK-NEXT: Class: 64-bit (0x2)
51 # CHECK-NEXT: DataEncoding: LittleEndian (0x1)
52 # CHECK-NEXT: FileVersion: 1
53 # CHECK-NEXT: OS/ABI: SystemV (0x0)
54 # CHECK-NEXT: ABIVersion: 0
55 # CHECK-NEXT: Unused: (00 00 00 00 00 00 00)
57 # CHECK-NEXT: Type: Executable (0x2)
58 # CHECK-NEXT: Machine: EM_X86_64 (0x3E)
59 # CHECK-NEXT: Version: 1
60 # CHECK-NEXT: Entry: 0x0
61 # CHECK-NEXT: ProgramHeaderOffset: 0x40
62 # CHECK-NEXT: SectionHeaderOffset: 0x0
63 # CHECK-NEXT: Flags [ (0x0)
65 # CHECK-NEXT: HeaderSize: 64
66 # CHECK-NEXT: ProgramHeaderEntrySize: 56
67 # CHECK-NEXT: ProgramHeaderCount: 1
68 # CHECK-NEXT: SectionHeaderEntrySize: 0
69 # CHECK-NEXT: SectionHeaderCount: 0
70 # CHECK-NEXT: StringTableSectionIndex: 0
73 # CHECK: ProgramHeaders [
74 # CHECK-NEXT: ProgramHeader {
75 # CHECK-NEXT: Type: PT_LOAD (0x1)
76 # CHECK-NEXT: Offset: 0x1000
77 # CHECK-NEXT: VirtualAddress: 0x0
78 # CHECK-NEXT: PhysicalAddress: 0x0
79 # CHECK-NEXT: FileSize: 8
80 # CHECK-NEXT: MemSize: 8
81 # CHECK-NEXT: Flags [ (0x5)
82 # CHECK-NEXT: PF_R (0x4)
83 # CHECK-NEXT: PF_X (0x1)
85 # CHECK-NEXT: Alignment: 4096