1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
3# RUN: echo "SECTIONS { .rw : { *(.rw) } .text : { *(.text) }  }" > %t.script
4# RUN: ld.lld -o %t1 --script %t.script %t
5# RUN: llvm-objdump -private-headers %t1 | FileCheck %s
6
7## We expect 2 PT_LOAD segments
8# CHECK:       PHDR
9# CHECK-NEXT:     filesz {{0x[0-9a-f]+}} memsz {{0x[0-9a-f]+}} flags r--
10# CHECK-NEXT:  LOAD
11# CHECK-NEXT:     filesz {{0x[0-9a-f]+}} memsz {{0x[0-9a-f]+}} flags rw-
12# CHECK-NEXT:  LOAD
13# CHECK-NEXT:     filesz {{0x[0-9a-f]+}} memsz {{0x[0-9a-f]+}} flags r-x
14# CHECK-NEXT:  STACK
15# CHECK-NEXT:     filesz
16
17.globl _start
18_start:
19  jmp _start
20
21.section .rw, "aw"
22 .quad 0
23