summaryrefslogtreecommitdiff
path: root/test/old-elf/linkerscript/phdrs-program-wrong-phdrs.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/old-elf/linkerscript/phdrs-program-wrong-phdrs.test')
-rw-r--r--test/old-elf/linkerscript/phdrs-program-wrong-phdrs.test26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/old-elf/linkerscript/phdrs-program-wrong-phdrs.test b/test/old-elf/linkerscript/phdrs-program-wrong-phdrs.test
new file mode 100644
index 000000000000..c27b23d85876
--- /dev/null
+++ b/test/old-elf/linkerscript/phdrs-program-wrong-phdrs.test
@@ -0,0 +1,26 @@
+/*
+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 old-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
+*/