2013-05-11 00:44:02 +08:00
|
|
|
# This test checks emission for program header for ELF binaries
|
2013-04-05 02:59:24 +08:00
|
|
|
RUN: lld -flavor gnu -target i386-linux -o %t1 -e main %p/Inputs/phdr.i386 \
|
2013-04-12 12:29:01 +08:00
|
|
|
RUN: && llvm-readobj -program-headers %t1 | FileCheck -check-prefix=I386 %s
|
2013-04-05 02:59:24 +08:00
|
|
|
RUN: lld -flavor gnu -target x86_64-linux -o %t1 -e _start %p/Inputs/relocs.x86-64 -static \
|
|
|
|
RUN: && llvm-objdump -p %t1 | FileCheck %s -check-prefix=X86_64
|
2013-01-26 07:23:24 +08:00
|
|
|
|
2012-11-22 05:07:36 +08:00
|
|
|
|
2013-04-12 12:29:01 +08:00
|
|
|
I386: ProgramHeaders [
|
|
|
|
I386-NEXT: ProgramHeader {
|
|
|
|
I386-NEXT: Type: PT_PHDR (0x6)
|
|
|
|
I386-NEXT: Offset: 0x34
|
|
|
|
I386-NEXT: VirtualAddress: 0x34
|
|
|
|
I386-NEXT: PhysicalAddress: 0x34
|
2013-10-30 08:02:04 +08:00
|
|
|
I386-NEXT: FileSize: 224
|
|
|
|
I386-NEXT: MemSize: 224
|
2013-04-12 12:29:01 +08:00
|
|
|
I386-NEXT: Flags [ (0x5)
|
|
|
|
I386-NEXT: PF_R (0x4)
|
|
|
|
I386-NEXT: PF_X (0x1)
|
|
|
|
I386-NEXT: ]
|
|
|
|
I386-NEXT: Alignment: 8
|
|
|
|
I386-NEXT: }
|
|
|
|
I386-NEXT: ProgramHeader {
|
|
|
|
I386-NEXT: Type: PT_INTERP (0x3)
|
2013-10-30 08:02:04 +08:00
|
|
|
I386-NEXT: Offset: 0x114
|
|
|
|
I386-NEXT: VirtualAddress: 0x114
|
|
|
|
I386-NEXT: PhysicalAddress: 0x114
|
2013-04-12 12:29:01 +08:00
|
|
|
I386-NEXT: FileSize: 28
|
|
|
|
I386-NEXT: MemSize: 28
|
|
|
|
I386-NEXT: Flags [ (0x4)
|
|
|
|
I386-NEXT: PF_R (0x4)
|
|
|
|
I386-NEXT: ]
|
|
|
|
I386-NEXT: Alignment: 1
|
|
|
|
I386-NEXT: }
|
|
|
|
I386-NEXT: ProgramHeader {
|
|
|
|
I386-NEXT: Type: PT_LOAD (0x1)
|
|
|
|
I386-NEXT: Offset: 0x0
|
|
|
|
I386-NEXT: VirtualAddress: 0x0
|
|
|
|
I386-NEXT: PhysicalAddress: 0x0
|
2014-11-10 22:55:11 +08:00
|
|
|
I386-NEXT: FileSize: 556
|
|
|
|
I386-NEXT: MemSize: 556
|
2013-04-12 12:29:01 +08:00
|
|
|
I386-NEXT: Flags [ (0x5)
|
|
|
|
I386-NEXT: PF_R (0x4)
|
|
|
|
I386-NEXT: PF_X (0x1)
|
|
|
|
I386-NEXT: ]
|
|
|
|
I386-NEXT: Alignment: 4096
|
|
|
|
I386-NEXT: }
|
|
|
|
I386-NEXT: ProgramHeader {
|
|
|
|
I386-NEXT: Type: PT_LOAD (0x1)
|
|
|
|
I386-NEXT: Offset: 0x1000
|
|
|
|
I386-NEXT: VirtualAddress: 0x1000
|
|
|
|
I386-NEXT: PhysicalAddress: 0x1000
|
|
|
|
I386-NEXT: FileSize: 260
|
2014-11-04 11:57:04 +08:00
|
|
|
I386-NEXT: MemSize: 260
|
2013-04-12 12:29:01 +08:00
|
|
|
I386-NEXT: Flags [ (0x6)
|
|
|
|
I386-NEXT: PF_R (0x4)
|
|
|
|
I386-NEXT: PF_W (0x2)
|
|
|
|
I386-NEXT: ]
|
|
|
|
I386-NEXT: Alignment: 4096
|
|
|
|
I386-NEXT: }
|
|
|
|
I386-NEXT: ProgramHeader {
|
|
|
|
I386-NEXT: Type: PT_LOAD (0x1)
|
2014-11-30 12:01:14 +08:00
|
|
|
I386-NEXT: Offset: 0x4000
|
2013-04-12 12:29:01 +08:00
|
|
|
I386-NEXT: VirtualAddress: 0x4000
|
|
|
|
I386-NEXT: PhysicalAddress: 0x4000
|
|
|
|
I386-NEXT: FileSize: 4
|
2014-11-04 11:57:04 +08:00
|
|
|
I386-NEXT: MemSize: 8
|
2013-04-12 12:29:01 +08:00
|
|
|
I386-NEXT: Flags [ (0x6)
|
|
|
|
I386-NEXT: PF_R (0x4)
|
|
|
|
I386-NEXT: PF_W (0x2)
|
|
|
|
I386-NEXT: ]
|
2014-11-13 12:33:06 +08:00
|
|
|
I386-NEXT: Alignment: 16384
|
2013-04-12 12:29:01 +08:00
|
|
|
I386-NEXT: }
|
|
|
|
I386-NEXT: ProgramHeader {
|
2013-10-30 08:02:04 +08:00
|
|
|
I386-NEXT: Type: PT_GNU_EH_FRAME (0x6474E550)
|
|
|
|
I386-NEXT: Offset: 0x1F4
|
|
|
|
I386-NEXT: VirtualAddress: 0x1F4
|
|
|
|
I386-NEXT: PhysicalAddress: 0x1F4
|
|
|
|
I386-NEXT: FileSize: 8
|
|
|
|
I386-NEXT: MemSize: 8
|
|
|
|
I386-NEXT: Flags [ (0x4)
|
|
|
|
I386-NEXT: PF_R (0x4)
|
|
|
|
I386-NEXT: ]
|
|
|
|
I386-NEXT: Alignment: 4
|
|
|
|
I386-NEXT: }
|
|
|
|
I386-NEXT: ProgramHeader {
|
2013-04-12 12:29:01 +08:00
|
|
|
I386-NEXT: Type: PT_DYNAMIC (0x2)
|
2013-10-30 08:02:04 +08:00
|
|
|
I386-NEXT: Offset: 0x1FC
|
|
|
|
I386-NEXT: VirtualAddress: 0x1FC
|
|
|
|
I386-NEXT: PhysicalAddress: 0x1FC
|
2014-11-10 22:55:11 +08:00
|
|
|
I386-NEXT: FileSize: 48
|
|
|
|
I386-NEXT: MemSize: 48
|
2013-04-12 12:29:01 +08:00
|
|
|
I386-NEXT: Flags [ (0x4)
|
|
|
|
I386-NEXT: PF_R (0x4)
|
|
|
|
I386-NEXT: ]
|
2014-11-14 12:57:21 +08:00
|
|
|
I386-NEXT: Alignment: 4
|
2013-04-12 12:29:01 +08:00
|
|
|
I386-NEXT: }
|
2013-01-26 07:23:24 +08:00
|
|
|
|
2013-04-05 02:59:24 +08:00
|
|
|
X86_64: LOAD off 0x0000000000000000
|
|
|
|
X86_64: LOAD off 0x0000000000001000
|