File: section-order.s

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (56 lines) | stat: -rw-r--r-- 1,893 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# REQUIRES: x86
## Check that section ordering follows from input file ordering.
# RUN: rm -rf %t; split-file %s %t
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/1.s -o %t/1.o
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/2.s -o %t/2.o
# RUN: %lld -dylib %t/1.o %t/2.o -o %t/12
# RUN: %lld -dylib %t/2.o %t/1.o -o %t/21
# RUN: %lld -dylib %t/2.o %t/1.o -o %t/synth-section-order \
# RUN:     -add_empty_section __TEXT __objc_stubs \
# RUN:     -add_empty_section __TEXT __init_offsets \
# RUN:     -add_empty_section __TEXT __stubs \
# RUN:     -add_empty_section __TEXT __stub_helper \
# RUN:     -add_empty_section __TEXT __unwind_info \
# RUN:     -add_empty_section __TEXT __eh_frame \
# RUN:     -add_empty_section __DATA __objc_selrefs
# RUN: llvm-objdump --macho --section-headers %t/12 | FileCheck %s --check-prefix=CHECK-12
# RUN: llvm-objdump --macho --section-headers %t/21 | FileCheck %s --check-prefix=CHECK-21
# RUN: llvm-objdump --macho --section-headers %t/synth-section-order | FileCheck %s --check-prefix=CHECK-SYNTHETIC-ORDER

# CHECK-12:      __text
# CHECK-12-NEXT: foo
# CHECK-12-NEXT: bar
# CHECK-12-NEXT: __cstring

# CHECK-21:      __text
# CHECK-21-NEXT: __cstring
# CHECK-21-NEXT: bar
# CHECK-21-NEXT: foo

# CHECK-SYNTHETIC-ORDER:      __text
# CHECK-SYNTHETIC-ORDER-NEXT: __stubs
# CHECK-SYNTHETIC-ORDER-NEXT: __stub_helper
# CHECK-SYNTHETIC-ORDER-NEXT: __objc_stubs
# CHECK-SYNTHETIC-ORDER-NEXT: __init_offsets
# CHECK-SYNTHETIC-ORDER-NEXT: __cstring
# CHECK-SYNTHETIC-ORDER-NEXT: bar
# CHECK-SYNTHETIC-ORDER-NEXT: foo
# CHECK-SYNTHETIC-ORDER-NEXT: __unwind_info
# CHECK-SYNTHETIC-ORDER-NEXT: __eh_frame
# CHECK-SYNTHETIC-ORDER-NEXT: __objc_selrefs

#--- 1.s
.section __TEXT,foo
  .space 1
.section __TEXT,bar
  .space 1
.cstring
  .asciz ""

#--- 2.s
.cstring
  .asciz ""
.section __TEXT,bar
  .space 1
.section __TEXT,foo
  .space 1