authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-07-03 16:09:23+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-07-15 18:49:47+02:00
log669ac92af0626b77442415e54be3f604c5b49535
tree17428de9d1908740e901ea789a180308e052f15a
parent3bd9f3801771189ad1aa9d9b41786026add38075

zld: fix ast errors


1 files changed, 10 insertions(+), 2 deletions(-)

src/link/MachO/Symbol.zig+10-2
...@@ -59,6 +59,8 @@ pub const Regular = struct {...@@ -59,6 +59,8 @@ pub const Regular = struct {
59 };59 };
6060
61 pub fn format(self: Regular, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void {61 pub fn format(self: Regular, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void {
62 _ = fmt;
63 _ = options;
62 try std.fmt.format(writer, "Regular {{ ", .{});64 try std.fmt.format(writer, "Regular {{ ", .{});
63 try std.fmt.format(writer, ".linkage = {s}, ", .{self.linkage});65 try std.fmt.format(writer, ".linkage = {s}, ", .{self.linkage});
64 try std.fmt.format(writer, ".address = 0x{x}, ", .{self.address});66 try std.fmt.format(writer, ".address = 0x{x}, ", .{self.address});
...@@ -84,6 +86,8 @@ pub const Tentative = struct {...@@ -84,6 +86,8 @@ pub const Tentative = struct {
84 file: ?*Object = null,86 file: ?*Object = null,
8587
86 pub fn format(self: Tentative, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void {88 pub fn format(self: Tentative, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void {
89 _ = fmt;
90 _ = options;
87 try std.fmt.format(writer, "Tentative {{ ", .{});91 try std.fmt.format(writer, "Tentative {{ ", .{});
88 try std.fmt.format(writer, ".size = 0x{x}, ", .{self.size});92 try std.fmt.format(writer, ".size = 0x{x}, ", .{self.size});
89 try std.fmt.format(writer, ".alignment = 0x{x}, ", .{self.alignment});93 try std.fmt.format(writer, ".alignment = 0x{x}, ", .{self.alignment});
...@@ -116,6 +120,8 @@ pub const Proxy = struct {...@@ -116,6 +120,8 @@ pub const Proxy = struct {
116 }120 }
117121
118 pub fn format(self: Proxy, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void {122 pub fn format(self: Proxy, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void {
123 _ = fmt;
124 _ = options;
119 try std.fmt.format(writer, "Proxy {{ ", .{});125 try std.fmt.format(writer, "Proxy {{ ", .{});
120 if (self.bind_info.items.len > 0) {126 if (self.bind_info.items.len > 0) {
121 // TODO127 // TODO
...@@ -134,6 +140,8 @@ pub const Undefined = struct {...@@ -134,6 +140,8 @@ pub const Undefined = struct {
134 file: ?*Object = null,140 file: ?*Object = null,
135141
136 pub fn format(self: Undefined, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void {142 pub fn format(self: Undefined, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void {
143 _ = fmt;
144 _ = options;
137 try std.fmt.format(writer, "Undefined {{ ", .{});145 try std.fmt.format(writer, "Undefined {{ ", .{});
138 if (self.file) |file| {146 if (self.file) |file| {
139 try std.fmt.format(writer, ".file = {s}, ", .{file.name.?});147 try std.fmt.format(writer, ".file = {s}, ", .{file.name.?});
...@@ -192,7 +200,7 @@ pub fn asNlist(symbol: *Symbol, strtab: *StringTable) !macho.nlist_64 {...@@ -192,7 +200,7 @@ pub fn asNlist(symbol: *Symbol, strtab: *StringTable) !macho.nlist_64 {
192200
193 break :nlist nlist;201 break :nlist nlist;
194 },202 },
195 .tentative => |tentative| {203 .tentative => {
196 // TODO204 // TODO
197 break :nlist macho.nlist_64{205 break :nlist macho.nlist_64{
198 .n_strx = n_strx,206 .n_strx = n_strx,
...@@ -211,7 +219,7 @@ pub fn asNlist(symbol: *Symbol, strtab: *StringTable) !macho.nlist_64 {...@@ -211,7 +219,7 @@ pub fn asNlist(symbol: *Symbol, strtab: *StringTable) !macho.nlist_64 {
211 .n_value = 0,219 .n_value = 0,
212 };220 };
213 },221 },
214 .undef => |undef| {222 .undef => {
215 // TODO223 // TODO
216 break :nlist macho.nlist_64{224 break :nlist macho.nlist_64{
217 .n_strx = n_strx,225 .n_strx = n_strx,