| ... | ... | @@ -33,7 +33,7 @@ output_file: std.Build.GeneratedFile, |
| 33 | 33 | output_file_debug: ?std.Build.GeneratedFile, |
| 34 | 34 | |
| 35 | 35 | format: ?RawFormat, |
| 36 | | only_section: ?[]const u8, |
| 36 | only_sections: ?[]const []const u8, |
| 37 | 37 | pad_to: ?u64, |
| 38 | 38 | strip: Strip, |
| 39 | 39 | compress_debug: bool, |
| ... | ... | @@ -41,7 +41,7 @@ compress_debug: bool, |
| 41 | 41 | pub const Options = struct { |
| 42 | 42 | basename: ?[]const u8 = null, |
| 43 | 43 | format: ?RawFormat = null, |
| 44 | | only_section: ?[]const u8 = null, |
| 44 | only_sections: ?[]const []const u8 = null, |
| 45 | 45 | pad_to: ?u64 = null, |
| 46 | 46 | |
| 47 | 47 | compress_debug: bool = false, |
| ... | ... | @@ -71,7 +71,7 @@ pub fn create( |
| 71 | 71 | .output_file = std.Build.GeneratedFile{ .step = &self.step }, |
| 72 | 72 | .output_file_debug = if (options.strip != .none and options.extract_to_separate_file) std.Build.GeneratedFile{ .step = &self.step } else null, |
| 73 | 73 | .format = options.format, |
| 74 | | .only_section = options.only_section, |
| 74 | .only_sections = options.only_sections, |
| 75 | 75 | .pad_to = options.pad_to, |
| 76 | 76 | .strip = options.strip, |
| 77 | 77 | .compress_debug = options.compress_debug, |
| ... | ... | @@ -103,7 +103,7 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { |
| 103 | 103 | |
| 104 | 104 | const full_src_path = self.input_file.getPath(b); |
| 105 | 105 | _ = try man.addFile(full_src_path, null); |
| 106 | | man.hash.addOptionalBytes(self.only_section); |
| 106 | man.hash.addOptionalListOfBytes(self.only_sections); |
| 107 | 107 | man.hash.addOptional(self.pad_to); |
| 108 | 108 | man.hash.addOptional(self.format); |
| 109 | 109 | man.hash.add(self.compress_debug); |
| ... | ... | @@ -135,8 +135,10 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { |
| 135 | 135 | var argv = std.ArrayList([]const u8).init(b.allocator); |
| 136 | 136 | try argv.appendSlice(&.{ b.graph.zig_exe, "objcopy" }); |
| 137 | 137 | |
| 138 | | if (self.only_section) |only_section| { |
| 139 | | try argv.appendSlice(&.{ "-j", only_section }); |
| 138 | if (self.only_sections) |only_sections| { |
| 139 | for (only_sections) |only_section| { |
| 140 | try argv.appendSlice(&.{ "-j", only_section }); |
| 141 | } |
| 140 | 142 | } |
| 141 | 143 | switch (self.strip) { |
| 142 | 144 | .none => {}, |