llvm-project/lld/test/elf/linkerscript/phdrs-one-none.test

37 lines
804 B
Plaintext

/*
Test when one segment is marked as NONE.
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-objdump -section-headers %t1 | FileCheck -check-prefix NONE-PHDRS-SECS %s
RUN: llvm-readobj -program-headers %t1 | FileCheck -check-prefix NONE-PHDRS-HDRS %s
*/
ENTRY(_start)
PHDRS
{
text PT_LOAD;
}
SECTIONS
{
.text : { *(.text) } :text
.data : { *(.data) } :NONE
}
/*
NONE-PHDRS-SECS: .text {{[0-9a-f]+}} 00000000004000b0
NONE-PHDRS-SECS: .data {{[0-9a-f]+}} 0000000000000000
NONE-PHDRS-HDRS: ProgramHeader {
NONE-PHDRS-HDRS: Type: PT_LOAD (0x1)
NONE-PHDRS-HDRS: VirtualAddress: 0x400000
NONE-PHDRS-HDRS: Flags [ (0x5)
NONE-PHDRS-HDRS: PF_R (0x4)
NONE-PHDRS-HDRS: PF_X (0x1)
NONE-PHDRS-HDRS: ]
NONE-PHDRS-HDRS: }
*/