]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/section-layout.s
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / ELF / section-layout.s
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
3 # RUN: ld.lld %t -o %tout
4 # RUN: llvm-readobj -sections %tout | FileCheck %s
5
6 # Check that sections are laid out in the correct order.
7
8 .global _start
9 .text
10 _start:
11
12 .section t,"x",@nobits
13 .section s,"x"
14 .section r,"w",@nobits
15 .section q,"w"
16 .section p,"wx",@nobits
17 .section o,"wx"
18 .section n,"",@nobits
19 .section m,""
20
21 .section l,"awx",@nobits
22 .section k,"awx"
23 .section j,"aw",@nobits
24 .section i,"aw"
25 .section g,"awT",@nobits
26 .section e,"awT"
27 .section d,"ax",@nobits
28 .section c,"ax"
29 .section a,"a",@nobits
30 .section b,"a"
31
32 // For non-executable and non-writable sections, PROGBITS appear after others.
33 // CHECK: Name: a
34 // CHECK: Name: b
35 // CHECK: Name: c
36 // CHECK: Name: d
37
38 // Sections that are both writable and executable appear before
39 // sections that are only writable.
40 // CHECK: Name: k
41 // CHECK: Name: l
42
43 // Writable sections appear before TLS and other relro sections.
44 // CHECK: Name: i
45
46 // TLS sections are only sorted on NOBITS.
47 // CHECK: Name: e
48 // CHECK: Name: g
49
50 // CHECK: Name: j
51
52 // Non allocated sections are in input order.
53 // CHECK: Name: t
54 // CHECK: Name: s
55 // CHECK: Name: r
56 // CHECK: Name: q
57 // CHECK: Name: p
58 // CHECK: Name: o
59 // CHECK: Name: n
60 // CHECK: Name: m