llvm-project/lld/test/elf/linkerscript/phdrs-has-program.test

34 lines
628 B
Plaintext

/*
Test when program segment is set it's generated.
RUN: yaml2obj -format=elf %p/Inputs/simple.o.yaml -o=%t.o
RUN: lld -flavor gnu -target x86_64 -T %s %t.o -static -o %t1
RUN: llvm-readobj -program-headers %t1 | FileCheck -check-prefix PROGRAM-PHDR %s
*/
ENTRY(_start)
PHDRS
{
header PT_PHDR FILEHDR PHDRS;
text PT_LOAD PHDRS;
}
SECTIONS
{
.text : { *(.text) } :text
.data : { *(.data) }
}
/*
PROGRAM-PHDR: ProgramHeader {
PROGRAM-PHDR: Type: PT_PHDR (0x6)
PROGRAM-PHDR: VirtualAddress: 0x400040
PROGRAM-PHDR: Flags [ (0x5)
PROGRAM-PHDR: PF_R (0x4)
PROGRAM-PHDR: PF_X (0x1)
PROGRAM-PHDR: ]
PROGRAM-PHDR: }
*/