1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o
3# RUN: echo "SECTIONS { .init_array : { *(SORT_BY_INIT_PRIORITY(.init_array.*)) } }" > %t1.script
4# RUN: ld.lld --script %t1.script %t1.o -o %t2
5# RUN: llvm-objdump -s %t2 | FileCheck %s
6
7# CHECK:      Contents of section .init_array:
8# CHECK-NEXT: 03020000 00000000 010405
9
10.globl _start
11_start:
12  nop
13
14.section .init_array, "aw", @init_array
15  .align 8
16  .byte 1
17.section .init_array.100, "aw", @init_array
18  .long 2
19.section .init_array.5, "aw", @init_array
20  .byte 3
21.section .init_array, "aw", @init_array
22  .byte 4
23.section .init_array, "aw", @init_array
24  .byte 5
25