File: bss.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 (125 lines) | stat: -rw-r--r-- 3,184 bytes parent folder | download | duplicates (21)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
# RUN: %lld -o %t %t.o
# RUN: llvm-readobj --section-headers --macho-segment %t | FileCheck %s

## Check that __bss takes up zero file size, is at file offset zero, and appears
## at the end of its segment. Also check that __tbss is placed immediately
## before it.
## Zerofill sections in other segments (i.e. not __DATA) should also be placed
## at the end.

# CHECK:        Index: 1
# CHECK-NEXT:   Name: __data
# CHECK-NEXT:   Segment: __DATA
# CHECK-NEXT:   Address:
# CHECK-NEXT:   Size: 0x8
# CHECK-NEXT:   Offset: 4096
# CHECK-NEXT:   Alignment: 0
# CHECK-NEXT:   RelocationOffset: 0x0
# CHECK-NEXT:   RelocationCount: 0
# CHECK-NEXT:   Type: Regular (0x0)
# CHECK-NEXT:   Attributes [ (0x0)
# CHECK-NEXT:   ]
# CHECK-NEXT:   Reserved1: 0x0
# CHECK-NEXT:   Reserved2: 0x0
# CHECK-NEXT:   Reserved3: 0x0

# CHECK:        Index: 2
# CHECK-NEXT:   Name: __thread_bss
# CHECK-NEXT:   Segment: __DATA
# CHECK-NEXT:   Address:
# CHECK-NEXT:   Size: 0x4
# CHECK-NEXT:   Offset: 0
# CHECK-NEXT:   Alignment: 0
# CHECK-NEXT:   RelocationOffset: 0x0
# CHECK-NEXT:   RelocationCount: 0
# CHECK-NEXT:   Type: ThreadLocalZerofill (0x12)
# CHECK-NEXT:   Attributes [ (0x0)
# CHECK-NEXT:   ]
# CHECK-NEXT:   Reserved1: 0x0
# CHECK-NEXT:   Reserved2: 0x0
# CHECK-NEXT:   Reserved3: 0x0

# CHECK:        Index: 3
# CHECK-NEXT:   Name: __bss
# CHECK-NEXT:   Segment: __DATA
# CHECK-NEXT:   Address:
# CHECK-NEXT:   Size: 0x10000
# CHECK-NEXT:   Offset: 0
# CHECK-NEXT:   Alignment: 0
# CHECK-NEXT:   RelocationOffset: 0x0
# CHECK-NEXT:   RelocationCount: 0
# CHECK-NEXT:   Type: ZeroFill (0x1)
# CHECK-NEXT:   Attributes [ (0x0)
# CHECK-NEXT:   ]
# CHECK-NEXT:   Reserved1: 0x0
# CHECK-NEXT:   Reserved2: 0x0
# CHECK-NEXT:   Reserved3: 0x0

# CHECK:        Index: 4
# CHECK-NEXT:   Name: foo
# CHECK-NEXT:   Segment: FOO
# CHECK-NEXT:   Address:
# CHECK-NEXT:   Size: 0x8
# CHECK-NEXT:   Offset: 8192
# CHECK-NEXT:   Alignment: 0
# CHECK-NEXT:   RelocationOffset: 0x0
# CHECK-NEXT:   RelocationCount: 0
# CHECK-NEXT:   Type: Regular (0x0)
# CHECK-NEXT:   Attributes [ (0x0)
# CHECK-NEXT:   ]
# CHECK-NEXT:   Reserved1: 0x0
# CHECK-NEXT:   Reserved2: 0x0
# CHECK-NEXT:   Reserved3: 0x0

# CHECK:        Index: 5
# CHECK-NEXT:   Name: bss
# CHECK-NEXT:   Segment: FOO
# CHECK-NEXT:   Address:
# CHECK-NEXT:   Size: 0x8
# CHECK-NEXT:   Offset: 0
# CHECK-NEXT:   Alignment: 0
# CHECK-NEXT:   RelocationOffset: 0x0
# CHECK-NEXT:   RelocationCount: 0
# CHECK-NEXT:   Type: ZeroFill (0x1)
# CHECK-NEXT:   Attributes [ (0x0)
# CHECK-NEXT:   ]
# CHECK-NEXT:   Reserved1: 0x0
# CHECK-NEXT:   Reserved2: 0x0
# CHECK-NEXT:   Reserved3: 0x0

# CHECK:      Name: __DATA
# CHECK-NEXT: Size:
# CHECK-NEXT: vmaddr:
# CHECK-NEXT: vmsize: 0x11000
# CHECK-NEXT: fileoff:
# CHECK-NEXT: filesize: 4096

# CHECK:      Name: FOO
# CHECK-NEXT: Size:
# CHECK-NEXT: vmaddr:
# CHECK-NEXT: vmsize: 0x9000
# CHECK-NEXT: fileoff:
# CHECK-NEXT: filesize: 4096

.globl _main

.text
_main:
  movq $0, %rax
  retq

.bss
.zero 0x8000

.tbss _foo, 4
.zero 0x8000

.data
.quad 0x1234

.zerofill FOO,bss,_zero_foo,0x8000

.section FOO,foo
.quad 123