2 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3 # RUN: echo "PHDRS {" > %t.script
4 # RUN: echo " ph_text PT_LOAD FLAGS (0x1 | 0x4);" >> %t.script
5 # RUN: echo " ph_data PT_LOAD FLAGS (0x2 | 0x4);" >> %t.script
6 # RUN: echo "}" >> %t.script
7 # RUN: echo "SECTIONS {" >> %t.script
8 # RUN: echo " .text : { *(.text*) } : ph_text" >> %t.script
9 # RUN: echo " . = ALIGN(0x4000);" >> %t.script
10 # RUN: echo " .got.plt : { BYTE(42); *(.got); } : ph_data" >> %t.script
11 # RUN: echo "}" >> %t.script
12 # RUN: ld.lld -T %t.script %t.o -o %t.elf
13 # RUN: llvm-readelf -l %t.elf | FileCheck %s
15 # CHECK: Section to Segment mapping:
16 # CHECK-NEXT: Segment Sections...
17 # CHECK-NEXT: 00 .text executable
18 # CHECK-NEXT: 01 .got.plt
22 .type _start,@function
27 .section executable,"ax",@progbits
28 .type custom_func,@function