authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-08-13 12:01:56+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-08-13 13:30:24+02:00
logdf80ccf7600818faafd485b4c01bd4fe0f26a8e5
treeecbae78863b4a263fd0405e19d88e29f559fdba6
parent39ee346681eac850f2f1f9bcb8ca6114dbad581a

elf: pretty print alingment when pretty printing atoms


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

src/link/Elf/Atom.zig+3-3
...@@ -1022,7 +1022,7 @@ pub fn format(...@@ -1022,7 +1022,7 @@ pub fn format(
1022 _ = unused_fmt_string;1022 _ = unused_fmt_string;
1023 _ = options;1023 _ = options;
1024 _ = writer;1024 _ = writer;
1025 @compileError("do not format symbols directly");1025 @compileError("do not format Atom directly");
1026}1026}
10271027
1028pub fn fmt(atom: Atom, elf_file: *Elf) std.fmt.Formatter(format2) {1028pub fn fmt(atom: Atom, elf_file: *Elf) std.fmt.Formatter(format2) {
...@@ -1048,8 +1048,8 @@ fn format2(...@@ -1048,8 +1048,8 @@ fn format2(
1048 const atom = ctx.atom;1048 const atom = ctx.atom;
1049 const elf_file = ctx.elf_file;1049 const elf_file = ctx.elf_file;
1050 try writer.print("atom({d}) : {s} : @{x} : shdr({d}) : align({x}) : size({x})", .{1050 try writer.print("atom({d}) : {s} : @{x} : shdr({d}) : align({x}) : size({x})", .{
1051 atom.atom_index, atom.name(elf_file), atom.address(elf_file),1051 atom.atom_index, atom.name(elf_file), atom.address(elf_file),
1052 atom.output_section_index, atom.alignment, atom.size,1052 atom.output_section_index, atom.alignment.toByteUnits() orelse 0, atom.size,
1053 });1053 });
1054 if (atom.fdes(elf_file).len > 0) {1054 if (atom.fdes(elf_file).len > 0) {
1055 try writer.writeAll(" : fdes{ ");1055 try writer.writeAll(" : fdes{ ");