| author | |
| committer | |
| log | d305ba7f2d5ae524fd71365852fb5196e98fdbaf |
| tree | c8430ead46207fdecc5cfb3d0a2333e9afac477b |
| parent | 3d5ff91441040d11cca814f298231a501700da9e |
| parent | 742fe65f3ea4390acf7ed6beec95f910f56e1246 |
| signature |
stdlib: Add Intel HEX support to InstallRawStep5 files changed, 414 insertions(+), 6 deletions(-)
lib/std/build.zig+14-1| ... | @@ -989,10 +989,15 @@ pub const Builder = struct { | ... | @@ -989,10 +989,15 @@ pub const Builder = struct { |
| 989 | self.getInstallStep().dependOn(&self.addInstallFileWithDir(.{ .path = src_path }, .lib, dest_rel_path).step); | 989 | self.getInstallStep().dependOn(&self.addInstallFileWithDir(.{ .path = src_path }, .lib, dest_rel_path).step); |
| 990 | } | 990 | } |
| 991 | 991 | ||
| 992 | /// Output format (BIN vs Intel HEX) determined by filename | ||
| 992 | pub fn installRaw(self: *Builder, artifact: *LibExeObjStep, dest_filename: []const u8) void { | 993 | pub fn installRaw(self: *Builder, artifact: *LibExeObjStep, dest_filename: []const u8) void { |
| 993 | self.getInstallStep().dependOn(&self.addInstallRaw(artifact, dest_filename).step); | 994 | self.getInstallStep().dependOn(&self.addInstallRaw(artifact, dest_filename).step); |
| 994 | } | 995 | } |
| 995 | 996 | ||
| 997 | pub fn installRawWithFormat(self: *Builder, artifact: *LibExeObjStep, dest_filename: []const u8, format: InstallRawStep.RawFormat) void { | ||
| 998 | self.getInstallStep().dependOn(&self.addInstallRawWithFormat(artifact, dest_filename, format).step); | ||
| 999 | } | ||
| 1000 | |||
| 996 | ///`dest_rel_path` is relative to install prefix path | 1001 | ///`dest_rel_path` is relative to install prefix path |
| 997 | pub fn addInstallFile(self: *Builder, source: FileSource, dest_rel_path: []const u8) *InstallFileStep { | 1002 | pub fn addInstallFile(self: *Builder, source: FileSource, dest_rel_path: []const u8) *InstallFileStep { |
| 998 | return self.addInstallFileWithDir(source.dupe(self), .prefix, dest_rel_path); | 1003 | return self.addInstallFileWithDir(source.dupe(self), .prefix, dest_rel_path); |
| ... | @@ -1009,7 +1014,11 @@ pub const Builder = struct { | ... | @@ -1009,7 +1014,11 @@ pub const Builder = struct { |
| 1009 | } | 1014 | } |
| 1010 | 1015 | ||
| 1011 | pub fn addInstallRaw(self: *Builder, artifact: *LibExeObjStep, dest_filename: []const u8) *InstallRawStep { | 1016 | pub fn addInstallRaw(self: *Builder, artifact: *LibExeObjStep, dest_filename: []const u8) *InstallRawStep { |
| 1012 | return InstallRawStep.create(self, artifact, dest_filename); | 1017 | return InstallRawStep.create(self, artifact, dest_filename, null); |
| 1018 | } | ||
| 1019 | |||
| 1020 | pub fn addInstallRawWithFormat(self: *Builder, artifact: *LibExeObjStep, dest_filename: []const u8, format: InstallRawStep.RawFormat) *InstallRawStep { | ||
| 1021 | return InstallRawStep.create(self, artifact, dest_filename, format); | ||
| 1013 | } | 1022 | } |
| 1014 | 1023 | ||
| 1015 | pub fn addInstallFileWithDir( | 1024 | pub fn addInstallFileWithDir( |
| ... | @@ -1709,6 +1718,10 @@ pub const LibExeObjStep = struct { | ... | @@ -1709,6 +1718,10 @@ pub const LibExeObjStep = struct { |
| 1709 | self.builder.installRaw(self, dest_filename); | 1718 | self.builder.installRaw(self, dest_filename); |
| 1710 | } | 1719 | } |
| 1711 | 1720 | ||
| 1721 | pub fn installRawWithFormat(self: *LibExeObjStep, dest_filename: []const u8, format: InstallRawStep.RawFormat) void { | ||
| 1722 | self.builder.installRawWithFormat(self, dest_filename, format); | ||
| 1723 | } | ||
| 1724 | |||
| 1712 | /// Creates a `RunStep` with an executable built with `addExecutable`. | 1725 | /// Creates a `RunStep` with an executable built with `addExecutable`. |
| 1713 | /// Add command line arguments with `addArg`. | 1726 | /// Add command line arguments with `addArg`. |
| 1714 | pub fn run(exe: *LibExeObjStep) *RunStep { | 1727 | pub fn run(exe: *LibExeObjStep) *RunStep { |
lib/std/build/InstallRawStep.zig+223-5| ... | @@ -159,7 +159,147 @@ fn writeBinaryElfSection(elf_file: File, out_file: File, section: *BinaryElfSect | ... | @@ -159,7 +159,147 @@ fn writeBinaryElfSection(elf_file: File, out_file: File, section: *BinaryElfSect |
| 159 | }); | 159 | }); |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | fn emitRaw(allocator: *Allocator, elf_path: []const u8, raw_path: []const u8) !void { | 162 | const HexWriter = struct { |
| 163 | prev_addr: ?u32 = null, | ||
| 164 | out_file: File, | ||
| 165 | |||
| 166 | /// Max data bytes per line of output | ||
| 167 | const MAX_PAYLOAD_LEN: u8 = 16; | ||
| 168 | |||
| 169 | fn addressParts(address: u16) [2]u8 { | ||
| 170 | const msb = @truncate(u8, address >> 8); | ||
| 171 | const lsb = @truncate(u8, address); | ||
| 172 | return [2]u8{ msb, lsb }; | ||
| 173 | } | ||
| 174 | |||
| 175 | const Record = struct { | ||
| 176 | const Type = enum(u8) { | ||
| 177 | Data = 0, | ||
| 178 | EOF = 1, | ||
| 179 | ExtendedSegmentAddress = 2, | ||
| 180 | ExtendedLinearAddress = 4, | ||
| 181 | }; | ||
| 182 | |||
| 183 | address: u16, | ||
| 184 | payload: union(Type) { | ||
| 185 | Data: []const u8, | ||
| 186 | EOF: void, | ||
| 187 | ExtendedSegmentAddress: [2]u8, | ||
| 188 | ExtendedLinearAddress: [2]u8, | ||
| 189 | }, | ||
| 190 | |||
| 191 | fn EOF() Record { | ||
| 192 | return Record{ | ||
| 193 | .address = 0, | ||
| 194 | .payload = .EOF, | ||
| 195 | }; | ||
| 196 | } | ||
| 197 | |||
| 198 | fn Data(address: u32, data: []const u8) Record { | ||
| 199 | return Record{ | ||
| 200 | .address = @intCast(u16, address % 0x10000), | ||
| 201 | .payload = .{ .Data = data }, | ||
| 202 | }; | ||
| 203 | } | ||
| 204 | |||
| 205 | fn Address(address: u32) Record { | ||
| 206 | std.debug.assert(address > 0xFFFF); | ||
| 207 | const segment = @intCast(u16, address / 0x10000); | ||
| 208 | if (address > 0xFFFFF) { | ||
| 209 | return Record{ | ||
| 210 | .address = 0, | ||
| 211 | .payload = .{ .ExtendedLinearAddress = addressParts(segment) }, | ||
| 212 | }; | ||
| 213 | } else { | ||
| 214 | return Record{ | ||
| 215 | .address = 0, | ||
| 216 | .payload = .{ .ExtendedSegmentAddress = addressParts(segment << 12) }, | ||
| 217 | }; | ||
| 218 | } | ||
| 219 | } | ||
| 220 | |||
| 221 | fn getPayloadBytes(self: Record) []const u8 { | ||
| 222 | return switch (self.payload) { | ||
| 223 | .Data => |d| d, | ||
| 224 | .EOF => @as([]const u8, &.{}), | ||
| 225 | .ExtendedSegmentAddress, .ExtendedLinearAddress => |*seg| seg, | ||
| 226 | }; | ||
| 227 | } | ||
| 228 | |||
| 229 | fn checksum(self: Record) u8 { | ||
| 230 | const payload_bytes = self.getPayloadBytes(); | ||
| 231 | |||
| 232 | var sum: u8 = @intCast(u8, payload_bytes.len); | ||
| 233 | const parts = addressParts(self.address); | ||
| 234 | sum +%= parts[0]; | ||
| 235 | sum +%= parts[1]; | ||
| 236 | sum +%= @enumToInt(self.payload); | ||
| 237 | for (payload_bytes) |byte| { | ||
| 238 | sum +%= byte; | ||
| 239 | } | ||
| 240 | return (sum ^ 0xFF) +% 1; | ||
| 241 | } | ||
| 242 | |||
| 243 | fn write(self: Record, file: File) File.WriteError!void { | ||
| 244 | const linesep = "\r\n"; | ||
| 245 | // colon, (length, address, type, payload, checksum) as hex, CRLF | ||
| 246 | const BUFSIZE = 1 + (1 + 2 + 1 + MAX_PAYLOAD_LEN + 1) * 2 + linesep.len; | ||
| 247 | var outbuf: [BUFSIZE]u8 = undefined; | ||
| 248 | const payload_bytes = self.getPayloadBytes(); | ||
| 249 | std.debug.assert(payload_bytes.len <= MAX_PAYLOAD_LEN); | ||
| 250 | |||
| 251 | const line = try std.fmt.bufPrint(&outbuf, ":{0X:0>2}{1X:0>4}{2X:0>2}{3s}{4X:0>2}" ++ linesep, .{ | ||
| 252 | @intCast(u8, payload_bytes.len), | ||
| 253 | self.address, | ||
| 254 | @enumToInt(self.payload), | ||
| 255 | std.fmt.fmtSliceHexUpper(payload_bytes), | ||
| 256 | self.checksum(), | ||
| 257 | }); | ||
| 258 | try file.writeAll(line); | ||
| 259 | } | ||
| 260 | }; | ||
| 261 | |||
| 262 | pub fn writeSegment(self: *HexWriter, segment: *const BinaryElfSegment, elf_file: File) !void { | ||
| 263 | var buf: [MAX_PAYLOAD_LEN]u8 = undefined; | ||
| 264 | var bytes_read: usize = 0; | ||
| 265 | while (bytes_read < segment.fileSize) { | ||
| 266 | const row_address = @intCast(u32, segment.physicalAddress + bytes_read); | ||
| 267 | |||
| 268 | const remaining = segment.fileSize - bytes_read; | ||
| 269 | const to_read = @minimum(remaining, MAX_PAYLOAD_LEN); | ||
| 270 | const did_read = try elf_file.preadAll(buf[0..to_read], segment.elfOffset + bytes_read); | ||
| 271 | if (did_read < to_read) return error.UnexpectedEOF; | ||
| 272 | |||
| 273 | try self.writeDataRow(row_address, buf[0..did_read]); | ||
| 274 | |||
| 275 | bytes_read += did_read; | ||
| 276 | } | ||
| 277 | } | ||
| 278 | |||
| 279 | fn writeDataRow(self: *HexWriter, address: u32, data: []const u8) File.WriteError!void { | ||
| 280 | const record = Record.Data(address, data); | ||
| 281 | if (address > 0xFFFF and (self.prev_addr == null or record.address != self.prev_addr.?)) { | ||
| 282 | try Record.Address(address).write(self.out_file); | ||
| 283 | } | ||
| 284 | try record.write(self.out_file); | ||
| 285 | self.prev_addr = @intCast(u32, record.address + data.len); | ||
| 286 | } | ||
| 287 | |||
| 288 | fn writeEOF(self: HexWriter) File.WriteError!void { | ||
| 289 | try Record.EOF().write(self.out_file); | ||
| 290 | } | ||
| 291 | }; | ||
| 292 | |||
| 293 | fn containsValidAddressRange(segments: []*BinaryElfSegment) bool { | ||
| 294 | const max_address = std.math.maxInt(u32); | ||
| 295 | for (segments) |segment| { | ||
| 296 | if (segment.fileSize > max_address or | ||
| 297 | segment.physicalAddress > max_address - segment.fileSize) return false; | ||
| 298 | } | ||
| 299 | return true; | ||
| 300 | } | ||
| 301 | |||
| 302 | fn emitRaw(allocator: *Allocator, elf_path: []const u8, raw_path: []const u8, format: RawFormat) !void { | ||
| 163 | var elf_file = try fs.cwd().openFile(elf_path, .{}); | 303 | var elf_file = try fs.cwd().openFile(elf_path, .{}); |
| 164 | defer elf_file.close(); | 304 | defer elf_file.close(); |
| 165 | 305 | ||
| ... | @@ -169,8 +309,26 @@ fn emitRaw(allocator: *Allocator, elf_path: []const u8, raw_path: []const u8) !v | ... | @@ -169,8 +309,26 @@ fn emitRaw(allocator: *Allocator, elf_path: []const u8, raw_path: []const u8) !v |
| 169 | var binary_elf_output = try BinaryElfOutput.parse(allocator, elf_file); | 309 | var binary_elf_output = try BinaryElfOutput.parse(allocator, elf_file); |
| 170 | defer binary_elf_output.deinit(); | 310 | defer binary_elf_output.deinit(); |
| 171 | 311 | ||
| 172 | for (binary_elf_output.sections.items) |section| { | 312 | switch (format) { |
| 173 | try writeBinaryElfSection(elf_file, out_file, section); | 313 | .bin => { |
| 314 | for (binary_elf_output.sections.items) |section| { | ||
| 315 | try writeBinaryElfSection(elf_file, out_file, section); | ||
| 316 | } | ||
| 317 | }, | ||
| 318 | .hex => { | ||
| 319 | if (binary_elf_output.segments.items.len == 0) return; | ||
| 320 | if (!containsValidAddressRange(binary_elf_output.segments.items)) { | ||
| 321 | return error.InvalidHexfileAddressRange; | ||
| 322 | } | ||
| 323 | |||
| 324 | var hex_writer = HexWriter{ .out_file = out_file }; | ||
| 325 | for (binary_elf_output.sections.items) |section| { | ||
| 326 | if (section.segment) |segment| { | ||
| 327 | try hex_writer.writeSegment(segment, elf_file); | ||
| 328 | } | ||
| 329 | } | ||
| 330 | try hex_writer.writeEOF(); | ||
| 331 | }, | ||
| 174 | } | 332 | } |
| 175 | } | 333 | } |
| 176 | 334 | ||
| ... | @@ -178,13 +336,27 @@ const InstallRawStep = @This(); | ... | @@ -178,13 +336,27 @@ const InstallRawStep = @This(); |
| 178 | 336 | ||
| 179 | pub const base_id = .install_raw; | 337 | pub const base_id = .install_raw; |
| 180 | 338 | ||
| 339 | pub const RawFormat = enum { | ||
| 340 | bin, | ||
| 341 | hex, | ||
| 342 | }; | ||
| 343 | |||
| 181 | step: Step, | 344 | step: Step, |
| 182 | builder: *Builder, | 345 | builder: *Builder, |
| 183 | artifact: *LibExeObjStep, | 346 | artifact: *LibExeObjStep, |
| 184 | dest_dir: InstallDir, | 347 | dest_dir: InstallDir, |
| 185 | dest_filename: []const u8, | 348 | dest_filename: []const u8, |
| 349 | format: RawFormat, | ||
| 350 | output_file: std.build.GeneratedFile, | ||
| 351 | |||
| 352 | fn detectFormat(filename: []const u8) RawFormat { | ||
| 353 | if (std.mem.endsWith(u8, filename, ".hex") or std.mem.endsWith(u8, filename, ".ihex")) { | ||
| 354 | return .hex; | ||
| 355 | } | ||
| 356 | return .bin; | ||
| 357 | } | ||
| 186 | 358 | ||
| 187 | pub fn create(builder: *Builder, artifact: *LibExeObjStep, dest_filename: []const u8) *InstallRawStep { | 359 | pub fn create(builder: *Builder, artifact: *LibExeObjStep, dest_filename: []const u8, format: ?RawFormat) *InstallRawStep { |
| 188 | const self = builder.allocator.create(InstallRawStep) catch unreachable; | 360 | const self = builder.allocator.create(InstallRawStep) catch unreachable; |
| 189 | self.* = InstallRawStep{ | 361 | self.* = InstallRawStep{ |
| 190 | .step = Step.init(.install_raw, builder.fmt("install raw binary {s}", .{artifact.step.name}), builder.allocator, make), | 362 | .step = Step.init(.install_raw, builder.fmt("install raw binary {s}", .{artifact.step.name}), builder.allocator, make), |
| ... | @@ -197,6 +369,8 @@ pub fn create(builder: *Builder, artifact: *LibExeObjStep, dest_filename: []cons | ... | @@ -197,6 +369,8 @@ pub fn create(builder: *Builder, artifact: *LibExeObjStep, dest_filename: []cons |
| 197 | .lib => unreachable, | 369 | .lib => unreachable, |
| 198 | }, | 370 | }, |
| 199 | .dest_filename = dest_filename, | 371 | .dest_filename = dest_filename, |
| 372 | .format = format orelse detectFormat(dest_filename), | ||
| 373 | .output_file = std.build.GeneratedFile{ .step = &self.step }, | ||
| 200 | }; | 374 | }; |
| 201 | self.step.dependOn(&artifact.step); | 375 | self.step.dependOn(&artifact.step); |
| 202 | 376 | ||
| ... | @@ -204,6 +378,10 @@ pub fn create(builder: *Builder, artifact: *LibExeObjStep, dest_filename: []cons | ... | @@ -204,6 +378,10 @@ pub fn create(builder: *Builder, artifact: *LibExeObjStep, dest_filename: []cons |
| 204 | return self; | 378 | return self; |
| 205 | } | 379 | } |
| 206 | 380 | ||
| 381 | pub fn getOutputSource(self: *const InstallRawStep) std.build.FileSource { | ||
| 382 | return std.build.FileSource{ .generated = &self.output_file }; | ||
| 383 | } | ||
| 384 | |||
| 207 | fn make(step: *Step) !void { | 385 | fn make(step: *Step) !void { |
| 208 | const self = @fieldParentPtr(InstallRawStep, "step", step); | 386 | const self = @fieldParentPtr(InstallRawStep, "step", step); |
| 209 | const builder = self.builder; | 387 | const builder = self.builder; |
| ... | @@ -217,9 +395,49 @@ fn make(step: *Step) !void { | ... | @@ -217,9 +395,49 @@ fn make(step: *Step) !void { |
| 217 | const full_dest_path = builder.getInstallPath(self.dest_dir, self.dest_filename); | 395 | const full_dest_path = builder.getInstallPath(self.dest_dir, self.dest_filename); |
| 218 | 396 | ||
| 219 | fs.cwd().makePath(builder.getInstallPath(self.dest_dir, "")) catch unreachable; | 397 | fs.cwd().makePath(builder.getInstallPath(self.dest_dir, "")) catch unreachable; |
| 220 | try emitRaw(builder.allocator, full_src_path, full_dest_path); | 398 | try emitRaw(builder.allocator, full_src_path, full_dest_path, self.format); |
| 399 | self.output_file.path = full_dest_path; | ||
| 221 | } | 400 | } |
| 222 | 401 | ||
| 223 | test { | 402 | test { |
| 224 | std.testing.refAllDecls(InstallRawStep); | 403 | std.testing.refAllDecls(InstallRawStep); |
| 225 | } | 404 | } |
| 405 | |||
| 406 | test "Detect format from filename" { | ||
| 407 | try std.testing.expectEqual(RawFormat.hex, detectFormat("foo.hex")); | ||
| 408 | try std.testing.expectEqual(RawFormat.hex, detectFormat("foo.ihex")); | ||
| 409 | try std.testing.expectEqual(RawFormat.bin, detectFormat("foo.bin")); | ||
| 410 | try std.testing.expectEqual(RawFormat.bin, detectFormat("foo.bar")); | ||
| 411 | try std.testing.expectEqual(RawFormat.bin, detectFormat("a")); | ||
| 412 | } | ||
| 413 | |||
| 414 | test "containsValidAddressRange" { | ||
| 415 | var segment = BinaryElfSegment{ | ||
| 416 | .physicalAddress = 0, | ||
| 417 | .virtualAddress = 0, | ||
| 418 | .elfOffset = 0, | ||
| 419 | .binaryOffset = 0, | ||
| 420 | .fileSize = 0, | ||
| 421 | .firstSection = null, | ||
| 422 | }; | ||
| 423 | var buf: [1]*BinaryElfSegment = .{&segment}; | ||
| 424 | |||
| 425 | // segment too big | ||
| 426 | segment.fileSize = std.math.maxInt(u32) + 1; | ||
| 427 | try std.testing.expect(!containsValidAddressRange(&buf)); | ||
| 428 | |||
| 429 | // start address too big | ||
| 430 | segment.physicalAddress = std.math.maxInt(u32) + 1; | ||
| 431 | segment.fileSize = 2; | ||
| 432 | try std.testing.expect(!containsValidAddressRange(&buf)); | ||
| 433 | |||
| 434 | // max address too big | ||
| 435 | segment.physicalAddress = std.math.maxInt(u32) - 1; | ||
| 436 | segment.fileSize = 2; | ||
| 437 | try std.testing.expect(!containsValidAddressRange(&buf)); | ||
| 438 | |||
| 439 | // is ok | ||
| 440 | segment.physicalAddress = std.math.maxInt(u32) - 1; | ||
| 441 | segment.fileSize = 1; | ||
| 442 | try std.testing.expect(containsValidAddressRange(&buf)); | ||
| 443 | } |
test/standalone.zig+1| ... | @@ -27,6 +27,7 @@ pub fn addCases(cases: *tests.StandaloneContext) void { | ... | @@ -27,6 +27,7 @@ pub fn addCases(cases: *tests.StandaloneContext) void { |
| 27 | cases.addBuildFile("test/standalone/brace_expansion/build.zig", .{}); | 27 | cases.addBuildFile("test/standalone/brace_expansion/build.zig", .{}); |
| 28 | cases.addBuildFile("test/standalone/empty_env/build.zig", .{}); | 28 | cases.addBuildFile("test/standalone/empty_env/build.zig", .{}); |
| 29 | cases.addBuildFile("test/standalone/issue_7030/build.zig", .{}); | 29 | cases.addBuildFile("test/standalone/issue_7030/build.zig", .{}); |
| 30 | cases.addBuildFile("test/standalone/install_raw_hex/build.zig", .{}); | ||
| 30 | if (std.Target.current.os.tag != .wasi) { | 31 | if (std.Target.current.os.tag != .wasi) { |
| 31 | cases.addBuildFile("test/standalone/load_dynamic_library/build.zig", .{}); | 32 | cases.addBuildFile("test/standalone/load_dynamic_library/build.zig", .{}); |
| 32 | } | 33 | } |
test/standalone/install_raw_hex/build.zig created+173| ... | @@ -0,0 +1,173 @@ | ||
| 1 | const Builder = @import("std").build.Builder; | ||
| 2 | const builtin = @import("builtin"); | ||
| 3 | const std = @import("std"); | ||
| 4 | const CheckFileStep = std.build.CheckFileStep; | ||
| 5 | |||
| 6 | pub fn build(b: *Builder) void { | ||
| 7 | const target = .{ | ||
| 8 | .cpu_arch = .thumb, | ||
| 9 | .cpu_model = .{ .explicit = &std.Target.arm.cpu.cortex_m4 }, | ||
| 10 | .os_tag = .freestanding, | ||
| 11 | .abi = .gnueabihf, | ||
| 12 | }; | ||
| 13 | |||
| 14 | const mode = b.standardReleaseOptions(); | ||
| 15 | |||
| 16 | const elf = b.addExecutable("zig-nrf52-blink.elf", "main.zig"); | ||
| 17 | elf.setTarget(target); | ||
| 18 | elf.setBuildMode(mode); | ||
| 19 | |||
| 20 | const test_step = b.step("test", "Test the program"); | ||
| 21 | b.default_step.dependOn(test_step); | ||
| 22 | |||
| 23 | const hex_step = b.addInstallRaw(elf, "hello.hex"); | ||
| 24 | test_step.dependOn(&hex_step.step); | ||
| 25 | |||
| 26 | const explicit_format_hex_step = b.addInstallRawWithFormat(elf, "hello.foo", .hex); | ||
| 27 | test_step.dependOn(&explicit_format_hex_step.step); | ||
| 28 | |||
| 29 | const expected_hex = &[_][]const u8{ | ||
| 30 | ":020000021000EC", | ||
| 31 | ":1000D400D001010001000000D20101000100000074", | ||
| 32 | ":1000E40028020100010000002402010001000000B8", | ||
| 33 | ":1000F4003A02010001000000E202010001000000D8", | ||
| 34 | ":100104000C03010001000000A50202000000000031", | ||
| 35 | ":1001140000000000000000000000000000000000DB", | ||
| 36 | ":1001240000000000000000000000000000000000CB", | ||
| 37 | ":1001340000000000000000000000000000000000BB", | ||
| 38 | ":10014400AF02020098020100090000004D02010004", | ||
| 39 | ":100154000900000001000000000000000000000091", | ||
| 40 | ":100164000004000100C0800000020000080000003C", | ||
| 41 | ":100174000000000000000000000000001E0000005D", | ||
| 42 | ":1001840048010100000040888080FF000A14002913", | ||
| 43 | ":1001940000C0B00000020090080000000000000051", | ||
| 44 | ":1001A40000000000000000001E000000000000002D", | ||
| 45 | ":1001B400000000000000000000000000000000003B", | ||
| 46 | ":1001C400000000000000000000000000000000002B", | ||
| 47 | ":1001D400000000000000000000000000000000001B", | ||
| 48 | ":1001E400000000000000000000000000000000000B", | ||
| 49 | ":1001F4000000000000000000000000008702010071", | ||
| 50 | ":1002040010000000200201002C0000006B0201001D", | ||
| 51 | ":100214001B000000570201001300000072656D61AD", | ||
| 52 | ":10022400696E646572206469766973696F6E2062B1", | ||
| 53 | ":1002340079207A65726F206F72206E6567617469C8", | ||
| 54 | ":1002440076652076616C756500636F727465782DD0", | ||
| 55 | ":100254006D3400696E646578206F7574206F662054", | ||
| 56 | ":10026400626F756E647300696E746567657220638E", | ||
| 57 | ":10027400617374207472756E63617465642062695D", | ||
| 58 | ":100284007473006469766973696F6E206279207A89", | ||
| 59 | ":1002940065726F00636F727465785F6D340000007F", | ||
| 60 | ":1002A40081B00091FFE700BEFDE7D0B502AF90B08A", | ||
| 61 | ":1002B4000391029007A800F029F803990020069002", | ||
| 62 | ":1002C40048680490FFE704990698019088420FD289", | ||
| 63 | ":1002D400FFE7019903980068405C07F8310C17F8B0", | ||
| 64 | ":1002E400311C07A800F021F8019801300690EAE7D4", | ||
| 65 | ":1002F400029807A9B1E80C50A0E80C5091E81C50F2", | ||
| 66 | ":1003040080E81C5010B0D0BDFFE7FEE7D0B502AFC7", | ||
| 67 | ":1003140040F2DC11C0F20101B1E80C50A0E80C502D", | ||
| 68 | ":1003240091E81C5080E81C50D0BD80B56F4688B061", | ||
| 69 | ":1003340006906FF35F2127F80A1C37F80A0C049023", | ||
| 70 | ":10034400012038B9FFE740F20020C0F2010000218B", | ||
| 71 | ":10035400FFF7A6FF0498C0F3431027F8020C37F800", | ||
| 72 | ":100364000A0C0390002038B9FFE7039800F01F003F", | ||
| 73 | ":100374000290012038B914E040F20820C0F20100D4", | ||
| 74 | ":100384000021FFF78DFF029800F01F0007F8030C0F", | ||
| 75 | ":100394000698009037F8020C0146019109280ED303", | ||
| 76 | ":1003A40006E040F21020C0F201000021FFF778FFC0", | ||
| 77 | ":1003B40040F21820C0F201000021FFF771FF0099FC", | ||
| 78 | ":1003C400019A51F8220017F803CC012303FA0CF325", | ||
| 79 | ":1003D400184341F8220008B080BD81B000F03F000E", | ||
| 80 | ":1003E4008DF802009DF80200103000F03F00022852", | ||
| 81 | ":1003F40004D3FFE700208DF8030003E001208DF80B", | ||
| 82 | ":100404000300FFE79DF8030001B070470A000000F5", | ||
| 83 | ":1004140012000000020071001200000066000000DB", | ||
| 84 | ":1004240003007D0C06000000000000000001110123", | ||
| 85 | ":10043400250E1305030E10171B0EB44219110112D9", | ||
| 86 | ":0604440006000002340076", | ||
| 87 | ":020000021000EC", | ||
| 88 | ":1000D400D001010001000000D20101000100000074", | ||
| 89 | ":1000E40028020100010000002402010001000000B8", | ||
| 90 | ":1000F4003A02010001000000E202010001000000D8", | ||
| 91 | ":100104000C03010001000000A50202000000000031", | ||
| 92 | ":1001140000000000000000000000000000000000DB", | ||
| 93 | ":1001240000000000000000000000000000000000CB", | ||
| 94 | ":1001340000000000000000000000000000000000BB", | ||
| 95 | ":10014400AF02020098020100090000004D02010004", | ||
| 96 | ":100154000900000001000000000000000000000091", | ||
| 97 | ":100164000004000100C0800000020000080000003C", | ||
| 98 | ":100174000000000000000000000000001E0000005D", | ||
| 99 | ":1001840048010100000040888080FF000A14002913", | ||
| 100 | ":1001940000C0B00000020090080000000000000051", | ||
| 101 | ":1001A40000000000000000001E000000000000002D", | ||
| 102 | ":1001B400000000000000000000000000000000003B", | ||
| 103 | ":1001C400000000000000000000000000000000002B", | ||
| 104 | ":1001D400000000000000000000000000000000001B", | ||
| 105 | ":1001E400000000000000000000000000000000000B", | ||
| 106 | ":1001F4000000000000000000000000008702010071", | ||
| 107 | ":1002040010000000200201002C0000006B0201001D", | ||
| 108 | ":100214001B000000570201001300000072656D61AD", | ||
| 109 | ":10022400696E646572206469766973696F6E2062B1", | ||
| 110 | ":1002340079207A65726F206F72206E6567617469C8", | ||
| 111 | ":1002440076652076616C756500636F727465782DD0", | ||
| 112 | ":100254006D3400696E646578206F7574206F662054", | ||
| 113 | ":10026400626F756E647300696E746567657220638E", | ||
| 114 | ":10027400617374207472756E63617465642062695D", | ||
| 115 | ":100284007473006469766973696F6E206279207A89", | ||
| 116 | ":1002940065726F00636F727465785F6D340000007F", | ||
| 117 | ":1002A40081B00091FFE700BEFDE7D0B502AF90B08A", | ||
| 118 | ":1002B4000391029007A800F029F803990020069002", | ||
| 119 | ":1002C40048680490FFE704990698019088420FD289", | ||
| 120 | ":1002D400FFE7019903980068405C07F8310C17F8B0", | ||
| 121 | ":1002E400311C07A800F021F8019801300690EAE7D4", | ||
| 122 | ":1002F400029807A9B1E80C50A0E80C5091E81C50F2", | ||
| 123 | ":1003040080E81C5010B0D0BDFFE7FEE7D0B502AFC7", | ||
| 124 | ":1003140040F2DC11C0F20101B1E80C50A0E80C502D", | ||
| 125 | ":1003240091E81C5080E81C50D0BD80B56F4688B061", | ||
| 126 | ":1003340006906FF35F2127F80A1C37F80A0C049023", | ||
| 127 | ":10034400012038B9FFE740F20020C0F2010000218B", | ||
| 128 | ":10035400FFF7A6FF0498C0F3431027F8020C37F800", | ||
| 129 | ":100364000A0C0390002038B9FFE7039800F01F003F", | ||
| 130 | ":100374000290012038B914E040F20820C0F20100D4", | ||
| 131 | ":100384000021FFF78DFF029800F01F0007F8030C0F", | ||
| 132 | ":100394000698009037F8020C0146019109280ED303", | ||
| 133 | ":1003A40006E040F21020C0F201000021FFF778FFC0", | ||
| 134 | ":1003B40040F21820C0F201000021FFF771FF0099FC", | ||
| 135 | ":1003C400019A51F8220017F803CC012303FA0CF325", | ||
| 136 | ":1003D400184341F8220008B080BD81B000F03F000E", | ||
| 137 | ":1003E4008DF802009DF80200103000F03F00022852", | ||
| 138 | ":1003F40004D3FFE700208DF8030003E001208DF80B", | ||
| 139 | ":100404000300FFE79DF8030001B070470A000000F5", | ||
| 140 | ":1004140012000000020071001200000066000000DB", | ||
| 141 | ":1004240003007D0C06000000000000000001110123", | ||
| 142 | ":10043400250E1305030E10171B0EB44219110112D9", | ||
| 143 | ":0604440006000002340076", | ||
| 144 | ":020000022000DC", | ||
| 145 | ":1002A40081B00091FFE700BEFDE7D0B502AF90B08A", | ||
| 146 | ":1002B4000391029007A800F029F803990020069002", | ||
| 147 | ":1002C40048680490FFE704990698019088420FD289", | ||
| 148 | ":1002D400FFE7019903980068405C07F8310C17F8B0", | ||
| 149 | ":1002E400311C07A800F021F8019801300690EAE7D4", | ||
| 150 | ":1002F400029807A9B1E80C50A0E80C5091E81C50F2", | ||
| 151 | ":1003040080E81C5010B0D0BDFFE7FEE7D0B502AFC7", | ||
| 152 | ":1003140040F2DC11C0F20101B1E80C50A0E80C502D", | ||
| 153 | ":1003240091E81C5080E81C50D0BD80B56F4688B061", | ||
| 154 | ":1003340006906FF35F2127F80A1C37F80A0C049023", | ||
| 155 | ":10034400012038B9FFE740F20020C0F2010000218B", | ||
| 156 | ":10035400FFF7A6FF0498C0F3431027F8020C37F800", | ||
| 157 | ":100364000A0C0390002038B9FFE7039800F01F003F", | ||
| 158 | ":100374000290012038B914E040F20820C0F20100D4", | ||
| 159 | ":100384000021FFF78DFF029800F01F0007F8030C0F", | ||
| 160 | ":100394000698009037F8020C0146019109280ED303", | ||
| 161 | ":1003A40006E040F21020C0F201000021FFF778FFC0", | ||
| 162 | ":1003B40040F21820C0F201000021FFF771FF0099FC", | ||
| 163 | ":1003C400019A51F8220017F803CC012303FA0CF325", | ||
| 164 | ":1003D400184341F8220008B080BD81B000F03F000E", | ||
| 165 | ":1003E4008DF802009DF80200103000F03F00022852", | ||
| 166 | ":1003F40004D3FFE700208DF8030003E001208DF80B", | ||
| 167 | ":0C0404000300FFE79DF8030001B0704703", | ||
| 168 | ":00000001FF", | ||
| 169 | }; | ||
| 170 | |||
| 171 | test_step.dependOn(&CheckFileStep.create(b, hex_step.getOutputSource(), expected_hex).step); | ||
| 172 | test_step.dependOn(&CheckFileStep.create(b, explicit_format_hex_step.getOutputSource(), expected_hex).step); | ||
| 173 | } | ||
test/standalone/install_raw_hex/main.zig created+3| ... | @@ -0,0 +1,3 @@ | ||
| 1 | export fn _start() callconv(.C) noreturn { | ||
| 2 | while (true) {} | ||
| 3 | } | ||