2 ## -z keep-text-section-prefix separates text sections with prefix .text.hot,
3 ## .text.unknown, .text.unlikely, .text.startup, or .text.exit, in the absence
4 ## of a SECTIONS command.
6 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
7 # RUN: ld.lld %t.o -o %t1
8 # RUN: llvm-readelf -S %t1 | FileCheck --check-prefix=NOKEEP %s
9 # RUN: ld.lld -z nokeep-text-section-prefix %t.o -o %t2
12 # RUN: ld.lld -z keep-text-section-prefix %t.o -o %t.keep
13 # RUN: llvm-readelf -S %t.keep | FileCheck --check-prefix=KEEP %s
16 # KEEP-NEXT: [ 2] .text.hot
17 # KEEP-NEXT: [ 3] .text.unknown
18 # KEEP-NEXT: [ 4] .text.split
19 # KEEP-NEXT: [ 5] .text.startup
20 # KEEP-NEXT: [ 6] .text.exit
21 # KEEP-NEXT: [ 7] .text.unlikely
26 ## With a SECTIONS command, orphan sections are created verbatim.
27 ## No grouping is performed for them.
28 # RUN: echo 'SECTIONS {}' > %t.lds
29 # RUN: ld.lld -T %t.lds -z keep-text-section-prefix %t.o -o %t.script
30 # RUN: llvm-readelf -S %t.script | FileCheck --check-prefix=SCRIPT %s
33 # SCRIPT-NEXT: .text.f
34 # SCRIPT-NEXT: .text.hot.f_hot
35 # SCRIPT-NEXT: .text.unknown.f_unknown
36 # SCRIPT-NEXT: .text.split.f_split
37 # SCRIPT-NEXT: .text.startup.f_startup
38 # SCRIPT-NEXT: .text.exit.f_exit
39 # SCRIPT-NEXT: .text.unlikely.f_unlikely
48 .section .text.hot.f_hot,"ax"
51 .section .text.unknown.f_unknown,"ax"
54 .section .text.split.f_split,"ax"
57 .section .text.startup.f_startup,"ax"
60 .section .text.exit.f_exit,"ax"
63 .section .text.unlikely.f_unlikely,"ax"