authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-03-01 21:14:33+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-03-17 19:59:13+01:00
log066c1386a3dfe0acf4c9d11ba436e7e339d2310b
treeae60b7bb6531614ab98d32deec1deed60cef29d5
parentb0ee480177c5f146cc2a5540745572436e8ca510

zld: demote logs from warn to debug


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

src/link/MachO/Object.zig+1-1
......@@ -149,7 +149,7 @@ pub fn readLoadCommands(self: *Object, reader: anytype, offset: ReadOffset) !voi
149149 self.build_version_cmd_index = i;
150150 },
151151 else => {
152 log.info("Unknown load command detected: 0x{x}.", .{cmd.cmd()});
152 log.debug("Unknown load command detected: 0x{x}.", .{cmd.cmd()});
153153 },
154154 }
155155 self.load_commands.appendAssumeCapacity(cmd);
src/link/MachO/Zld.zig+56-57
......@@ -331,7 +331,6 @@ fn mapAndUpdateSections(
331331 const source_sect = source_seg.sections.items[source_sect_id];
332332 const target_seg = &self.load_commands.items[target_seg_id].Segment;
333333 const target_sect = &target_seg.sections.items[target_sect_id];
334 log.warn("{}", .{target_sect});
335334
336335 const alignment = try math.powi(u32, 2, source_sect.@"align");
337336 const offset = mem.alignForwardGeneric(u64, target_sect.size, alignment);
......@@ -346,7 +345,7 @@ fn mapAndUpdateSections(
346345 .target_sect_id = target_sect_id,
347346 .offset = @intCast(u32, offset),
348347 });
349 log.warn("{s}: {s},{s} mapped to {s},{s} from 0x{x} to 0x{x}", .{
348 log.debug("{s}: {s},{s} mapped to {s},{s} from 0x{x} to 0x{x}", .{
350349 object.name,
351350 parseName(&source_sect.segname),
352351 parseName(&source_sect.sectname),
......@@ -515,7 +514,7 @@ fn updateMetadata(self: *Zld, object_id: u16) !void {
515514 });
516515 },
517516 else => {
518 log.warn("unhandled section type 0x{x} for '{s}/{s}'", .{ flags, segname, sectname });
517 log.debug("unhandled section type 0x{x} for '{s}/{s}'", .{ flags, segname, sectname });
519518 },
520519 }
521520 }
......@@ -614,14 +613,14 @@ fn updateMetadata(self: *Zld, object_id: u16) !void {
614613 continue;
615614 }
616615 }
617 log.warn("section '{s}/{s}' will be unmapped", .{ segname, sectname });
616 log.debug("section '{s}/{s}' will be unmapped", .{ segname, sectname });
618617 try self.unhandled_sections.putNoClobber(self.allocator, .{
619618 .object_id = object_id,
620619 .source_sect_id = source_sect_id,
621620 }, 0);
622621 },
623622 else => {
624 log.warn("section '{s}/{s}' will be unmapped", .{ segname, sectname });
623 log.debug("section '{s}/{s}' will be unmapped", .{ segname, sectname });
625624 try self.unhandled_sections.putNoClobber(self.allocator, .{
626625 .object_id = object_id,
627626 .source_sect_id = source_sect_id,
......@@ -785,7 +784,7 @@ fn resolveImports(self: *Zld) !void {
785784 mem.eql(u8, sym_name, "___stack_chk_guard") or
786785 mem.eql(u8, sym_name, "_environ"))
787786 {
788 log.warn("writing nonlazy symbol '{s}'", .{sym_name});
787 log.debug("writing nonlazy symbol '{s}'", .{sym_name});
789788 const index = @intCast(u32, self.nonlazy_imports.items().len);
790789 try self.nonlazy_imports.putNoClobber(self.allocator, key, .{
791790 .symbol = new_sym,
......@@ -793,7 +792,7 @@ fn resolveImports(self: *Zld) !void {
793792 .index = index,
794793 });
795794 } else if (mem.eql(u8, sym_name, "__tlv_bootstrap")) {
796 log.warn("writing threadlocal symbol '{s}'", .{sym_name});
795 log.debug("writing threadlocal symbol '{s}'", .{sym_name});
797796 const index = @intCast(u32, self.threadlocal_imports.items().len);
798797 try self.threadlocal_imports.putNoClobber(self.allocator, key, .{
799798 .symbol = new_sym,
......@@ -801,7 +800,7 @@ fn resolveImports(self: *Zld) !void {
801800 .index = index,
802801 });
803802 } else {
804 log.warn("writing lazy symbol '{s}'", .{sym_name});
803 log.debug("writing lazy symbol '{s}'", .{sym_name});
805804 const index = @intCast(u32, self.lazy_imports.items().len);
806805 try self.lazy_imports.putNoClobber(self.allocator, key, .{
807806 .symbol = new_sym,
......@@ -813,7 +812,7 @@ fn resolveImports(self: *Zld) !void {
813812
814813 const n_strx = try self.makeString("dyld_stub_binder");
815814 const name = try self.allocator.dupe(u8, "dyld_stub_binder");
816 log.warn("writing nonlazy symbol 'dyld_stub_binder'", .{});
815 log.debug("writing nonlazy symbol 'dyld_stub_binder'", .{});
817816 const index = @intCast(u32, self.nonlazy_imports.items().len);
818817 try self.nonlazy_imports.putNoClobber(self.allocator, name, .{
819818 .symbol = .{
......@@ -1017,7 +1016,7 @@ fn writeStubHelperCommon(self: *Zld) !void {
10171016 const new_this_addr = this_addr + @sizeOf(u32);
10181017 const displacement = math.divExact(u64, target_addr - new_this_addr, 4) catch |_| break :binder_blk;
10191018 const literal = math.cast(u18, displacement) catch |_| break :binder_blk;
1020 log.warn("2: disp=0x{x}, literal=0x{x}", .{ displacement, literal });
1019 log.debug("2: disp=0x{x}, literal=0x{x}", .{ displacement, literal });
10211020 // Pad with nop to please division.
10221021 // nop
10231022 mem.writeIntLittle(u32, code[12..16], Arm64.nop().toU32());
......@@ -1070,7 +1069,7 @@ fn writeLazySymbolPointer(self: *Zld, index: u32) !void {
10701069 var buf: [@sizeOf(u64)]u8 = undefined;
10711070 mem.writeIntLittle(u64, &buf, end);
10721071 const off = la_symbol_ptr.offset + index * @sizeOf(u64);
1073 log.warn("writing lazy symbol pointer entry 0x{x} at 0x{x}", .{ end, off });
1072 log.debug("writing lazy symbol pointer entry 0x{x} at 0x{x}", .{ end, off });
10741073 try self.file.?.pwriteAll(&buf, off);
10751074}
10761075
......@@ -1083,7 +1082,7 @@ fn writeStub(self: *Zld, index: u32) !void {
10831082 const stub_off = stubs.offset + index * stubs.reserved2;
10841083 const stub_addr = stubs.addr + index * stubs.reserved2;
10851084 const la_ptr_addr = la_symbol_ptr.addr + index * @sizeOf(u64);
1086 log.warn("writing stub at 0x{x}", .{stub_off});
1085 log.debug("writing stub at 0x{x}", .{stub_off});
10871086 var code = try self.allocator.alloc(u8, stubs.reserved2);
10881087 defer self.allocator.free(code);
10891088 switch (self.arch.?) {
......@@ -1230,7 +1229,7 @@ fn resolveSymbols(self: *Zld) !void {
12301229 const target_addr = target_sect.addr + target_mapping.offset;
12311230 const n_value = sym.n_value - source_sect.addr + target_addr;
12321231
1233 log.warn("resolving '{s}':{} as {s} symbol at 0x{x}", .{ sym_name, sym, tt, n_value });
1232 log.debug("resolving '{s}':{} as {s} symbol at 0x{x}", .{ sym_name, sym, tt, n_value });
12341233
12351234 // TODO this assumes only two symbol-filled segments. Also, there might be a more
12361235 // generic way of doing this.
......@@ -1260,8 +1259,8 @@ fn resolveSymbols(self: *Zld) !void {
12601259
12611260fn doRelocs(self: *Zld) !void {
12621261 for (self.objects.items) |object, object_id| {
1263 log.warn("\n\n", .{});
1264 log.warn("relocating object {s}", .{object.name});
1262 log.debug("\n\n", .{});
1263 log.debug("relocating object {s}", .{object.name});
12651264
12661265 const seg = object.load_commands.items[object.segment_cmd_index.?].Segment;
12671266
......@@ -1284,7 +1283,7 @@ fn doRelocs(self: *Zld) !void {
12841283 .object_id = @intCast(u16, object_id),
12851284 .source_sect_id = @intCast(u16, source_sect_id),
12861285 }) orelse {
1287 log.warn("no mapping for {s},{s}; skipping", .{ segname, sectname });
1286 log.debug("no mapping for {s},{s}; skipping", .{ segname, sectname });
12881287 continue;
12891288 };
12901289 const target_seg = self.load_commands.items[target_mapping.target_seg_id].Segment;
......@@ -1302,34 +1301,34 @@ fn doRelocs(self: *Zld) !void {
13021301 switch (self.arch.?) {
13031302 .aarch64 => {
13041303 const rel_type = @intToEnum(macho.reloc_type_arm64, rel.r_type);
1305 log.warn("{s}", .{rel_type});
1306 log.warn(" | source address 0x{x}", .{this_addr});
1307 log.warn(" | offset 0x{x}", .{off});
1304 log.debug("{s}", .{rel_type});
1305 log.debug(" | source address 0x{x}", .{this_addr});
1306 log.debug(" | offset 0x{x}", .{off});
13081307
13091308 if (rel_type == .ARM64_RELOC_ADDEND) {
13101309 addend = rel.r_symbolnum;
1311 log.warn(" | calculated addend = 0x{x}", .{addend});
1310 log.debug(" | calculated addend = 0x{x}", .{addend});
13121311 // TODO followed by either PAGE21 or PAGEOFF12 only.
13131312 continue;
13141313 }
13151314 },
13161315 .x86_64 => {
13171316 const rel_type = @intToEnum(macho.reloc_type_x86_64, rel.r_type);
1318 log.warn("{s}", .{rel_type});
1319 log.warn(" | source address 0x{x}", .{this_addr});
1320 log.warn(" | offset 0x{x}", .{off});
1317 log.debug("{s}", .{rel_type});
1318 log.debug(" | source address 0x{x}", .{this_addr});
1319 log.debug(" | offset 0x{x}", .{off});
13211320 },
13221321 else => {},
13231322 }
13241323
13251324 const target_addr = try self.relocTargetAddr(@intCast(u16, object_id), rel);
1326 log.warn(" | target address 0x{x}", .{target_addr});
1325 log.debug(" | target address 0x{x}", .{target_addr});
13271326 if (rel.r_extern == 1) {
13281327 const target_symname = object.getString(object.symtab.items[rel.r_symbolnum].n_strx);
1329 log.warn(" | target symbol '{s}'", .{target_symname});
1328 log.debug(" | target symbol '{s}'", .{target_symname});
13301329 } else {
13311330 const target_sectname = seg.sections.items[rel.r_symbolnum - 1].sectname;
1332 log.warn(" | target section '{s}'", .{parseName(&target_sectname)});
1331 log.debug(" | target section '{s}'", .{parseName(&target_sectname)});
13331332 }
13341333
13351334 switch (self.arch.?) {
......@@ -1379,7 +1378,7 @@ fn doRelocs(self: *Zld) !void {
13791378 break :blk correction;
13801379 }
13811380 };
1382 log.warn(" | calculated addend 0x{x}", .{offset});
1381 log.debug(" | calculated addend 0x{x}", .{offset});
13831382 const result = @intCast(i64, target_addr) - @intCast(i64, this_addr) - 4 + offset;
13841383 const displacement = @bitCast(u32, @intCast(i32, result));
13851384 mem.writeIntLittle(u32, inst, displacement);
......@@ -1392,7 +1391,7 @@ fn doRelocs(self: *Zld) !void {
13921391 3 => {
13931392 const inst = code[off..][0..8];
13941393 const offset = mem.readIntLittle(i64, inst);
1395 log.warn(" | calculated addend 0x{x}", .{offset});
1394 log.debug(" | calculated addend 0x{x}", .{offset});
13961395 const result = if (sub) |s|
13971396 @intCast(i64, target_addr) - s + offset
13981397 else
......@@ -1423,7 +1422,7 @@ fn doRelocs(self: *Zld) !void {
14231422 2 => {
14241423 const inst = code[off..][0..4];
14251424 const offset = mem.readIntLittle(i32, inst);
1426 log.warn(" | calculated addend 0x{x}", .{offset});
1425 log.debug(" | calculated addend 0x{x}", .{offset});
14271426 const result = if (sub) |s|
14281427 @intCast(i64, target_addr) - s + offset
14291428 else
......@@ -1460,7 +1459,7 @@ fn doRelocs(self: *Zld) !void {
14601459 const this_page = @intCast(i32, this_addr >> 12);
14611460 const target_page = @intCast(i32, ta >> 12);
14621461 const pages = @bitCast(u21, @intCast(i21, target_page - this_page));
1463 log.warn(" | moving by {} pages", .{pages});
1462 log.debug(" | moving by {} pages", .{pages});
14641463 var parsed = mem.bytesAsValue(meta.TagPayload(Arm64, Arm64.Address), inst);
14651464 parsed.immhi = @truncate(u19, pages >> 2);
14661465 parsed.immlo = @truncate(u2, pages);
......@@ -1471,14 +1470,14 @@ fn doRelocs(self: *Zld) !void {
14711470 => {
14721471 const inst = code[off..][0..4];
14731472 if (Arm64.isArithmetic(inst)) {
1474 log.warn(" | detected ADD opcode", .{});
1473 log.debug(" | detected ADD opcode", .{});
14751474 // add
14761475 var parsed = mem.bytesAsValue(meta.TagPayload(Arm64, Arm64.Add), inst);
14771476 const ta = if (addend) |a| target_addr + a else target_addr;
14781477 const narrowed = @truncate(u12, ta);
14791478 parsed.offset = narrowed;
14801479 } else {
1481 log.warn(" | detected LDR/STR opcode", .{});
1480 log.debug(" | detected LDR/STR opcode", .{});
14821481 // ldr/str
14831482 var parsed = mem.bytesAsValue(meta.TagPayload(Arm64, Arm64.LoadRegister), inst);
14841483 const ta = if (addend) |a| target_addr + a else target_addr;
......@@ -1519,7 +1518,7 @@ fn doRelocs(self: *Zld) !void {
15191518 };
15201519 const ta = if (addend) |a| target_addr + a else target_addr;
15211520 const narrowed = @truncate(u12, ta);
1522 log.warn(" | rewriting TLV access to ADD opcode", .{});
1521 log.debug(" | rewriting TLV access to ADD opcode", .{});
15231522 // For TLV, we always generate an add instruction.
15241523 mem.writeIntLittle(u32, inst, Arm64.add(parsed.rt, parsed.rn, narrowed, parsed.size).toU32());
15251524 },
......@@ -1531,7 +1530,7 @@ fn doRelocs(self: *Zld) !void {
15311530 3 => {
15321531 const inst = code[off..][0..8];
15331532 const offset = mem.readIntLittle(i64, inst);
1534 log.warn(" | calculated addend 0x{x}", .{offset});
1533 log.debug(" | calculated addend 0x{x}", .{offset});
15351534 const result = if (sub) |s|
15361535 @intCast(i64, target_addr) - s + offset
15371536 else
......@@ -1562,7 +1561,7 @@ fn doRelocs(self: *Zld) !void {
15621561 2 => {
15631562 const inst = code[off..][0..4];
15641563 const offset = mem.readIntLittle(i32, inst);
1565 log.warn(" | calculated addend 0x{x}", .{offset});
1564 log.debug(" | calculated addend 0x{x}", .{offset});
15661565 const result = if (sub) |s|
15671566 @intCast(i64, target_addr) - s + offset
15681567 else
......@@ -1584,7 +1583,7 @@ fn doRelocs(self: *Zld) !void {
15841583 }
15851584 }
15861585
1587 log.warn("writing contents of '{s},{s}' section from '{s}' from 0x{x} to 0x{x}", .{
1586 log.debug("writing contents of '{s},{s}' section from '{s}' from 0x{x} to 0x{x}", .{
15881587 segname,
15891588 sectname,
15901589 object.name,
......@@ -1596,7 +1595,7 @@ fn doRelocs(self: *Zld) !void {
15961595 target_sect.flags == macho.S_THREAD_LOCAL_ZEROFILL or
15971596 target_sect.flags == macho.S_THREAD_LOCAL_VARIABLES)
15981597 {
1599 log.warn("zeroing out '{s},{s}' from 0x{x} to 0x{x}", .{
1598 log.debug("zeroing out '{s},{s}' from 0x{x} to 0x{x}", .{
16001599 parseName(&target_sect.segname),
16011600 parseName(&target_sect.sectname),
16021601 target_sect_off,
......@@ -1630,7 +1629,7 @@ fn relocTargetAddr(self: *Zld, object_id: u16, rel: macho.relocation_info) !u64
16301629 const target_seg = self.load_commands.items[target_mapping.target_seg_id].Segment;
16311630 const target_sect = target_seg.sections.items[target_mapping.target_sect_id];
16321631 const target_sect_addr = target_sect.addr + target_mapping.offset;
1633 log.warn(" | symbol local to object", .{});
1632 log.debug(" | symbol local to object", .{});
16341633 break :blk target_sect_addr + sym.n_value - source_sect.addr;
16351634 } else if (isImport(&sym)) {
16361635 // Relocate to either the artifact's local symbol, or an import from
......@@ -2190,7 +2189,7 @@ fn writeRebaseInfoTable(self: *Zld) !void {
21902189 dyld_info.rebase_size = @intCast(u32, mem.alignForwardGeneric(u64, buffer.len, @sizeOf(u64)));
21912190 seg.inner.filesize += dyld_info.rebase_size;
21922191
2193 log.warn("writing rebase info from 0x{x} to 0x{x}", .{ dyld_info.rebase_off, dyld_info.rebase_off + dyld_info.rebase_size });
2192 log.debug("writing rebase info from 0x{x} to 0x{x}", .{ dyld_info.rebase_off, dyld_info.rebase_off + dyld_info.rebase_size });
21942193
21952194 try self.file.?.pwriteAll(buffer, dyld_info.rebase_off);
21962195}
......@@ -2243,7 +2242,7 @@ fn writeBindInfoTable(self: *Zld) !void {
22432242 dyld_info.bind_size = @intCast(u32, mem.alignForwardGeneric(u64, buffer.len, @alignOf(u64)));
22442243 seg.inner.filesize += dyld_info.bind_size;
22452244
2246 log.warn("writing binding info from 0x{x} to 0x{x}", .{ dyld_info.bind_off, dyld_info.bind_off + dyld_info.bind_size });
2245 log.debug("writing binding info from 0x{x} to 0x{x}", .{ dyld_info.bind_off, dyld_info.bind_off + dyld_info.bind_size });
22472246
22482247 try self.file.?.pwriteAll(buffer, dyld_info.bind_off);
22492248}
......@@ -2282,7 +2281,7 @@ fn writeLazyBindInfoTable(self: *Zld) !void {
22822281 dyld_info.lazy_bind_size = @intCast(u32, mem.alignForwardGeneric(u64, buffer.len, @alignOf(u64)));
22832282 seg.inner.filesize += dyld_info.lazy_bind_size;
22842283
2285 log.warn("writing lazy binding info from 0x{x} to 0x{x}", .{ dyld_info.lazy_bind_off, dyld_info.lazy_bind_off + dyld_info.lazy_bind_size });
2284 log.debug("writing lazy binding info from 0x{x} to 0x{x}", .{ dyld_info.lazy_bind_off, dyld_info.lazy_bind_off + dyld_info.lazy_bind_size });
22862285
22872286 try self.file.?.pwriteAll(buffer, dyld_info.lazy_bind_off);
22882287 try self.populateLazyBindOffsetsInStubHelper(buffer);
......@@ -2384,7 +2383,7 @@ fn writeExportInfo(self: *Zld) !void {
23842383 dyld_info.export_size = @intCast(u32, mem.alignForwardGeneric(u64, buffer.len, @alignOf(u64)));
23852384 seg.inner.filesize += dyld_info.export_size;
23862385
2387 log.warn("writing export info from 0x{x} to 0x{x}", .{ dyld_info.export_off, dyld_info.export_off + dyld_info.export_size });
2386 log.debug("writing export info from 0x{x} to 0x{x}", .{ dyld_info.export_off, dyld_info.export_off + dyld_info.export_size });
23882387
23892388 try self.file.?.pwriteAll(buffer, dyld_info.export_off);
23902389}
......@@ -2518,7 +2517,7 @@ fn writeDebugInfo(self: *Zld) !void {
25182517
25192518 const stabs_off = symtab.symoff;
25202519 const stabs_size = symtab.nsyms * @sizeOf(macho.nlist_64);
2521 log.warn("writing symbol stabs from 0x{x} to 0x{x}", .{ stabs_off, stabs_size + stabs_off });
2520 log.debug("writing symbol stabs from 0x{x} to 0x{x}", .{ stabs_off, stabs_size + stabs_off });
25222521 try self.file.?.pwriteAll(mem.sliceAsBytes(stabs.items), stabs_off);
25232522
25242523 linkedit.inner.filesize += stabs_size;
......@@ -2536,12 +2535,12 @@ fn writeSymbolTable(self: *Zld) !void {
25362535 defer locals.deinit();
25372536
25382537 for (self.locals.items()) |entries| {
2539 log.warn("'{s}': {} entries", .{ entries.key, entries.value.items.len });
2538 log.debug("'{s}': {} entries", .{ entries.key, entries.value.items.len });
25402539 // var symbol: ?macho.nlist_64 = null;
25412540 for (entries.value.items) |entry| {
2542 log.warn(" | {}", .{entry.inner});
2543 log.warn(" | {}", .{entry.tt});
2544 log.warn(" | {s}", .{self.objects.items[entry.object_id].name});
2541 log.debug(" | {}", .{entry.inner});
2542 log.debug(" | {}", .{entry.tt});
2543 log.debug(" | {s}", .{self.objects.items[entry.object_id].name});
25452544 // switch (entry.tt) {
25462545 // .Global => {
25472546 // symbol = entry.inner;
......@@ -2586,17 +2585,17 @@ fn writeSymbolTable(self: *Zld) !void {
25862585
25872586 const locals_off = symtab.symoff + symtab.nsyms * @sizeOf(macho.nlist_64);
25882587 const locals_size = nlocals * @sizeOf(macho.nlist_64);
2589 log.warn("writing local symbols from 0x{x} to 0x{x}", .{ locals_off, locals_size + locals_off });
2588 log.debug("writing local symbols from 0x{x} to 0x{x}", .{ locals_off, locals_size + locals_off });
25902589 try self.file.?.pwriteAll(mem.sliceAsBytes(locals.items), locals_off);
25912590
25922591 const exports_off = locals_off + locals_size;
25932592 const exports_size = nexports * @sizeOf(macho.nlist_64);
2594 log.warn("writing exported symbols from 0x{x} to 0x{x}", .{ exports_off, exports_size + exports_off });
2593 log.debug("writing exported symbols from 0x{x} to 0x{x}", .{ exports_off, exports_size + exports_off });
25952594 try self.file.?.pwriteAll(mem.sliceAsBytes(exports.items), exports_off);
25962595
25972596 const undefs_off = exports_off + exports_size;
25982597 const undefs_size = nundefs * @sizeOf(macho.nlist_64);
2599 log.warn("writing undefined symbols from 0x{x} to 0x{x}", .{ undefs_off, undefs_size + undefs_off });
2598 log.debug("writing undefined symbols from 0x{x} to 0x{x}", .{ undefs_off, undefs_size + undefs_off });
26002599 try self.file.?.pwriteAll(mem.sliceAsBytes(undefs.items), undefs_off);
26012600
26022601 symtab.nsyms += @intCast(u32, nlocals + nexports + nundefs);
......@@ -2627,7 +2626,7 @@ fn writeDynamicSymbolTable(self: *Zld) !void {
26272626 const needed_size = dysymtab.nindirectsyms * @sizeOf(u32);
26282627 seg.inner.filesize += needed_size;
26292628
2630 log.warn("writing indirect symbol table from 0x{x} to 0x{x}", .{
2629 log.debug("writing indirect symbol table from 0x{x} to 0x{x}", .{
26312630 dysymtab.indirectsymoff,
26322631 dysymtab.indirectsymoff + needed_size,
26332632 });
......@@ -2666,7 +2665,7 @@ fn writeStringTable(self: *Zld) !void {
26662665 symtab.strsize = @intCast(u32, mem.alignForwardGeneric(u64, self.strtab.items.len, @alignOf(u64)));
26672666 seg.inner.filesize += symtab.strsize;
26682667
2669 log.warn("writing string table from 0x{x} to 0x{x}", .{ symtab.stroff, symtab.stroff + symtab.strsize });
2668 log.debug("writing string table from 0x{x} to 0x{x}", .{ symtab.stroff, symtab.stroff + symtab.strsize });
26702669
26712670 try self.file.?.pwriteAll(self.strtab.items, symtab.stroff);
26722671
......@@ -2692,7 +2691,7 @@ fn writeCodeSignaturePadding(self: *Zld) !void {
26922691 seg.inner.filesize += needed_size;
26932692 seg.inner.vmsize = mem.alignForwardGeneric(u64, seg.inner.filesize, self.page_size.?);
26942693
2695 log.warn("writing code signature padding from 0x{x} to 0x{x}", .{ fileoff, fileoff + needed_size });
2694 log.debug("writing code signature padding from 0x{x} to 0x{x}", .{ fileoff, fileoff + needed_size });
26962695
26972696 // Pad out the space. We need to do this to calculate valid hashes for everything in the file
26982697 // except for code signature data.
......@@ -2718,7 +2717,7 @@ fn writeCodeSignature(self: *Zld) !void {
27182717 var stream = std.io.fixedBufferStream(buffer);
27192718 try code_sig.write(stream.writer());
27202719
2721 log.warn("writing code signature from 0x{x} to 0x{x}", .{ code_sig_cmd.dataoff, code_sig_cmd.dataoff + buffer.len });
2720 log.debug("writing code signature from 0x{x} to 0x{x}", .{ code_sig_cmd.dataoff, code_sig_cmd.dataoff + buffer.len });
27222721
27232722 try self.file.?.pwriteAll(buffer, code_sig_cmd.dataoff);
27242723}
......@@ -2737,7 +2736,7 @@ fn writeLoadCommands(self: *Zld) !void {
27372736 }
27382737
27392738 const off = @sizeOf(macho.mach_header_64);
2740 log.warn("writing {} load commands from 0x{x} to 0x{x}", .{ self.load_commands.items.len, off, off + sizeofcmds });
2739 log.debug("writing {} load commands from 0x{x} to 0x{x}", .{ self.load_commands.items.len, off, off + sizeofcmds });
27412740 try self.file.?.pwriteAll(buffer, off);
27422741}
27432742
......@@ -2775,7 +2774,7 @@ fn writeHeader(self: *Zld) !void {
27752774 for (self.load_commands.items) |cmd| {
27762775 header.sizeofcmds += cmd.cmdsize();
27772776 }
2778 log.warn("writing Mach-O header {}", .{header});
2777 log.debug("writing Mach-O header {}", .{header});
27792778 try self.file.?.pwriteAll(mem.asBytes(&header), 0);
27802779}
27812780
......@@ -2789,7 +2788,7 @@ pub fn makeStaticString(bytes: []const u8) [16]u8 {
27892788fn makeString(self: *Zld, bytes: []const u8) !u32 {
27902789 try self.strtab.ensureCapacity(self.allocator, self.strtab.items.len + bytes.len + 1);
27912790 const offset = @intCast(u32, self.strtab.items.len);
2792 log.warn("writing new string '{s}' into string table at offset 0x{x}", .{ bytes, offset });
2791 log.debug("writing new string '{s}' into string table at offset 0x{x}", .{ bytes, offset });
27932792 self.strtab.appendSliceAssumeCapacity(bytes);
27942793 self.strtab.appendAssumeCapacity(0);
27952794 return offset;