[LLDB-DAP] Send Progress update message over DAP (#123837)
[llvm-project.git] / lld / test / ELF / linkerscript / orphan.s
blobdc1b49042a9878d6c9aa2dc38b56062ae2e89474
1 # REQUIRES: x86
2 # RUN: rm -rf %t && split-file %s %t && cd %t
3 # RUN: llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o
5 ## .jcr is a relro section and should be placed before other RW sections.
6 ## .bss is SHT_NOBITS section and should be last RW section, so some space
7 ## in ELF file could be saved.
8 # RUN: ld.lld a.o -T text-rw.lds -o text-rw
9 # RUN: llvm-readelf -S text-rw | FileCheck %s --check-prefix=TEXT-RW
10 # TEXT-RW: .interp PROGBITS 00000000000002{{..}} 0
11 # TEXT-RW-NEXT: .note.my NOTE 00000000000002{{..}} 0
12 # TEXT-RW-NEXT: .text PROGBITS 00000000000002{{..}} 0
13 # TEXT-RW-NEXT: .mytext PROGBITS 00000000000002{{..}} 0
14 # TEXT-RW-NEXT: .jcr PROGBITS 00000000000002{{..}} 0
15 # TEXT-RW-NEXT: .rw1 PROGBITS 0000000000001{{...}} 0
16 # TEXT-RW-NEXT: .rw2 PROGBITS 0000000000001{{...}} 0
17 # TEXT-RW-NEXT: .rw3 PROGBITS 0000000000001{{...}} 0
18 # TEXT-RW-NEXT: .bss NOBITS 0000000000001{{...}} 0
20 # RUN: ld.lld a.o -T only-text.lds -o only-text
21 # RUN: llvm-readelf -S only-text | FileCheck %s --check-prefix=ONLY-TEXT
22 # ONLY-TEXT: .interp PROGBITS 00000000000002{{..}} 0
23 # ONLY-TEXT-NEXT: .note.my NOTE 00000000000002{{..}} 0
24 # ONLY-TEXT-NEXT: .text PROGBITS 00000000000002{{..}} 0
25 # ONLY-TEXT-NEXT: .mytext PROGBITS 00000000000002{{..}} 0
26 # ONLY-TEXT-NEXT: .jcr PROGBITS 00000000000002{{..}} 0
27 # ONLY-TEXT-NEXT: .rw1 PROGBITS 00000000000002{{..}} 0
28 # ONLY-TEXT-NEXT: .rw2 PROGBITS 00000000000002{{..}} 0
29 # ONLY-TEXT-NEXT: .rw3 PROGBITS 00000000000002{{..}} 0
30 # ONLY-TEXT-NEXT: .bss NOBITS 00000000000002{{..}} 0
32 # RUN: ld.lld a.o -T text-align.lds -o text-align
33 # RUN: llvm-readelf -S text-align | FileCheck %s --check-prefix=TEXT-ALIGN
34 # TEXT-ALIGN: .interp PROGBITS 00000000000002{{..}} 0
35 # TEXT-ALIGN-NEXT: .note.my NOTE 00000000000002{{..}} 0
36 # TEXT-ALIGN-NEXT: .text PROGBITS 00000000000002{{..}} 0
37 # TEXT-ALIGN-NEXT: .mytext PROGBITS 0000000000001000 0
38 # TEXT-ALIGN-NEXT: .jcr PROGBITS 0000000000001{{...}} 0
39 # TEXT-ALIGN-NEXT: .rw1 PROGBITS 0000000000001{{...}} 0
40 # TEXT-ALIGN-NEXT: .rw2 PROGBITS 0000000000001{{...}} 0
41 # TEXT-ALIGN-NEXT: .rw3 PROGBITS 0000000000001{{...}} 0
42 # TEXT-ALIGN-NEXT: .bss NOBITS 0000000000001{{...}} 0
44 # RUN: ld.lld a.o -T only-rw.lds -o only-rw
45 # RUN: llvm-readelf -S only-rw | FileCheck %s --check-prefix=ONLY-RW
46 # ONLY-RW: .interp PROGBITS 00000000000002{{..}} 0
47 # ONLY-RW-NEXT: .note.my NOTE 00000000000002{{..}} 0
48 # ONLY-RW-NEXT: .text PROGBITS 00000000000002{{..}} 0
49 # ONLY-RW-NEXT: .mytext PROGBITS 00000000000002{{..}} 0
50 # ONLY-RW-NEXT: .jcr PROGBITS 00000000000002{{..}} 0
51 # ONLY-RW-NEXT: .rw1 PROGBITS 00000000000002{{..}} 0
52 # ONLY-RW-NEXT: .rw2 PROGBITS 0000000000001{{...}} 0
53 # ONLY-RW-NEXT: .rw3 PROGBITS 0000000000001{{...}} 0
54 # ONLY-RW-NEXT: .bss NOBITS 0000000000001{{...}} 0
56 # RUN: ld.lld a.o -T rw-text.lds -o rw-text
57 # RUN: llvm-readelf -S rw-text | FileCheck %s --check-prefix=RW-TEXT
58 # RW-TEXT: .jcr PROGBITS 00000000000002{{..}} 0
59 # RW-TEXT-NEXT: .rw1 PROGBITS 00000000000002{{..}} 0
60 # RW-TEXT-NEXT: .rw2 PROGBITS 00000000000002{{..}} 0
61 # RW-TEXT-NEXT: .rw3 PROGBITS 00000000000002{{..}} 0
62 # RW-TEXT-NEXT: .bss NOBITS 00000000000002{{..}} 0
63 # RW-TEXT-NEXT: .interp PROGBITS 00000000000002{{..}} 0
64 # RW-TEXT-NEXT: .note.my NOTE 00000000000002{{..}} 0
65 # RW-TEXT-NEXT: .text PROGBITS 0000000000001{{...}} 0
66 # RW-TEXT-NEXT: .mytext PROGBITS 0000000000001{{...}} 0
68 # RUN: ld.lld a.o -T rw-text-rw.lds -o rw-text-rw
69 # RUN: llvm-readelf -S rw-text-rw | FileCheck %s --check-prefix=RW-TEXT-RW
70 # RW-TEXT-RW: .jcr PROGBITS 00000000000002{{..}} 0
71 # RW-TEXT-RW-NEXT: .rw1 PROGBITS 00000000000002{{..}} 0
72 # RW-TEXT-RW-NEXT: .interp PROGBITS 00000000000002{{..}} 0
73 # RW-TEXT-RW-NEXT: .note.my NOTE 00000000000002{{..}} 0
74 # RW-TEXT-RW-NEXT: .text PROGBITS 0000000000001{{...}} 0
75 # RW-TEXT-RW-NEXT: .mytext PROGBITS 0000000000001{{...}} 0
76 # RW-TEXT-RW-NEXT: .rw2 PROGBITS 0000000000002{{...}} 0
77 # RW-TEXT-RW-NEXT: .rw3 PROGBITS 0000000000002{{...}} 0
78 # RW-TEXT-RW-NEXT: .bss NOBITS 0000000000002{{...}} 0
80 #--- a.s
81 .section .rw1, "aw"; .byte 0
82 .section .rw2, "aw"; .byte 0
83 .section .rw3, "aw"; .byte 0
84 .section .jcr, "aw"; .byte 0
85 .section .bss, "aw",@nobits; .byte 0
86 .section .note.my, "a", @note; .byte 0
87 .section .interp, "a", @progbits; .byte 0
88 .text; nop
89 .section .mytext,"ax"; nop
91 #--- text-rw.lds
92 SECTIONS {
93 . = SIZEOF_HEADERS;
94 .text : { *(.text) }
95 . = ALIGN(CONSTANT(MAXPAGESIZE));
96 .rw1 : { *(.rw1) }
97 .rw2 : { *(.rw2) }
100 #--- only-text.lds
101 SECTIONS {
102 . = SIZEOF_HEADERS;
103 .text : { *(.text) }
106 #--- text-align.lds
107 SECTIONS {
108 . = SIZEOF_HEADERS;
109 .text : { *(.text) }
110 . = ALIGN(CONSTANT(MAXPAGESIZE));
113 #--- only-rw.lds
114 SECTIONS {
115 . = SIZEOF_HEADERS;
116 .rw1 : { *(.rw1) }
117 . = ALIGN(CONSTANT(MAXPAGESIZE));
120 #--- rw-text.lds
121 SECTIONS {
122 . = SIZEOF_HEADERS;
123 .rw1 : { *(.rw1) }
124 . = ALIGN(CONSTANT(MAXPAGESIZE));
125 .text : { *(.text) }
128 #--- rw-text-rw.lds
129 SECTIONS {
130 . = SIZEOF_HEADERS;
131 .rw1 : { *(.rw1) }
132 . = ALIGN(CONSTANT(MAXPAGESIZE));
133 .text : { *(.text) }
134 . = ALIGN(CONSTANT(MAXPAGESIZE));
135 .rw2 : { *(.rw2) }