| ... | @@ -185,14 +185,17 @@ fn cmdObjCopy( | ... | @@ -185,14 +185,17 @@ fn cmdObjCopy( |
| 185 | fatal("zig objcopy: ELF to RAW or HEX copying does not support --strip", .{}); | 185 | fatal("zig objcopy: ELF to RAW or HEX copying does not support --strip", .{}); |
| 186 | if (opt_extract != null) | 186 | if (opt_extract != null) |
| 187 | fatal("zig objcopy: ELF to RAW or HEX copying does not support --extract-to", .{}); | 187 | fatal("zig objcopy: ELF to RAW or HEX copying does not support --extract-to", .{}); |
| | 188 | if (add_section != null) |
| | 189 | fatal("zig objcopy: ELF to RAW or HEX copying does not support --add-section", .{}); |
| | 190 | if (set_section_alignment != null) |
| | 191 | fatal("zig objcopy: ELF to RAW or HEX copying does not support --set_section_alignment", .{}); |
| | 192 | if (set_section_flags != null) |
| | 193 | fatal("zig objcopy: ELF to RAW or HEX copying does not support --set_section_flags", .{}); |
| 188 | | 194 | |
| 189 | try emitElf(arena, in_file, out_file, elf_hdr, .{ | 195 | try emitElf(arena, in_file, out_file, elf_hdr, .{ |
| 190 | .ofmt = out_fmt, | 196 | .ofmt = out_fmt, |
| 191 | .only_section = only_section, | 197 | .only_section = only_section, |
| 192 | .pad_to = pad_to, | 198 | .pad_to = pad_to, |
| 193 | .add_section = add_section, | | |
| 194 | .set_section_alignment = set_section_alignment, | | |
| 195 | .set_section_flags = set_section_flags, | | |
| 196 | }); | 199 | }); |
| 197 | }, | 200 | }, |
| 198 | .elf => { | 201 | .elf => { |
| ... | @@ -279,9 +282,9 @@ pub const EmitRawElfOptions = struct { | ... | @@ -279,9 +282,9 @@ pub const EmitRawElfOptions = struct { |
| 279 | ofmt: std.Target.ObjectFormat, | 282 | ofmt: std.Target.ObjectFormat, |
| 280 | only_section: ?[]const u8 = null, | 283 | only_section: ?[]const u8 = null, |
| 281 | pad_to: ?u64 = null, | 284 | pad_to: ?u64 = null, |
| 282 | add_section: ?AddSection, | 285 | add_section: ?AddSection = null, |
| 283 | set_section_alignment: ?SetSectionAlignment, | 286 | set_section_alignment: ?SetSectionAlignment = null, |
| 284 | set_section_flags: ?SetSectionFlags, | 287 | set_section_flags: ?SetSectionFlags = null, |
| 285 | }; | 288 | }; |
| 286 | | 289 | |
| 287 | const AddSection = struct { | 290 | const AddSection = struct { |