1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3
4# RUN: echo "SECTIONS { \
5# RUN:         .text : { *(.text) } \
6# RUN:         foo   : { *(foo) } \
7# RUN:       } " > %t.script
8# RUN: ld.lld -o %t --script %t.script %t.o -shared
9# RUN: llvm-objdump --section-headers %t | FileCheck  %s
10
11# Test the section order. This is a case where at least with libstdc++'s
12# stable_sort we used to get a different result.
13
14nop
15
16.section foo, "a"
17.byte 0
18
19# CHECK: Id
20# CHECK-NEXT: 0
21# CHECK-NEXT: 1 .text
22# CHECK-NEXT: 2 foo
23# CHECK-NEXT: 3 .dynsym
24# CHECK-NEXT: 4 .hash
25# CHECK-NEXT: 5 .dynstr
26# CHECK-NEXT: 6 .dynamic
27# CHECK-NEXT: 7 .comment
28# CHECK-NEXT: 8 .symtab
29# CHECK-NEXT: 9 .shstrtab
30# CHECK-NEXT: 10 .strtab
31