authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-11-20 17:38:41+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-11-26 11:50:09+01:00
loge7db37286459b30e5cb95666aac25d1f9406dd3e
tree5e886a6076b09bb642b813230b233411fd5f85b8
parentcd79c6dda1457ae9bf69fe900852209e31c28406

stage2 macho: cleanup logs


2 files changed, 2 insertions(+), 2 deletions(-)

src/link/MachO.zig+2
...@@ -1774,6 +1774,8 @@ fn writeCodeSignature(self: *MachO) !void {...@@ -1774,6 +1774,8 @@ fn writeCodeSignature(self: *MachO) !void {
17741774
1775 code_sig.write(buffer);1775 code_sig.write(buffer);
17761776
1777 log.debug("writing code signature from 0x{x} to 0x{x}\n", .{ code_sig_cmd.dataoff, code_sig_cmd.dataoff + buffer.len });
1778
1777 try self.base.file.?.pwriteAll(buffer, code_sig_cmd.dataoff);1779 try self.base.file.?.pwriteAll(buffer, code_sig_cmd.dataoff);
1778}1780}
17791781
src/link/MachO/CodeSignature.zig-2
...@@ -102,7 +102,6 @@ pub fn calcAdhocSignature(self: *CodeSignature, bin_file: *const MachO) !void {...@@ -102,7 +102,6 @@ pub fn calcAdhocSignature(self: *CodeSignature, bin_file: *const MachO) !void {
102 };102 };
103103
104 const total_pages = mem.alignForward(file_size, page_size) / page_size;104 const total_pages = mem.alignForward(file_size, page_size) / page_size;
105 log.debug("Total file size: {}; total number of pages: {}\n", .{ file_size, total_pages });
106105
107 var hash: [hash_size]u8 = undefined;106 var hash: [hash_size]u8 = undefined;
108 var buffer = try bin_file.base.allocator.alloc(u8, page_size);107 var buffer = try bin_file.base.allocator.alloc(u8, page_size);
...@@ -129,7 +128,6 @@ pub fn calcAdhocSignature(self: *CodeSignature, bin_file: *const MachO) !void {...@@ -129,7 +128,6 @@ pub fn calcAdhocSignature(self: *CodeSignature, bin_file: *const MachO) !void {
129 assert(fsize <= len);128 assert(fsize <= len);
130129
131 Sha256.hash(buffer[0..fsize], &hash, .{});130 Sha256.hash(buffer[0..fsize], &hash, .{});
132 log.debug("Calculated hash for page 0x{x}-0x{x}: 0x{x}\n", .{ fstart, fstart + fsize, hash[0..] });
133131
134 cdir.data.appendSliceAssumeCapacity(hash[0..]);132 cdir.data.appendSliceAssumeCapacity(hash[0..]);
135 cdir.inner.nCodeSlots += 1;133 cdir.inner.nCodeSlots += 1;