• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: split-file %s %t
2; RUN: llvm-as %t/a.ll -o %t.o
3; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
4; RUN:     -m elf_x86_64 -o %t.exe %t.o \
5; RUN:     --section-ordering-file=%t/order
6; RUN: llvm-readelf -s %t.exe | FileCheck %s
7
8; Check that the order of the sections is tin -> _start -> pat.
9
10; CHECK:      00000000004000d0     1 FUNC    LOCAL  DEFAULT    1 pat
11; CHECK:      00000000004000b0     1 FUNC    LOCAL  DEFAULT    1 tin
12; CHECK:      00000000004000c0    15 FUNC    GLOBAL DEFAULT    1 _start
13
14;--- order
15.text.tin
16.text._start
17.text.pat
18
19;--- a.ll
20target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
21target triple = "x86_64-unknown-linux-gnu"
22
23define void @pat() #0 {
24  ret void
25}
26
27define void @tin() #0 {
28  ret void
29}
30
31define i32 @_start() {
32  call void @pat()
33  call void @tin()
34  ret i32 0
35}
36
37attributes #0 = { noinline optnone }
38