macho: report undefined via compiler errors in incremental driver

This commit is contained in:
Jakub Konka 2023-08-28 07:00:45 +02:00
parent 8d1ca8ce7b
commit 8330065a99

View File

@ -428,21 +428,12 @@ pub fn flushModule(self: *MachO, comp: *Compilation, prog_node: *std.Progress.No
var actions = std.ArrayList(ResolveAction).init(self.base.allocator);
defer actions.deinit();
try self.resolveSymbols(&actions);
try self.reportUndefined();
if (self.getEntryPoint() == null) {
self.error_flags.no_entry_point_found = true;
}
if (self.unresolved.count() > 0) {
for (self.unresolved.keys()) |index| {
// TODO: convert into compiler errors.
const global = self.globals.items[index];
const sym_name = self.getSymbolName(global);
log.err("undefined symbol reference '{s}'", .{sym_name});
}
return error.UndefinedSymbolReference;
}
for (actions.items) |action| switch (action.kind) {
.none => {},
.add_got => try self.addGotEntry(action.target),