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

34 lines
687 B
Plaintext

/*
Test when program segment contains only FLAGS attribute.
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-FLAGS-PHDR %s
*/
ENTRY(_start)
PHDRS
{
header PT_PHDR PHDRS FLAGS(0x7);
text PT_LOAD FILEHDR PHDRS;
}
SECTIONS
{
.text : { *(.text) } :text
.data : { *(.data) }
}
/*
PROGRAM-FLAGS-PHDR: ProgramHeader {
PROGRAM-FLAGS-PHDR: Type: PT_PHDR (0x6)
PROGRAM-FLAGS-PHDR: Flags [ (0x7)
PROGRAM-FLAGS-PHDR: PF_R (0x4)
PROGRAM-FLAGS-PHDR: PF_W (0x2)
PROGRAM-FLAGS-PHDR: PF_X (0x1)
PROGRAM-FLAGS-PHDR: ]
PROGRAM-FLAGS-PHDR: }
*/