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 --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 --check-prefix=VALIDATE
20 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
21 AddressAlign: 0x0000000000001000
23 - Name: .non_alloc_in_segment
27 - Name: .non_alloc_not_in_segment
36 - Section: .non_alloc_in_segment
38 # DATA: {{^[^[:blank:]]+}} de ad be ef ca fe ba be
39 # DATA-NOT: fe ed fa ce
41 # VALIDATE: {{^[^[:blank:]]+}} de ad be ef ca fe ba be fe ed fa ce
45 # CHECK-NEXT: Magic: (7F 45 4C 46)
46 # CHECK-NEXT: Class: 64-bit (0x2)
47 # CHECK-NEXT: DataEncoding: LittleEndian (0x1)
48 # CHECK-NEXT: FileVersion: 1
49 # CHECK-NEXT: OS/ABI: SystemV (0x0)
50 # CHECK-NEXT: ABIVersion: 0
51 # CHECK-NEXT: Unused: (00 00 00 00 00 00 00)
53 # CHECK-NEXT: Type: Executable (0x2)
54 # CHECK-NEXT: Machine: EM_X86_64 (0x3E)
55 # CHECK-NEXT: Version: 1
56 # CHECK-NEXT: Entry: 0x0
57 # CHECK-NEXT: ProgramHeaderOffset: 0x40
58 # CHECK-NEXT: SectionHeaderOffset: 0x0
59 # CHECK-NEXT: Flags [ (0x0)
61 # CHECK-NEXT: HeaderSize: 64
62 # CHECK-NEXT: ProgramHeaderEntrySize: 56
63 # CHECK-NEXT: ProgramHeaderCount: 1
64 # CHECK-NEXT: SectionHeaderEntrySize: 0
65 # CHECK-NEXT: SectionHeaderCount: 0
66 # CHECK-NEXT: StringTableSectionIndex: 0
69 # CHECK: ProgramHeaders [
70 # CHECK-NEXT: ProgramHeader {
71 # CHECK-NEXT: Type: PT_LOAD (0x1)
72 # CHECK-NEXT: Offset: 0x1000
73 # CHECK-NEXT: VirtualAddress: 0x0
74 # CHECK-NEXT: PhysicalAddress: 0x0
75 # CHECK-NEXT: FileSize: 8
76 # CHECK-NEXT: MemSize: 8
77 # CHECK-NEXT: Flags [ (0x5)
78 # CHECK-NEXT: PF_R (0x4)
79 # CHECK-NEXT: PF_X (0x1)
81 # CHECK-NEXT: Alignment: 4096