authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-01-18 20:40:47+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-01-24 12:34:41+01:00
log5ef63e333ad47c63ac648da48c25078bba0cccbb
tree5cabb4de30d8da75fcf52eaa712b9a8064f161b7
parent5d0ea3fd275167b81ff0c75789a3ea4408527f4e

macho: set atom_index for newly created Atom in ZigObject


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

src/link/MachO.zig+7
...@@ -3779,6 +3779,13 @@ fn fmtDumpState(...@@ -3779,6 +3779,13 @@ fn fmtDumpState(
3779) !void {3779) !void {
3780 _ = options;3780 _ = options;
3781 _ = unused_fmt_string;3781 _ = unused_fmt_string;
3782 if (self.getZigObject()) |zo| {
3783 try writer.print("zig_object({d}) : {s}\n", .{ zo.index, zo.path });
3784 try writer.print("{}{}\n", .{
3785 zo.fmtAtoms(self),
3786 zo.fmtSymtab(self),
3787 });
3788 }
3782 for (self.objects.items) |index| {3789 for (self.objects.items) |index| {
3783 const object = self.getFile(index).?.object;3790 const object = self.getFile(index).?.object;
3784 try writer.print("object({d}) : {} : has_debug({})", .{3791 try writer.print("object({d}) : {} : has_debug({})", .{
src/link/MachO/ZigObject.zig+1
...@@ -110,6 +110,7 @@ pub fn addAtom(self: *ZigObject, macho_file: *MachO) !Symbol.Index {...@@ -110,6 +110,7 @@ pub fn addAtom(self: *ZigObject, macho_file: *MachO) !Symbol.Index {
110110
111 const atom = macho_file.getAtom(atom_index).?;111 const atom = macho_file.getAtom(atom_index).?;
112 atom.file = self.index;112 atom.file = self.index;
113 atom.atom_index = atom_index;
113114
114 const symbol = macho_file.getSymbol(symbol_index);115 const symbol = macho_file.getSymbol(symbol_index);
115 symbol.file = self.index;116 symbol.file = self.index;