@@ -58,10 +58,10 @@ pub const uuid_command = extern struct {
58
58
cmd : LC = .UUID ,
59
59
60
60
/// sizeof(struct uuid_command)
61
- cmdsize : u32 ,
61
+ cmdsize : u32 = @sizeOf ( uuid_command ) ,
62
62
63
63
/// the 128-bit uuid
64
- uuid : [16 ]u8 ,
64
+ uuid : [16 ]u8 = undefined ,
65
65
};
66
66
67
67
/// The version_min_command contains the min OS version on which this
@@ -71,7 +71,7 @@ pub const version_min_command = extern struct {
71
71
cmd : LC ,
72
72
73
73
/// sizeof(struct version_min_command)
74
- cmdsize : u32 ,
74
+ cmdsize : u32 = @sizeOf ( version_min_command ) ,
75
75
76
76
/// X.Y.Z is encoded in nibbles xxxx.yy.zz
77
77
version : u32 ,
@@ -87,7 +87,7 @@ pub const source_version_command = extern struct {
87
87
cmd : LC = .SOURCE_VERSION ,
88
88
89
89
/// sizeof(source_version_command)
90
- cmdsize : u32 ,
90
+ cmdsize : u32 = @sizeOf ( source_version_command ) ,
91
91
92
92
/// A.B.C.D.E packed as a24.b10.c10.d10.e10
93
93
version : u64 ,
@@ -155,13 +155,13 @@ pub const entry_point_command = extern struct {
155
155
cmd : LC = .MAIN ,
156
156
157
157
/// sizeof(struct entry_point_command)
158
- cmdsize : u32 ,
158
+ cmdsize : u32 = @sizeOf ( entry_point_command ) ,
159
159
160
160
/// file (__TEXT) offset of main()
161
- entryoff : u64 ,
161
+ entryoff : u64 = 0 ,
162
162
163
163
/// if not zero, initial stack size
164
- stacksize : u64 ,
164
+ stacksize : u64 = 0 ,
165
165
};
166
166
167
167
/// The symtab_command contains the offsets and sizes of the link-edit 4.3BSD
@@ -172,19 +172,19 @@ pub const symtab_command = extern struct {
172
172
cmd : LC = .SYMTAB ,
173
173
174
174
/// sizeof(struct symtab_command)
175
- cmdsize : u32 ,
175
+ cmdsize : u32 = @sizeOf ( symtab_command ) ,
176
176
177
177
/// symbol table offset
178
- symoff : u32 ,
178
+ symoff : u32 = 0 ,
179
179
180
180
/// number of symbol table entries
181
- nsyms : u32 ,
181
+ nsyms : u32 = 0 ,
182
182
183
183
/// string table offset
184
- stroff : u32 ,
184
+ stroff : u32 = 0 ,
185
185
186
186
/// string table size in bytes
187
- strsize : u32 ,
187
+ strsize : u32 = 0 ,
188
188
};
189
189
190
190
/// This is the second set of the symbolic information which is used to support
@@ -230,7 +230,7 @@ pub const dysymtab_command = extern struct {
230
230
cmd : LC = .DYSYMTAB ,
231
231
232
232
/// sizeof(struct dysymtab_command)
233
- cmdsize : u32 ,
233
+ cmdsize : u32 = @sizeOf ( dysymtab_command ) ,
234
234
235
235
// The symbols indicated by symoff and nsyms of the LC_SYMTAB load command
236
236
// are grouped into the following three groups:
@@ -247,22 +247,22 @@ pub const dysymtab_command = extern struct {
247
247
// table when this is a dynamically linked shared library file).
248
248
249
249
/// index of local symbols
250
- ilocalsym : u32 ,
250
+ ilocalsym : u32 = 0 ,
251
251
252
252
/// number of local symbols
253
- nlocalsym : u32 ,
253
+ nlocalsym : u32 = 0 ,
254
254
255
255
/// index to externally defined symbols
256
- iextdefsym : u32 ,
256
+ iextdefsym : u32 = 0 ,
257
257
258
258
/// number of externally defined symbols
259
- nextdefsym : u32 ,
259
+ nextdefsym : u32 = 0 ,
260
260
261
261
/// index to undefined symbols
262
- iundefsym : u32 ,
262
+ iundefsym : u32 = 0 ,
263
263
264
264
/// number of undefined symbols
265
- nundefsym : u32 ,
265
+ nundefsym : u32 = 0 ,
266
266
267
267
// For the for the dynamic binding process to find which module a symbol
268
268
// is defined in the table of contents is used (analogous to the ranlib
@@ -272,10 +272,10 @@ pub const dysymtab_command = extern struct {
272
272
// symbols are sorted by name and is use as the table of contents.
273
273
274
274
/// file offset to table of contents
275
- tocoff : u32 ,
275
+ tocoff : u32 = 0 ,
276
276
277
277
/// number of entries in table of contents
278
- ntoc : u32 ,
278
+ ntoc : u32 = 0 ,
279
279
280
280
// To support dynamic binding of "modules" (whole object files) the symbol
281
281
// table must reflect the modules that the file was created from. This is
@@ -286,10 +286,10 @@ pub const dysymtab_command = extern struct {
286
286
// contains one module so everything in the file belongs to the module.
287
287
288
288
/// file offset to module table
289
- modtaboff : u32 ,
289
+ modtaboff : u32 = 0 ,
290
290
291
291
/// number of module table entries
292
- nmodtab : u32 ,
292
+ nmodtab : u32 = 0 ,
293
293
294
294
// To support dynamic module binding the module structure for each module
295
295
// indicates the external references (defined and undefined) each module
@@ -300,10 +300,10 @@ pub const dysymtab_command = extern struct {
300
300
// undefined external symbols indicates the external references.
301
301
302
302
/// offset to referenced symbol table
303
- extrefsymoff : u32 ,
303
+ extrefsymoff : u32 = 0 ,
304
304
305
305
/// number of referenced symbol table entries
306
- nextrefsyms : u32 ,
306
+ nextrefsyms : u32 = 0 ,
307
307
308
308
// The sections that contain "symbol pointers" and "routine stubs" have
309
309
// indexes and (implied counts based on the size of the section and fixed
@@ -315,10 +315,10 @@ pub const dysymtab_command = extern struct {
315
315
// The indirect symbol table is ordered to match the entries in the section.
316
316
317
317
/// file offset to the indirect symbol table
318
- indirectsymoff : u32 ,
318
+ indirectsymoff : u32 = 0 ,
319
319
320
320
/// number of indirect symbol table entries
321
- nindirectsyms : u32 ,
321
+ nindirectsyms : u32 = 0 ,
322
322
323
323
// To support relocating an individual module in a library file quickly the
324
324
// external relocation entries for each module in the library need to be
@@ -347,20 +347,20 @@ pub const dysymtab_command = extern struct {
347
347
// remaining relocation entries must be local).
348
348
349
349
/// offset to external relocation entries
350
- extreloff : u32 ,
350
+ extreloff : u32 = 0 ,
351
351
352
352
/// number of external relocation entries
353
- nextrel : u32 ,
353
+ nextrel : u32 = 0 ,
354
354
355
355
// All the local relocation entries are grouped together (they are not
356
356
// grouped by their module since they are only used if the object is moved
357
357
// from it staticly link edited address).
358
358
359
359
/// offset to local relocation entries
360
- locreloff : u32 ,
360
+ locreloff : u32 = 0 ,
361
361
362
362
/// number of local relocation entries
363
- nlocrel : u32 ,
363
+ nlocrel : u32 = 0 ,
364
364
};
365
365
366
366
/// The linkedit_data_command contains the offsets and sizes of a blob
@@ -370,13 +370,13 @@ pub const linkedit_data_command = extern struct {
370
370
cmd : LC ,
371
371
372
372
/// sizeof(struct linkedit_data_command)
373
- cmdsize : u32 ,
373
+ cmdsize : u32 = @sizeOf ( linkedit_data_command ) ,
374
374
375
375
/// file offset of data in __LINKEDIT segment
376
- dataoff : u32 ,
376
+ dataoff : u32 = 0 ,
377
377
378
378
/// file size of data in __LINKEDIT segment
379
- datasize : u32 ,
379
+ datasize : u32 = 0 ,
380
380
};
381
381
382
382
/// The dyld_info_command contains the file offsets and sizes of
@@ -387,10 +387,10 @@ pub const linkedit_data_command = extern struct {
387
387
/// to interpret it.
388
388
pub const dyld_info_command = extern struct {
389
389
/// LC_DYLD_INFO or LC_DYLD_INFO_ONLY
390
- cmd : LC ,
390
+ cmd : LC = .DYLD_INFO_ONLY ,
391
391
392
392
/// sizeof(struct dyld_info_command)
393
- cmdsize : u32 ,
393
+ cmdsize : u32 = @sizeOf ( dyld_info_command ) ,
394
394
395
395
// Dyld rebases an image whenever dyld loads it at an address different
396
396
// from its preferred address. The rebase information is a stream
@@ -403,10 +403,10 @@ pub const dyld_info_command = extern struct {
403
403
// bytes.
404
404
405
405
/// file offset to rebase info
406
- rebase_off : u32 ,
406
+ rebase_off : u32 = 0 ,
407
407
408
408
/// size of rebase info
409
- rebase_size : u32 ,
409
+ rebase_size : u32 = 0 ,
410
410
411
411
// Dyld binds an image during the loading process, if the image
412
412
// requires any pointers to be initialized to symbols in other images.
@@ -420,10 +420,10 @@ pub const dyld_info_command = extern struct {
420
420
// encoded in a few bytes.
421
421
422
422
/// file offset to binding info
423
- bind_off : u32 ,
423
+ bind_off : u32 = 0 ,
424
424
425
425
/// size of binding info
426
- bind_size : u32 ,
426
+ bind_size : u32 = 0 ,
427
427
428
428
// Some C++ programs require dyld to unique symbols so that all
429
429
// images in the process use the same copy of some code/data.
@@ -440,10 +440,10 @@ pub const dyld_info_command = extern struct {
440
440
// and the call to operator new is then rebound.
441
441
442
442
/// file offset to weak binding info
443
- weak_bind_off : u32 ,
443
+ weak_bind_off : u32 = 0 ,
444
444
445
445
/// size of weak binding info
446
- weak_bind_size : u32 ,
446
+ weak_bind_size : u32 = 0 ,
447
447
448
448
// Some uses of external symbols do not need to be bound immediately.
449
449
// Instead they can be lazily bound on first use. The lazy_bind
@@ -457,10 +457,10 @@ pub const dyld_info_command = extern struct {
457
457
// to bind.
458
458
459
459
/// file offset to lazy binding info
460
- lazy_bind_off : u32 ,
460
+ lazy_bind_off : u32 = 0 ,
461
461
462
462
/// size of lazy binding info
463
- lazy_bind_size : u32 ,
463
+ lazy_bind_size : u32 = 0 ,
464
464
465
465
// The symbols exported by a dylib are encoded in a trie. This
466
466
// is a compact representation that factors out common prefixes.
@@ -494,10 +494,10 @@ pub const dyld_info_command = extern struct {
494
494
// edge points to.
495
495
496
496
/// file offset to lazy binding info
497
- export_off : u32 ,
497
+ export_off : u32 = 0 ,
498
498
499
499
/// size of lazy binding info
500
- export_size : u32 ,
500
+ export_size : u32 = 0 ,
501
501
};
502
502
503
503
/// A program that uses a dynamic linker contains a dylinker_command to identify
0 commit comments