File: section_sizes_macho.test

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (267 lines) | stat: -rw-r--r-- 9,182 bytes parent folder | download | duplicates (19)
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
## Check how llvm-dwarfdump calculates section sizes
## with --show-section-sizes for Mach-O objects.

# RUN: yaml2obj %s | llvm-dwarfdump - --show-section-sizes \
# RUN:   | FileCheck %s --match-full-lines --strict-whitespace

#      CHECK:----------------------------------------------------
# CHECK-NEXT:file: {{.*}}
# CHECK-NEXT:----------------------------------------------------
# CHECK-NEXT:SECTION           SIZE (b)
# CHECK-NEXT:----------------  --------
# CHECK-NEXT:__debug_str            183 (9.78%)
# CHECK-NEXT:__debug_abbrev          58 (3.10%)
# CHECK-NEXT:__debug_info            83 (4.43%)
# CHECK-NEXT:__apple_names           60 (3.21%)
# CHECK-NEXT:__apple_objc            36 (1.92%)
# CHECK-NEXT:__apple_namespac        36 (1.92%)
# CHECK-NEXT:__apple_types           71 (3.79%)
# CHECK-NEXT:__debug_line            61 (3.26%)
# CHECK-EMPTY:
# CHECK-NEXT: Total Size: 588  (31.41%)
# CHECK-NEXT: Total File Size: 1872
# CHECK-NEXT:----------------------------------------------------

--- !mach-o
FileHeader:
  magic:           0xFEEDFACF
  cputype:         0x01000007
  cpusubtype:      0x00000003
  filetype:        0x00000001
  ncmds:           4
  sizeofcmds:      1080
  flags:           0x00002000
  reserved:        0x00000000
LoadCommands:
  - cmd:             LC_SEGMENT_64
    cmdsize:         952
    segname:         ''
    vmaddr:          0
    vmsize:          701
    fileoff:         1112
    filesize:        701
    maxprot:         7
    initprot:        7
    nsects:          11
    flags:           0
    Sections:
## This is a debug section following the ELF naming style, and is used
## to show that such sections are not included in the report.
      - sectname:        .debug_line
        segname:         __DWARF
        addr:            0x0000000000000000
        size:            15
        offset:          0x00000458
        align:           4
        reloff:          0x00000000
        nreloc:          0
        flags:           0x80000400
        reserved1:       0x00000000
        reserved2:       0x00000000
        reserved3:       0x00000000
        content:         554889E531C0C745FC000000005DC3
      - sectname:        __debug_str
        segname:         __DWARF
        addr:            0x000000000000000F
        size:            183
        offset:          0x00000467
        align:           0
        reloff:          0x00000000
        nreloc:          0
        flags:           0x02000000
        reserved1:       0x00000000
        reserved2:       0x00000000
        reserved3:       0x00000000
      - sectname:        __debug_abbrev
        segname:         __DWARF
        addr:            0x00000000000000C6
        size:            58
        offset:          0x0000051E
        align:           0
        reloff:          0x00000000
        nreloc:          0
        flags:           0x02000000
        reserved1:       0x00000000
        reserved2:       0x00000000
        reserved3:       0x00000000
      - sectname:        __debug_info
        segname:         __DWARF
        addr:            0x0000000000000100
        size:            83
        offset:          0x00000558
        align:           0
        reloff:          0x00000718
        nreloc:          2
        flags:           0x02000000
        reserved1:       0x00000000
        reserved2:       0x00000000
        reserved3:       0x00000000
        relocations:
          - address:         0x00000033
            symbolnum:       1
            pcrel:           false
            length:          3
            extern:          false
            type:            0
            scattered:       false
            value:           0
          - address:         0x00000026
            symbolnum:       1
            pcrel:           false
            length:          3
            extern:          false
            type:            0
            scattered:       false
            value:           0
      - sectname:        __apple_names
        segname:         __DWARF
        addr:            0x0000000000000153
        size:            60
        offset:          0x000005AB
        align:           0
        reloff:          0x00000000
        nreloc:          0
        flags:           0x02000000
        reserved1:       0x00000000
        reserved2:       0x00000000
        reserved3:       0x00000000
        content:         485341480100000001000000010000000C000000000000000100000001000600000000006A7F9A7C2C000000AE000000010000003200000000000000
      - sectname:        __apple_objc
        segname:         __DWARF
        addr:            0x000000000000018F
        size:            36
        offset:          0x000005E7
        align:           0
        reloff:          0x00000000
        nreloc:          0
        flags:           0x02000000
        reserved1:       0x00000000
        reserved2:       0x00000000
        reserved3:       0x00000000
        content:         485341480100000001000000000000000C000000000000000100000001000600FFFFFFFF
      - sectname:        __apple_namespac
        segname:         __DWARF
        addr:            0x00000000000001B3
        size:            36
        offset:          0x0000060B
        align:           0
        reloff:          0x00000000
        nreloc:          0
        flags:           0x02000000
        reserved1:       0x00000000
        reserved2:       0x00000000
        reserved3:       0x00000000
        content:         485341480100000001000000000000000C000000000000000100000001000600FFFFFFFF
      - sectname:        __apple_types
        segname:         __DWARF
        addr:            0x00000000000001D7
        size:            71
        offset:          0x0000062F
        align:           0
        reloff:          0x00000000
        nreloc:          0
        flags:           0x02000000
        reserved1:       0x00000000
        reserved2:       0x00000000
        reserved3:       0x00000000
        content:         48534148010000000100000001000000140000000000000003000000010006000300050004000B00000000003080880B34000000B3000000010000004B00000024000000000000
      - sectname:        __compact_unwind
        segname:         __LD
        addr:            0x0000000000000220
        size:            32
        offset:          0x00000678
        align:           3
        reloff:          0x00000728
        nreloc:          1
        flags:           0x02000000
        reserved1:       0x00000000
        reserved2:       0x00000000
        reserved3:       0x00000000
        content:         00000000000000000F0000000000000100000000000000000000000000000000
        relocations:
          - address:         0x00000000
            symbolnum:       1
            pcrel:           false
            length:          3
            extern:          false
            type:            0
            scattered:       false
            value:           0
      - sectname:        __eh_frame
        segname:         __TEXT
        addr:            0x0000000000000240
        size:            64
        offset:          0x00000698
        align:           3
        reloff:          0x00000000
        nreloc:          0
        flags:           0x6800000B
        reserved1:       0x00000000
        reserved2:       0x00000000
        reserved3:       0x00000000
        content:         1400000000000000017A520001781001100C070890010000240000001C000000A0FDFFFFFFFFFFFF0F0000000000000000410E108602430D0600000000000000
      - sectname:        __debug_line
        segname:         __DWARF
        addr:            0x0000000000000280
        size:            61
        offset:          0x000006D8
        align:           0
        reloff:          0x00000730
        nreloc:          1
        flags:           0x02000000
        reserved1:       0x00000000
        reserved2:       0x00000000
        reserved3:       0x00000000
        relocations:
          - address:         0x0000002B
            symbolnum:       1
            pcrel:           false
            length:          3
            extern:          false
            type:            0
            scattered:       false
            value:           0
  - cmd:             LC_BUILD_VERSION
    cmdsize:         24
    platform:        1
    minos:           720896
    sdk:             720896
    ntools:          0
  - cmd:             LC_SYMTAB
    cmdsize:         24
    symoff:          1848
    nsyms:           1
    stroff:          1864
    strsize:         8
  - cmd:             LC_DYSYMTAB
    cmdsize:         80
    ilocalsym:       0
    nlocalsym:       0
    iextdefsym:      0
    nextdefsym:      1
    iundefsym:       1
    nundefsym:       0
    tocoff:          0
    ntoc:            0
    modtaboff:       0
    nmodtab:         0
    extrefsymoff:    0
    nextrefsyms:     0
    indirectsymoff:  0
    nindirectsyms:   0
    extreloff:       0
    nextrel:         0
    locreloff:       0
    nlocrel:         0
LinkEditData:
  NameList:
    - n_strx:          1
      n_type:          0x0F
      n_sect:          1
      n_desc:          0
      n_value:         0
  StringTable:
    - ''
    - _main
    - ''
...