summaryrefslogtreecommitdiffstats
path: root/lld/test/ELF/linkerscript/implicit-program-header.s
blob: ea5c8738d83ef7178342314564c3cd93a115f292 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# REQUIRES: x86

# RUN: echo '.section .text,"ax"; .quad 0' > %t.s
# RUN: echo '.section .foo,"ax"; .quad 0' >> %t.s
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %t.s -o %t.o
# RUN: ld.lld --hash-style=sysv -o %t1 --script %s  \
# RUN:   %t.o -shared
# RUN: llvm-readobj -elf-output-style=GNU -l %t1 | FileCheck %s

# CHECK:      Segment Sections...
# CHECK-NEXT:   00     .text .dynsym .hash .dynstr .dynamic
# CHECK-NEXT:   01     .bar .foo

PHDRS {
  ph_write PT_LOAD FLAGS(2);
  ph_exec  PT_LOAD FLAGS(1);
}

SECTIONS {
  .bar : { *(.bar) } : ph_exec
  .foo : { *(.foo) }
  .text : { *(.text) } : ph_write
}
OpenPOWER on IntegriCloud