| author | |
| committer | |
| log | b90b080836734bc5c2d0f684ed2aad5c95ede453 |
| tree | ff8ad6d0e410dbd2eb8d1bac030d5e1476fec6f1 |
| parent | 1df1f936b3f4b6f2e8e97248d5779cac1f60a911 |
Previously, --pad-to is implemented using
File.setLength which does a ftruncate syscall
immediately. However, for positional writers,
setLength will be called again in out.end(),
truncating the file back to out.pos bytes.
Therefore, seekTo should be called after setLength
to update out.pos.1 files changed, 1 insertions(+), 0 deletions(-)
lib/compiler/objcopy.zig+1| ... | ... | @@ -669,6 +669,7 @@ fn padFile(out: *File.Writer, opt_size: ?u64) !void { |
| 669 | 669 | const io = out.io; |
| 670 | 670 | const size = opt_size orelse return; |
| 671 | 671 | try out.file.setLength(io, size); |
| 672 | try out.seekTo(size); | |
| 672 | 673 | } |
| 673 | 674 | |
| 674 | 675 | test "HexWriter.Record.Address has correct payload and checksum" { |