1# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
2# RUN: ld.lld %t -o %tout
3# RUN: llvm-readobj -sections %tout | FileCheck %s
4# REQUIRES: x86
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 b,"a",@nobits
30.section a,"a"
31
32// CHECK: Name: a
33// CHECK: Name: b
34// CHECK: Name: c
35// CHECK: Name: d
36
37// Writable sections appear before TLS and other relro sections.
38// CHECK: Name: i
39
40// TLS sections are only sorted on NOBITS.
41// CHECK: Name: e
42// CHECK: Name: g
43
44// CHECK: Name: j
45// CHECK: Name: k
46// CHECK: Name: l
47
48// Non allocated sections are in input order.
49// CHECK: Name: t
50// CHECK: Name: s
51// CHECK: Name: r
52// CHECK: Name: q
53// CHECK: Name: p
54// CHECK: Name: o
55// CHECK: Name: n
56// CHECK: Name: m
57