Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Struct

ObjCopy

Public Struct
std.Build.Configuration.Step.ObjCopy
pub const ObjCopy = struct

Fields

flags: @This().Flags
input_file: LazyPath.Index
output_file: GeneratedFileIndex
basename: Storage.FlagOptional(.flags, .basename, String)
debug_file: Storage.FlagOptional(.flags, .debug_file, GeneratedFileIndex)
debug_basename: Storage.FlagOptional(.flags, .debug_basename, String)
only_section: Storage.FlagOptional(.flags, .only_section, String)
pad_to: Storage.FlagOptional(.flags, .pad_to, u64)
add_section: Storage.FlagLengthPrefixedList(.flags, .add_section, AddSection)
update_section: Storage.FlagLengthPrefixedList(.flags, .update_section, UpdateSection)

Structs

Types

File

Build/Configuration.zig:1289
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
    pub const ObjCopy = struct {
        flags: @This().Flags,
        input_file: LazyPath.Index,
        output_file: GeneratedFileIndex,
        basename: Storage.FlagOptional(.flags, .basename, String),
        debug_file: Storage.FlagOptional(.flags, .debug_file, GeneratedFileIndex),
        debug_basename: Storage.FlagOptional(.flags, .debug_basename, String),
        only_section: Storage.FlagOptional(.flags, .only_section, String),
        pad_to: Storage.FlagOptional(.flags, .pad_to, u64),
        add_section: Storage.FlagLengthPrefixedList(.flags, .add_section, AddSection),
        update_section: Storage.FlagLengthPrefixedList(.flags, .update_section, UpdateSection),

        pub const Format = enum(u2) {
            binary,
            hex,
            elf,
            default,

            pub fn init(f: ?std.Build.Step.ObjCopy.Format) @This() {
                return switch (f orelse return .default) {
                    .binary => .binary,
                    .hex => .hex,
                    .elf => .elf,
                };
            }
        };

        pub const Strip = enum(u2) {
            none,
            debug,
            debug_and_symbols,
        };

        pub const AddSection = extern struct {
            section_name: String,
            file_path: LazyPath.Index,
        };

        pub const UpdateSection = extern struct {
            section_name: String,
            flags: @This().Flags,

            pub const Flags = packed struct(u32) {
                section_flags: SectionFlags,
                alignment: Alignment,
                _: u17 = 0,
            };
        };

        pub const SectionFlags = packed struct(u9) {
            /// add SHF_ALLOC
            alloc: bool = false,
            /// if section is SHT_NOBITS, set SHT_PROGBITS, otherwise do nothing
            contents: bool = false,
            /// if section is SHT_NOBITS, set SHT_PROGBITS, otherwise do nothing (same as contents)
            load: bool = false,
            /// readonly: clear default SHF_WRITE flag
            readonly: bool = false,
            /// add SHF_EXECINSTR
            code: bool = false,
            /// add SHF_EXCLUDE
            exclude: bool = false,
            /// add SHF_X86_64_LARGE. Fatal error if target is not x86_64
            large: bool = false,
            /// add SHF_MERGE
            merge: bool = false,
            /// add SHF_STRINGS
            strings: bool = false,

            pub const default: @This() = .{};
        };

        pub const Flags = packed struct(u32) {
            tag: Tag = .obj_copy,
            basename: bool,
            debug_file: bool,
            debug_basename: bool,
            format: Format,
            strip: Strip,
            compress_debug: bool,
            only_section: bool,
            pad_to: bool,
            add_section: bool,
            update_section: bool,
            _: u15 = 0,
        };
    }