1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3
4# RUN: echo "SECTIONS { .foo 0 : {*(foo)} }" > %t.script
5# RUN: ld.lld --hash-style=sysv -o %t --script %t.script %t.o -shared
6# RUN: llvm-readelf -S -l %t | FileCheck %s
7
8# Test that we create all necessary PT_LOAD. We use to stop at the first
9# non-alloc, causing us to not create PT_LOAD for linker generated sections.
10
11# CHECK: Program Headers:
12# CHECK-NEXT:  Type
13# CHECK-NEXT:  LOAD {{.*}} R
14# CHECK-NEXT:  LOAD {{.*}} R E
15# CHECK-NEXT:  LOAD {{.*}} RW
16
17# CHECK:      Section to Segment mapping:
18# CHECK-NEXT:  Segment Sections...
19# CHECK-NEXT:   00     .dynsym .hash .dynstr
20# CHECK-NEXT:   01     .text
21# CHECK-NEXT:   02     .dynamic
22
23nop
24.section foo
25.quad 0
26