llvm-project/lld/test/elf/linkerscript/phdrs-program-wrong-phdrs.test
Denis Protivensky 0c8beb1c95 [LinkerScript] Process program header in PHDRS command
Add PT_PHDR segment depending on its availability in linker script's
PHDRS command, fallback if no linker script is given.
Handle FILEHDR, PHDRS and FLAGS attributes of program header.

Differential Revision: http://reviews.llvm.org/D11589

llvm-svn: 244743
2015-08-12 12:31:35 +00:00

27 lines
505 B
Plaintext

/*
Test when program segment contains PHDRS attribute not mapped to load segment.
RUN: yaml2obj -format=elf %p/Inputs/simple.o.yaml -o=%t.o
RUN: not lld -flavor gnu -target x86_64 -T %s %t.o -static -o %t1 &> %t1-error
RUN: FileCheck -check-prefix PROGRAM-PHDR-WRONG-PHDRS %s < %t1-error
*/
ENTRY(_start)
PHDRS
{
header PT_PHDR PHDRS;
text PT_LOAD;
}
SECTIONS
{
.text : { *(.text) } :text
.data : { *(.data) }
}
/*
PROGRAM-PHDR-WRONG-PHDRS: Program header has invalid PHDRS attribute
*/