diff options
Diffstat (limited to 'test/old-elf/linkerscript/phdrs-has-program.test')
| -rw-r--r-- | test/old-elf/linkerscript/phdrs-has-program.test | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/old-elf/linkerscript/phdrs-has-program.test b/test/old-elf/linkerscript/phdrs-has-program.test new file mode 100644 index 0000000000000..83fe94c70614c --- /dev/null +++ b/test/old-elf/linkerscript/phdrs-has-program.test @@ -0,0 +1,33 @@ +/* +Test when program segment is set it's generated. + +RUN: yaml2obj -format=elf %p/Inputs/simple.o.yaml -o=%t.o + +RUN: lld -flavor old-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: } +*/ |
