summaryrefslogtreecommitdiff
path: root/test/ELF/linkerscript/non-alloc.s
diff options
context:
space:
mode:
Diffstat (limited to 'test/ELF/linkerscript/non-alloc.s')
-rw-r--r--test/ELF/linkerscript/non-alloc.s25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/ELF/linkerscript/non-alloc.s b/test/ELF/linkerscript/non-alloc.s
new file mode 100644
index 0000000000000..2060129a80204
--- /dev/null
+++ b/test/ELF/linkerscript/non-alloc.s
@@ -0,0 +1,25 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
+
+# RUN: echo "SECTIONS { .foo 0 : {*(foo)} }" > %t.script
+# RUN: ld.lld -o %t1 --script %t.script %t -shared
+# RUN: llvm-readobj -elf-output-style=GNU -s -l %t1 | FileCheck %s
+
+# Test that we create all necessary PT_LOAD. We use to stop at the first
+# non-alloc, causing us to not create PT_LOAD for linker generated sections.
+
+# CHECK: Program Headers:
+# CHECK-NEXT: Type
+# CHECK-NEXT: PHDR
+# CHECK-NEXT: LOAD {{.*}} R E
+# CHECK-NEXT: LOAD {{.*}} RW
+
+# CHECK: Section to Segment mapping:
+# CHECK-NEXT: Segment Sections...
+# CHECK-NEXT: 00
+# CHECK-NEXT: 01 .text .dynsym .hash .dynstr
+# CHECK-NEXT: 02 .dynamic
+
+nop
+.section foo
+.quad 0