xref: /llvm-project-15.0.7/lld/test/ELF/linkerscript/orphans.s (revision 052d95a6)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
3
4# RUN: echo "SECTIONS { .writable : { *(.writable) } }" > %t.script
5# RUN: ld.lld -o %t.out --script %t.script %t
6# RUN: llvm-objdump -section-headers %t.out | \
7# RUN:   FileCheck -check-prefix=TEXTORPHAN %s
8
9# RUN: echo "SECTIONS { .text : { *(.text) } }" > %t.script
10# RUN: ld.lld -o %t.out --script %t.script %t
11# RUN: llvm-objdump -section-headers %t.out | \
12# RUN:   FileCheck -check-prefix=WRITABLEORPHAN %s
13
14# TEXTORPHAN:      Sections:
15# TEXTORPHAN-NEXT: Idx Name
16# TEXTORPHAN-NEXT:   0
17# TEXTORPHAN-NEXT:   1 .text
18# TEXTORPHAN-NEXT:   2 .writable
19
20# WRITABLEORPHAN:      Sections:
21# WRITABLEORPHAN-NEXT: Idx Name
22# WRITABLEORPHAN-NEXT:   0
23# WRITABLEORPHAN-NEXT:   1 .text
24# WRITABLEORPHAN-NEXT:   2 .writable
25
26.global _start
27_start:
28 nop
29
30.section .writable,"aw"
31 .zero 4
32

served by {OpenGrok

Last Index Update: Fri May 15 20:09:11 GMT 2026