1# This test simply tests a simple but common real world example of overlapping 2# segments. 3 4# RUN: llvm-objcopy %p/Inputs/pt-phdr.elf %t 5# RUN: llvm-readobj -program-headers %t | FileCheck %s 6 7#CHECK: ProgramHeaders [ 8#CHECK-NEXT: ProgramHeader { 9#CHECK-NEXT: Type: PT_PHDR 10#CHECK-NEXT: Offset: 0x40 11#CHECK-NEXT: VirtualAddress: 0x200040 12#CHECK-NEXT: PhysicalAddress: 0x200040 13#CHECK-NEXT: FileSize: 280 14#CHECK-NEXT: MemSize: 280 15#CHECK-NEXT: Flags [ 16#CHECK-NEXT: PF_R 17#CHECK-NEXT: ] 18#CHECK-NEXT: Alignment: 8 19#CHECK-NEXT: } 20#CHECK-NEXT: ProgramHeader { 21#CHECK-NEXT: Type: PT_LOAD 22#CHECK-NEXT: Offset: 0x0 23#CHECK-NEXT: VirtualAddress: 0x200000 24#CHECK-NEXT: PhysicalAddress: 0x200000 25#CHECK-NEXT: FileSize: 344 26#CHECK-NEXT: MemSize: 344 27#CHECK-NEXT: Flags [ 28#CHECK-NEXT: PF_R 29#CHECK-NEXT: ] 30#CHECK-NEXT: Alignment: 4096 31#CHECK-NEXT: } 32#CHECK-NEXT: ProgramHeader { 33#CHECK-NEXT: Type: PT_LOAD 34#CHECK-NEXT: Offset: 0x1000 35#CHECK-NEXT: VirtualAddress: 0x201000 36#CHECK-NEXT: PhysicalAddress: 0x201000 37#CHECK-NEXT: FileSize: 1 38#CHECK-NEXT: MemSize: 1 39#CHECK-NEXT: Flags [ 40#CHECK-NEXT: PF_R 41#CHECK-NEXT: PF_X 42#CHECK-NEXT: ] 43#CHECK-NEXT: Alignment: 4096 44#CHECK-NEXT: } 45#CHECK-NEXT: ProgramHeader { 46#CHECK-NEXT: Type: PT_LOAD 47#CHECK-NEXT: Offset: 0x2000 48#CHECK-NEXT: VirtualAddress: 0x202000 49#CHECK-NEXT: PhysicalAddress: 0x202000 50#CHECK-NEXT: FileSize: 14 51#CHECK-NEXT: MemSize: 14 52#CHECK-NEXT: Flags [ 53#CHECK-NEXT: PF_R 54#CHECK-NEXT: PF_W 55#CHECK-NEXT: ] 56#CHECK-NEXT: Alignment: 4096 57#CHECK-NEXT: } 58#CHECK-NEXT: ProgramHeader { 59#CHECK-NEXT: Type: PT_GNU_STACK (0x6474E551) 60#CHECK-NEXT: Offset: 0x0 61#CHECK-NEXT: VirtualAddress: 0x0 62#CHECK-NEXT: PhysicalAddress: 0x0 63#CHECK-NEXT: FileSize: 0 64#CHECK-NEXT: MemSize: 0 65#CHECK-NEXT: Flags [ 66#CHECK-NEXT: PF_R 67#CHECK-NEXT: PF_W 68#CHECK-NEXT: ] 69#CHECK-NEXT: Alignment: 0 70#CHECK-NEXT: } 71#CHECK-NEXT:] 72