xref: /llvm-project/lld/test/ELF/linkerscript/implicit-program-header.test (revision 1302fdc233f424dbc8d15d7d88dc894dd6cdbb6c)
1# REQUIRES: x86
2
3# RUN: echo '.section .text,"ax"; .quad 0' > %t.s
4# RUN: echo '.section .foo,"ax"; .quad 0' >> %t.s
5# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %t.s -o %t.o
6# RUN: ld.lld --hash-style=sysv -o %t1 --script %s %t.o -shared
7# RUN: llvm-readelf -l %t1 | FileCheck %s
8
9# CHECK:      Segment Sections...
10# CHECK-NEXT:   00     .text
11# CHECK-NEXT:   01     .foo .dynsym .hash .dynstr .dynamic
12# CHECK-NEXT:   02     .foo .dynsym .hash .dynstr .dynamic
13
14PHDRS {
15  ph_write PT_LOAD FLAGS(2);
16  ph_exec  PT_LOAD FLAGS(1);
17  ph_note  PT_NOTE;
18}
19
20SECTIONS {
21  .text : { *(.text) } : ph_write
22  .bar : { *(.bar) } : ph_exec : ph_note
23  .foo : { *(.foo) }
24}
25