1 # RUN: yaml2obj %s -o %t 2 # RUN: llvm-objcopy %t %t2 3 # RUN: llvm-readobj -program-headers %t2 | FileCheck %s 4 5 !ELF 6 FileHeader: 7 Class: ELFCLASS64 8 Data: ELFDATA2LSB 9 Type: ET_EXEC 10 Machine: EM_X86_64 11 Sections: 12 - Name: .text 13 Type: SHT_PROGBITS 14 Flags: [ SHF_ALLOC, SHF_EXECINSTR ] 15 Address: 0x1000 16 AddressAlign: 0x0000000000001000 17 Content: "c3c3c3c3" 18 - Name: .data 19 Type: SHT_PROGBITS 20 Flags: [ SHF_ALLOC ] 21 Address: 0x1008 22 AddressAlign: 0x0000000000000008 23 Content: "3232" 24 ProgramHeaders: 25 - Type: PT_LOAD 26 Flags: [ PF_X, PF_R ] 27 VAddr: 0x1000 28 PAddr: 0x1000 29 Align: 0x1000 30 Sections: 31 - Section: .text 32 - Type: PT_LOAD 33 Flags: [ PF_R, PF_W ] 34 VAddr: 0x1008 35 PAddr: 0x1008 36 Align: 0x1000 37 Sections: 38 - Section: .data 39 40 #CHECK: ProgramHeaders [ 41 #CHECK-NEXT: ProgramHeader { 42 #CHECK-NEXT: Type: PT_LOAD 43 #CHECK-NEXT: Offset: 0x1000 44 #CHECK-NEXT: VirtualAddress: 0x1000 45 #CHECK-NEXT: PhysicalAddress: 0x1000 46 #CHECK-NEXT: FileSize: 4 47 #CHECK-NEXT: MemSize: 4 48 #CHECK-NEXT: Flags [ 49 #CHECK-NEXT: PF_R 50 #CHECK-NEXT: PF_X 51 #CHECK-NEXT: ] 52 #CHECK-NEXT: Alignment: 4096 53 #CHECK-NEXT: } 54 #CHECK-NEXT: ProgramHeader { 55 #CHECK-NEXT: Type: PT_LOAD 56 #CHECK-NEXT: Offset: 0x1008 57 #CHECK-NEXT: VirtualAddress: 0x1008 58 #CHECK-NEXT: PhysicalAddress: 0x1008 59 #CHECK-NEXT: FileSize: 2 60 #CHECK-NEXT: MemSize: 2 61 #CHECK-NEXT: Flags [ 62 #CHECK-NEXT: PF_R 63 #CHECK-NEXT: PF_W 64 #CHECK-NEXT: ] 65 #CHECK-NEXT: Alignment: 4096 66 #CHECK-NEXT: } 67 #CHECK-NEXT:] 68