authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-03-04 18:35:26+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-03-17 19:59:13+01:00
log5d8944edc1361aeb36a55d8435ef1feecf714958
treef670c5341b7597e9a2a7e685c33c32e7e0aec5c1
parenta1b0ec5277c08b82411f830ab0e82487a6a00184

Revert log.warn hack


1 files changed, 60 insertions(+), 60 deletions(-)

src/link/MachO/Zld.zig+60-60
......@@ -345,7 +345,7 @@ fn mapAndUpdateSections(
345345 .target_sect_id = target_sect_id,
346346 .offset = @intCast(u32, offset),
347347 });
348 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}", .{
349349 object.name,
350350 parseName(&source_sect.segname),
351351 parseName(&source_sect.sectname),
......@@ -513,7 +513,7 @@ fn updateMetadata(self: *Zld, object_id: u16) !void {
513513 });
514514 },
515515 else => {
516 log.warn("unhandled section type 0x{x} for '{s}/{s}'", .{ flags, segname, sectname });
516 log.debug("unhandled section type 0x{x} for '{s}/{s}'", .{ flags, segname, sectname });
517517 },
518518 }
519519 }
......@@ -537,7 +537,7 @@ fn updateMetadata(self: *Zld, object_id: u16) !void {
537537
538538 const segname = parseName(&source_sect.segname);
539539 const sectname = parseName(&source_sect.sectname);
540 log.warn("section '{s}/{s}' will be unmapped", .{ segname, sectname });
540 log.debug("section '{s}/{s}' will be unmapped", .{ segname, sectname });
541541 try self.unhandled_sections.putNoClobber(self.allocator, .{
542542 .object_id = object_id,
543543 .source_sect_id = source_sect_id,
......@@ -780,7 +780,7 @@ fn resolveImports(self: *Zld) !void {
780780 mem.eql(u8, sym_name, "___stack_chk_guard") or
781781 mem.eql(u8, sym_name, "_environ"))
782782 {
783 log.warn("writing nonlazy symbol '{s}'", .{sym_name});
783 log.debug("writing nonlazy symbol '{s}'", .{sym_name});
784784 const index = @intCast(u32, self.nonlazy_imports.items().len);
785785 try self.nonlazy_imports.putNoClobber(self.allocator, key, .{
786786 .symbol = new_sym,
......@@ -788,7 +788,7 @@ fn resolveImports(self: *Zld) !void {
788788 .index = index,
789789 });
790790 } else if (mem.eql(u8, sym_name, "__tlv_bootstrap")) {
791 log.warn("writing threadlocal symbol '{s}'", .{sym_name});
791 log.debug("writing threadlocal symbol '{s}'", .{sym_name});
792792 const index = @intCast(u32, self.threadlocal_imports.items().len);
793793 try self.threadlocal_imports.putNoClobber(self.allocator, key, .{
794794 .symbol = new_sym,
......@@ -796,7 +796,7 @@ fn resolveImports(self: *Zld) !void {
796796 .index = index,
797797 });
798798 } else {
799 log.warn("writing lazy symbol '{s}'", .{sym_name});
799 log.debug("writing lazy symbol '{s}'", .{sym_name});
800800 const index = @intCast(u32, self.lazy_imports.items().len);
801801 try self.lazy_imports.putNoClobber(self.allocator, key, .{
802802 .symbol = new_sym,
......@@ -808,7 +808,7 @@ fn resolveImports(self: *Zld) !void {
808808
809809 const n_strx = try self.makeString("dyld_stub_binder");
810810 const name = try self.allocator.dupe(u8, "dyld_stub_binder");
811 log.warn("writing nonlazy symbol 'dyld_stub_binder'", .{});
811 log.debug("writing nonlazy symbol 'dyld_stub_binder'", .{});
812812 const index = @intCast(u32, self.nonlazy_imports.items().len);
813813 try self.nonlazy_imports.putNoClobber(self.allocator, name, .{
814814 .symbol = .{
......@@ -1012,7 +1012,7 @@ fn writeStubHelperCommon(self: *Zld) !void {
10121012 const new_this_addr = this_addr + @sizeOf(u32);
10131013 const displacement = math.divExact(u64, target_addr - new_this_addr, 4) catch |_| break :binder_blk;
10141014 const literal = math.cast(u18, displacement) catch |_| break :binder_blk;
1015 log.warn("2: disp=0x{x}, literal=0x{x}", .{ displacement, literal });
1015 log.debug("2: disp=0x{x}, literal=0x{x}", .{ displacement, literal });
10161016 // Pad with nop to please division.
10171017 // nop
10181018 mem.writeIntLittle(u32, code[12..16], Arm64.nop().toU32());
......@@ -1065,7 +1065,7 @@ fn writeLazySymbolPointer(self: *Zld, index: u32) !void {
10651065 var buf: [@sizeOf(u64)]u8 = undefined;
10661066 mem.writeIntLittle(u64, &buf, end);
10671067 const off = la_symbol_ptr.offset + index * @sizeOf(u64);
1068 log.warn("writing lazy symbol pointer entry 0x{x} at 0x{x}", .{ end, off });
1068 log.debug("writing lazy symbol pointer entry 0x{x} at 0x{x}", .{ end, off });
10691069 try self.file.?.pwriteAll(&buf, off);
10701070}
10711071
......@@ -1078,7 +1078,7 @@ fn writeStub(self: *Zld, index: u32) !void {
10781078 const stub_off = stubs.offset + index * stubs.reserved2;
10791079 const stub_addr = stubs.addr + index * stubs.reserved2;
10801080 const la_ptr_addr = la_symbol_ptr.addr + index * @sizeOf(u64);
1081 log.warn("writing stub at 0x{x}", .{stub_off});
1081 log.debug("writing stub at 0x{x}", .{stub_off});
10821082 var code = try self.allocator.alloc(u8, stubs.reserved2);
10831083 defer self.allocator.free(code);
10841084 switch (self.arch.?) {
......@@ -1225,7 +1225,7 @@ fn resolveSymbols(self: *Zld) !void {
12251225 const target_addr = target_sect.addr + target_mapping.offset;
12261226 const n_value = sym.n_value - source_sect.addr + target_addr;
12271227
1228 log.warn("resolving '{s}':{} as {s} symbol at 0x{x}", .{ sym_name, sym, tt, n_value });
1228 log.debug("resolving '{s}':{} as {s} symbol at 0x{x}", .{ sym_name, sym, tt, n_value });
12291229
12301230 // TODO this assumes only two symbol-filled segments. Also, there might be a more
12311231 // generic way of doing this.
......@@ -1255,8 +1255,8 @@ fn resolveSymbols(self: *Zld) !void {
12551255
12561256fn doRelocs(self: *Zld) !void {
12571257 for (self.objects.items) |object, object_id| {
1258 log.warn("\n\n", .{});
1259 log.warn("relocating object {s}", .{object.name});
1258 log.debug("\n\n", .{});
1259 log.debug("relocating object {s}", .{object.name});
12601260
12611261 const seg = object.load_commands.items[object.segment_cmd_index.?].Segment;
12621262
......@@ -1279,7 +1279,7 @@ fn doRelocs(self: *Zld) !void {
12791279 .object_id = @intCast(u16, object_id),
12801280 .source_sect_id = @intCast(u16, source_sect_id),
12811281 }) orelse {
1282 log.warn("no mapping for {s},{s}; skipping", .{ segname, sectname });
1282 log.debug("no mapping for {s},{s}; skipping", .{ segname, sectname });
12831283 continue;
12841284 };
12851285 const target_seg = self.load_commands.items[target_mapping.target_seg_id].Segment;
......@@ -1297,34 +1297,34 @@ fn doRelocs(self: *Zld) !void {
12971297 switch (self.arch.?) {
12981298 .aarch64 => {
12991299 const rel_type = @intToEnum(macho.reloc_type_arm64, rel.r_type);
1300 log.warn("{s}", .{rel_type});
1301 log.warn(" | source address 0x{x}", .{this_addr});
1302 log.warn(" | offset 0x{x}", .{off});
1300 log.debug("{s}", .{rel_type});
1301 log.debug(" | source address 0x{x}", .{this_addr});
1302 log.debug(" | offset 0x{x}", .{off});
13031303
13041304 if (rel_type == .ARM64_RELOC_ADDEND) {
13051305 addend = rel.r_symbolnum;
1306 log.warn(" | calculated addend = 0x{x}", .{addend});
1306 log.debug(" | calculated addend = 0x{x}", .{addend});
13071307 // TODO followed by either PAGE21 or PAGEOFF12 only.
13081308 continue;
13091309 }
13101310 },
13111311 .x86_64 => {
13121312 const rel_type = @intToEnum(macho.reloc_type_x86_64, rel.r_type);
1313 log.warn("{s}", .{rel_type});
1314 log.warn(" | source address 0x{x}", .{this_addr});
1315 log.warn(" | offset 0x{x}", .{off});
1313 log.debug("{s}", .{rel_type});
1314 log.debug(" | source address 0x{x}", .{this_addr});
1315 log.debug(" | offset 0x{x}", .{off});
13161316 },
13171317 else => {},
13181318 }
13191319
13201320 const target_addr = try self.relocTargetAddr(@intCast(u16, object_id), rel);
1321 log.warn(" | target address 0x{x}", .{target_addr});
1321 log.debug(" | target address 0x{x}", .{target_addr});
13221322 if (rel.r_extern == 1) {
13231323 const target_symname = object.getString(object.symtab.items[rel.r_symbolnum].n_strx);
1324 log.warn(" | target symbol '{s}'", .{target_symname});
1324 log.debug(" | target symbol '{s}'", .{target_symname});
13251325 } else {
13261326 const target_sectname = seg.sections.items[rel.r_symbolnum - 1].sectname;
1327 log.warn(" | target section '{s}'", .{parseName(&target_sectname)});
1327 log.debug(" | target section '{s}'", .{parseName(&target_sectname)});
13281328 }
13291329
13301330 switch (self.arch.?) {
......@@ -1358,7 +1358,7 @@ fn doRelocs(self: *Zld) !void {
13581358 assert(rel.r_length == 2);
13591359 const inst = code[off..][0..4];
13601360 const offset = @intCast(i64, mem.readIntLittle(i32, inst));
1361 log.warn(" | calculated addend 0x{x}", .{offset});
1361 log.debug(" | calculated addend 0x{x}", .{offset});
13621362 const actual_target_addr = blk: {
13631363 if (rel.r_extern == 1) {
13641364 break :blk @intCast(i64, target_addr) + offset;
......@@ -1370,7 +1370,7 @@ fn doRelocs(self: *Zld) !void {
13701370 .X86_64_RELOC_SIGNED_4 => 4,
13711371 else => unreachable,
13721372 };
1373 log.warn(" | calculated correction 0x{x}", .{correction});
1373 log.debug(" | calculated correction 0x{x}", .{correction});
13741374
13751375 // The value encoded in the instruction is a displacement - 4 - correction.
13761376 // To obtain the adjusted target address in the final binary, we need
......@@ -1385,9 +1385,9 @@ fn doRelocs(self: *Zld) !void {
13851385 const orig_seg = object.load_commands.items[object.segment_cmd_index.?].Segment;
13861386 const orig_sect = orig_seg.sections.items[orig_sect_id];
13871387 const orig_offset = off + offset + 4 + correction - @intCast(i64, orig_sect.addr);
1388 log.warn(" | original offset 0x{x}", .{orig_offset});
1388 log.debug(" | original offset 0x{x}", .{orig_offset});
13891389 const adjusted = @intCast(i64, target_addr) + orig_offset;
1390 log.warn(" | adjusted target address 0x{x}", .{adjusted});
1390 log.debug(" | adjusted target address 0x{x}", .{adjusted});
13911391 break :blk adjusted - correction;
13921392 }
13931393 };
......@@ -1406,7 +1406,7 @@ fn doRelocs(self: *Zld) !void {
14061406
14071407 const result = outer: {
14081408 if (rel.r_extern == 1) {
1409 log.warn(" | calculated addend 0x{x}", .{offset});
1409 log.debug(" | calculated addend 0x{x}", .{offset});
14101410 if (sub) |s| {
14111411 break :outer @intCast(i64, target_addr) - s + offset;
14121412 } else {
......@@ -1433,7 +1433,7 @@ fn doRelocs(self: *Zld) !void {
14331433 break :inner @intCast(i64, target_addr) + orig_offset;
14341434 }
14351435 };
1436 log.warn(" | adjusted target address 0x{x}", .{actual_target_addr});
1436 log.debug(" | adjusted target address 0x{x}", .{actual_target_addr});
14371437 break :outer actual_target_addr;
14381438 }
14391439 };
......@@ -1463,7 +1463,7 @@ fn doRelocs(self: *Zld) !void {
14631463 2 => {
14641464 const inst = code[off..][0..4];
14651465 const offset = mem.readIntLittle(i32, inst);
1466 log.warn(" | calculated addend 0x{x}", .{offset});
1466 log.debug(" | calculated addend 0x{x}", .{offset});
14671467 const result = if (sub) |s|
14681468 @intCast(i64, target_addr) - s + offset
14691469 else
......@@ -1500,7 +1500,7 @@ fn doRelocs(self: *Zld) !void {
15001500 const this_page = @intCast(i32, this_addr >> 12);
15011501 const target_page = @intCast(i32, ta >> 12);
15021502 const pages = @bitCast(u21, @intCast(i21, target_page - this_page));
1503 log.warn(" | moving by {} pages", .{pages});
1503 log.debug(" | moving by {} pages", .{pages});
15041504 var parsed = mem.bytesAsValue(meta.TagPayload(Arm64, Arm64.Address), inst);
15051505 parsed.immhi = @truncate(u19, pages >> 2);
15061506 parsed.immlo = @truncate(u2, pages);
......@@ -1511,14 +1511,14 @@ fn doRelocs(self: *Zld) !void {
15111511 => {
15121512 const inst = code[off..][0..4];
15131513 if (Arm64.isArithmetic(inst)) {
1514 log.warn(" | detected ADD opcode", .{});
1514 log.debug(" | detected ADD opcode", .{});
15151515 // add
15161516 var parsed = mem.bytesAsValue(meta.TagPayload(Arm64, Arm64.Add), inst);
15171517 const ta = if (addend) |a| target_addr + a else target_addr;
15181518 const narrowed = @truncate(u12, ta);
15191519 parsed.offset = narrowed;
15201520 } else {
1521 log.warn(" | detected LDR/STR opcode", .{});
1521 log.debug(" | detected LDR/STR opcode", .{});
15221522 // ldr/str
15231523 var parsed = mem.bytesAsValue(meta.TagPayload(Arm64, Arm64.LoadRegister), inst);
15241524 const ta = if (addend) |a| target_addr + a else target_addr;
......@@ -1559,7 +1559,7 @@ fn doRelocs(self: *Zld) !void {
15591559 };
15601560 const ta = if (addend) |a| target_addr + a else target_addr;
15611561 const narrowed = @truncate(u12, ta);
1562 log.warn(" | rewriting TLV access to ADD opcode", .{});
1562 log.debug(" | rewriting TLV access to ADD opcode", .{});
15631563 // For TLV, we always generate an add instruction.
15641564 mem.writeIntLittle(u32, inst, Arm64.add(parsed.rt, parsed.rn, narrowed, parsed.size).toU32());
15651565 },
......@@ -1571,7 +1571,7 @@ fn doRelocs(self: *Zld) !void {
15711571 3 => {
15721572 const inst = code[off..][0..8];
15731573 const offset = mem.readIntLittle(i64, inst);
1574 log.warn(" | calculated addend 0x{x}", .{offset});
1574 log.debug(" | calculated addend 0x{x}", .{offset});
15751575 const result = if (sub) |s|
15761576 @intCast(i64, target_addr) - s + offset
15771577 else
......@@ -1602,7 +1602,7 @@ fn doRelocs(self: *Zld) !void {
16021602 2 => {
16031603 const inst = code[off..][0..4];
16041604 const offset = mem.readIntLittle(i32, inst);
1605 log.warn(" | calculated addend 0x{x}", .{offset});
1605 log.debug(" | calculated addend 0x{x}", .{offset});
16061606 const result = if (sub) |s|
16071607 @intCast(i64, target_addr) - s + offset
16081608 else
......@@ -1624,7 +1624,7 @@ fn doRelocs(self: *Zld) !void {
16241624 }
16251625 }
16261626
1627 log.warn("writing contents of '{s},{s}' section from '{s}' from 0x{x} to 0x{x}", .{
1627 log.debug("writing contents of '{s},{s}' section from '{s}' from 0x{x} to 0x{x}", .{
16281628 segname,
16291629 sectname,
16301630 object.name,
......@@ -1636,7 +1636,7 @@ fn doRelocs(self: *Zld) !void {
16361636 target_sect.flags == macho.S_THREAD_LOCAL_ZEROFILL or
16371637 target_sect.flags == macho.S_THREAD_LOCAL_VARIABLES)
16381638 {
1639 log.warn("zeroing out '{s},{s}' from 0x{x} to 0x{x}", .{
1639 log.debug("zeroing out '{s},{s}' from 0x{x} to 0x{x}", .{
16401640 parseName(&target_sect.segname),
16411641 parseName(&target_sect.sectname),
16421642 target_sect_off,
......@@ -1670,7 +1670,7 @@ fn relocTargetAddr(self: *Zld, object_id: u16, rel: macho.relocation_info) !u64
16701670 const target_seg = self.load_commands.items[target_mapping.target_seg_id].Segment;
16711671 const target_sect = target_seg.sections.items[target_mapping.target_sect_id];
16721672 const target_sect_addr = target_sect.addr + target_mapping.offset;
1673 log.warn(" | symbol local to object", .{});
1673 log.debug(" | symbol local to object", .{});
16741674 break :blk target_sect_addr + sym.n_value - source_sect.addr;
16751675 } else if (isImport(&sym)) {
16761676 // Relocate to either the artifact's local symbol, or an import from
......@@ -2275,7 +2275,7 @@ fn writeRebaseInfoTable(self: *Zld) !void {
22752275 dyld_info.rebase_size = @intCast(u32, mem.alignForwardGeneric(u64, buffer.len, @sizeOf(u64)));
22762276 seg.inner.filesize += dyld_info.rebase_size;
22772277
2278 log.warn("writing rebase info from 0x{x} to 0x{x}", .{ dyld_info.rebase_off, dyld_info.rebase_off + dyld_info.rebase_size });
2278 log.debug("writing rebase info from 0x{x} to 0x{x}", .{ dyld_info.rebase_off, dyld_info.rebase_off + dyld_info.rebase_size });
22792279
22802280 try self.file.?.pwriteAll(buffer, dyld_info.rebase_off);
22812281}
......@@ -2336,7 +2336,7 @@ fn writeBindInfoTable(self: *Zld) !void {
23362336 dyld_info.bind_size = @intCast(u32, mem.alignForwardGeneric(u64, buffer.len, @alignOf(u64)));
23372337 seg.inner.filesize += dyld_info.bind_size;
23382338
2339 log.warn("writing binding info from 0x{x} to 0x{x}", .{ dyld_info.bind_off, dyld_info.bind_off + dyld_info.bind_size });
2339 log.debug("writing binding info from 0x{x} to 0x{x}", .{ dyld_info.bind_off, dyld_info.bind_off + dyld_info.bind_size });
23402340
23412341 try self.file.?.pwriteAll(buffer, dyld_info.bind_off);
23422342}
......@@ -2375,7 +2375,7 @@ fn writeLazyBindInfoTable(self: *Zld) !void {
23752375 dyld_info.lazy_bind_size = @intCast(u32, mem.alignForwardGeneric(u64, buffer.len, @alignOf(u64)));
23762376 seg.inner.filesize += dyld_info.lazy_bind_size;
23772377
2378 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 });
2378 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 });
23792379
23802380 try self.file.?.pwriteAll(buffer, dyld_info.lazy_bind_off);
23812381 try self.populateLazyBindOffsetsInStubHelper(buffer);
......@@ -2477,7 +2477,7 @@ fn writeExportInfo(self: *Zld) !void {
24772477 dyld_info.export_size = @intCast(u32, mem.alignForwardGeneric(u64, buffer.len, @alignOf(u64)));
24782478 seg.inner.filesize += dyld_info.export_size;
24792479
2480 log.warn("writing export info from 0x{x} to 0x{x}", .{ dyld_info.export_off, dyld_info.export_off + dyld_info.export_size });
2480 log.debug("writing export info from 0x{x} to 0x{x}", .{ dyld_info.export_off, dyld_info.export_off + dyld_info.export_size });
24812481
24822482 try self.file.?.pwriteAll(buffer, dyld_info.export_off);
24832483}
......@@ -2611,7 +2611,7 @@ fn writeDebugInfo(self: *Zld) !void {
26112611
26122612 const stabs_off = symtab.symoff;
26132613 const stabs_size = symtab.nsyms * @sizeOf(macho.nlist_64);
2614 log.warn("writing symbol stabs from 0x{x} to 0x{x}", .{ stabs_off, stabs_size + stabs_off });
2614 log.debug("writing symbol stabs from 0x{x} to 0x{x}", .{ stabs_off, stabs_size + stabs_off });
26152615 try self.file.?.pwriteAll(mem.sliceAsBytes(stabs.items), stabs_off);
26162616
26172617 linkedit.inner.filesize += stabs_size;
......@@ -2629,12 +2629,12 @@ fn writeSymbolTable(self: *Zld) !void {
26292629 defer locals.deinit();
26302630
26312631 for (self.locals.items()) |entries| {
2632 log.warn("'{s}': {} entries", .{ entries.key, entries.value.items.len });
2632 log.debug("'{s}': {} entries", .{ entries.key, entries.value.items.len });
26332633 // var symbol: ?macho.nlist_64 = null;
26342634 for (entries.value.items) |entry| {
2635 log.warn(" | {}", .{entry.inner});
2636 log.warn(" | {}", .{entry.tt});
2637 log.warn(" | {s}", .{self.objects.items[entry.object_id].name});
2635 log.debug(" | {}", .{entry.inner});
2636 log.debug(" | {}", .{entry.tt});
2637 log.debug(" | {s}", .{self.objects.items[entry.object_id].name});
26382638 // switch (entry.tt) {
26392639 // .Global => {
26402640 // symbol = entry.inner;
......@@ -2679,17 +2679,17 @@ fn writeSymbolTable(self: *Zld) !void {
26792679
26802680 const locals_off = symtab.symoff + symtab.nsyms * @sizeOf(macho.nlist_64);
26812681 const locals_size = nlocals * @sizeOf(macho.nlist_64);
2682 log.warn("writing local symbols from 0x{x} to 0x{x}", .{ locals_off, locals_size + locals_off });
2682 log.debug("writing local symbols from 0x{x} to 0x{x}", .{ locals_off, locals_size + locals_off });
26832683 try self.file.?.pwriteAll(mem.sliceAsBytes(locals.items), locals_off);
26842684
26852685 const exports_off = locals_off + locals_size;
26862686 const exports_size = nexports * @sizeOf(macho.nlist_64);
2687 log.warn("writing exported symbols from 0x{x} to 0x{x}", .{ exports_off, exports_size + exports_off });
2687 log.debug("writing exported symbols from 0x{x} to 0x{x}", .{ exports_off, exports_size + exports_off });
26882688 try self.file.?.pwriteAll(mem.sliceAsBytes(exports.items), exports_off);
26892689
26902690 const undefs_off = exports_off + exports_size;
26912691 const undefs_size = nundefs * @sizeOf(macho.nlist_64);
2692 log.warn("writing undefined symbols from 0x{x} to 0x{x}", .{ undefs_off, undefs_size + undefs_off });
2692 log.debug("writing undefined symbols from 0x{x} to 0x{x}", .{ undefs_off, undefs_size + undefs_off });
26932693 try self.file.?.pwriteAll(mem.sliceAsBytes(undefs.items), undefs_off);
26942694
26952695 symtab.nsyms += @intCast(u32, nlocals + nexports + nundefs);
......@@ -2720,7 +2720,7 @@ fn writeDynamicSymbolTable(self: *Zld) !void {
27202720 const needed_size = dysymtab.nindirectsyms * @sizeOf(u32);
27212721 seg.inner.filesize += needed_size;
27222722
2723 log.warn("writing indirect symbol table from 0x{x} to 0x{x}", .{
2723 log.debug("writing indirect symbol table from 0x{x} to 0x{x}", .{
27242724 dysymtab.indirectsymoff,
27252725 dysymtab.indirectsymoff + needed_size,
27262726 });
......@@ -2759,7 +2759,7 @@ fn writeStringTable(self: *Zld) !void {
27592759 symtab.strsize = @intCast(u32, mem.alignForwardGeneric(u64, self.strtab.items.len, @alignOf(u64)));
27602760 seg.inner.filesize += symtab.strsize;
27612761
2762 log.warn("writing string table from 0x{x} to 0x{x}", .{ symtab.stroff, symtab.stroff + symtab.strsize });
2762 log.debug("writing string table from 0x{x} to 0x{x}", .{ symtab.stroff, symtab.stroff + symtab.strsize });
27632763
27642764 try self.file.?.pwriteAll(self.strtab.items, symtab.stroff);
27652765
......@@ -2806,7 +2806,7 @@ fn writeDataInCode(self: *Zld) !void {
28062806 dice_cmd.datasize = datasize;
28072807 seg.inner.filesize += datasize;
28082808
2809 log.warn("writing data-in-code from 0x{x} to 0x{x}", .{ fileoff, fileoff + datasize });
2809 log.debug("writing data-in-code from 0x{x} to 0x{x}", .{ fileoff, fileoff + datasize });
28102810
28112811 try self.file.?.pwriteAll(buf.items, fileoff);
28122812}
......@@ -2827,7 +2827,7 @@ fn writeCodeSignaturePadding(self: *Zld) !void {
28272827 seg.inner.filesize += needed_size;
28282828 seg.inner.vmsize = mem.alignForwardGeneric(u64, seg.inner.filesize, self.page_size.?);
28292829
2830 log.warn("writing code signature padding from 0x{x} to 0x{x}", .{ fileoff, fileoff + needed_size });
2830 log.debug("writing code signature padding from 0x{x} to 0x{x}", .{ fileoff, fileoff + needed_size });
28312831
28322832 // Pad out the space. We need to do this to calculate valid hashes for everything in the file
28332833 // except for code signature data.
......@@ -2853,7 +2853,7 @@ fn writeCodeSignature(self: *Zld) !void {
28532853 var stream = std.io.fixedBufferStream(buffer);
28542854 try code_sig.write(stream.writer());
28552855
2856 log.warn("writing code signature from 0x{x} to 0x{x}", .{ code_sig_cmd.dataoff, code_sig_cmd.dataoff + buffer.len });
2856 log.debug("writing code signature from 0x{x} to 0x{x}", .{ code_sig_cmd.dataoff, code_sig_cmd.dataoff + buffer.len });
28572857
28582858 try self.file.?.pwriteAll(buffer, code_sig_cmd.dataoff);
28592859}
......@@ -2872,7 +2872,7 @@ fn writeLoadCommands(self: *Zld) !void {
28722872 }
28732873
28742874 const off = @sizeOf(macho.mach_header_64);
2875 log.warn("writing {} load commands from 0x{x} to 0x{x}", .{ self.load_commands.items.len, off, off + sizeofcmds });
2875 log.debug("writing {} load commands from 0x{x} to 0x{x}", .{ self.load_commands.items.len, off, off + sizeofcmds });
28762876 try self.file.?.pwriteAll(buffer, off);
28772877}
28782878
......@@ -2910,7 +2910,7 @@ fn writeHeader(self: *Zld) !void {
29102910 for (self.load_commands.items) |cmd| {
29112911 header.sizeofcmds += cmd.cmdsize();
29122912 }
2913 log.warn("writing Mach-O header {}", .{header});
2913 log.debug("writing Mach-O header {}", .{header});
29142914 try self.file.?.pwriteAll(mem.asBytes(&header), 0);
29152915}
29162916
......@@ -2924,7 +2924,7 @@ pub fn makeStaticString(bytes: []const u8) [16]u8 {
29242924fn makeString(self: *Zld, bytes: []const u8) !u32 {
29252925 try self.strtab.ensureCapacity(self.allocator, self.strtab.items.len + bytes.len + 1);
29262926 const offset = @intCast(u32, self.strtab.items.len);
2927 log.warn("writing new string '{s}' into string table at offset 0x{x}", .{ bytes, offset });
2927 log.debug("writing new string '{s}' into string table at offset 0x{x}", .{ bytes, offset });
29282928 self.strtab.appendSliceAssumeCapacity(bytes);
29292929 self.strtab.appendAssumeCapacity(0);
29302930 return offset;