authorgravatar for kcbanner@gmail.comCasey Banner <kcbanner@gmail.com> 2026-06-05 01:55:36-04:00
committergravatar for kcbanner@gmail.comCasey Banner <kcbanner@gmail.com> 2026-06-23 00:26:57-04:00
logc6d0c68141ebd8059bf5e7cdc5f1b4117e62e64a
tree27b4f0d5305a58872c88040c1e2a81678c65c4cd
parentb2eee06bd67e720014809ade89b0b054865b0040

objdump: fixup incorrect dumping of implib objects


1 files changed, 5 insertions(+), 4 deletions(-)

lib/compiler/objdump.zig+5-4
...@@ -413,8 +413,9 @@ const coff = struct {...@@ -413,8 +413,9 @@ const coff = struct {
413 try w.writeAll(str);413 try w.writeAll(str);
414 try w.writeByte('\n');414 try w.writeByte('\n');
415 }415 }
416 try w.writeByte('\n');
417 }416 }
417
418 try w.writeByte('\n');
418 }419 }
419420
420 opt_expected_kind = null;421 opt_expected_kind = null;
...@@ -444,7 +445,6 @@ const coff = struct {...@@ -444,7 +445,6 @@ const coff = struct {
444 const sig = std.mem.readInt(u16, member_sig[2..4], .little);445 const sig = std.mem.readInt(u16, member_sig[2..4], .little);
445446
446 const is_imp_lib = machine == std.coff.IMAGE.FILE.MACHINE.UNKNOWN and sig == 0xffff;447 const is_imp_lib = machine == std.coff.IMAGE.FILE.MACHINE.UNKNOWN and sig == 0xffff;
447
448 if (opts.member_headers or (opts.exports and is_imp_lib)) {448 if (opts.member_headers or (opts.exports and is_imp_lib)) {
449 try dumpArchiveHeader(w, &header, member.offset);449 try dumpArchiveHeader(w, &header, member.offset);
450 if (is_imp_lib) {450 if (is_imp_lib) {
...@@ -493,6 +493,7 @@ const coff = struct {...@@ -493,6 +493,7 @@ const coff = struct {
493 try w.writeByte('\n');493 try w.writeByte('\n');
494 }494 }
495495
496 if (is_imp_lib) continue;
496 if (opts.section_headers or497 if (opts.section_headers or
497 opts.file_headers or498 opts.file_headers or
498 opts.relocs or499 opts.relocs or
...@@ -678,7 +679,7 @@ const coff = struct {...@@ -678,7 +679,7 @@ const coff = struct {
678 if (load_sections) {679 if (load_sections) {
679 if (opts.section_headers)680 if (opts.section_headers)
680 try w.print(681 try w.print(
681 \\Sections in {s}:682 \\Sections in '{s}':
682 \\Num Name RVA Virt Size Data Size & Data & Relocs & Lines # Relocs # Lines Flags683 \\Num Name RVA Virt Size Data Size & Data & Relocs & Lines # Relocs # Lines Flags
683 \\684 \\
684 , .{obj_name});685 , .{obj_name});
...@@ -747,7 +748,7 @@ const coff = struct {...@@ -747,7 +748,7 @@ const coff = struct {
747748
748 if (opts.symbols)749 if (opts.symbols)
749 try w.print(750 try w.print(
750 \\Symbols in {s}:751 \\Symbols in '{s}':
751 \\ Ord Value Sect Type Storage Name752 \\ Ord Value Sect Type Storage Name
752 \\753 \\
753 , .{obj_name});754 , .{obj_name});