mirror of
https://github.com/ziglang/zig.git
synced 2026-01-11 18:05:11 +00:00
elf: exit early with an error when parsing or init failed when flushing object/archive
This commit is contained in:
parent
ee1630beea
commit
ab423bd63c
@ -1331,6 +1331,8 @@ pub fn flushStaticLib(self: *Elf, comp: *Compilation, module_obj_path: ?[]const
|
||||
};
|
||||
}
|
||||
|
||||
if (self.misc_errors.items.len > 0) return error.FlushFailure;
|
||||
|
||||
// First, we flush relocatable object file generated with our backends.
|
||||
if (self.zigObjectPtr()) |zig_object| {
|
||||
zig_object.resolveSymbols(self);
|
||||
@ -1468,11 +1470,15 @@ pub fn flushObject(self: *Elf, comp: *Compilation, module_obj_path: ?[]const u8)
|
||||
};
|
||||
}
|
||||
|
||||
if (self.misc_errors.items.len > 0) return error.FlushFailure;
|
||||
|
||||
// Init all objects
|
||||
for (self.objects.items) |index| {
|
||||
try self.file(index).?.object.init(self);
|
||||
}
|
||||
|
||||
if (self.misc_errors.items.len > 0) return error.FlushFailure;
|
||||
|
||||
// Now, we are ready to resolve the symbols across all input files.
|
||||
// We will first resolve the files in the ZigObject, next in the parsed
|
||||
// input Object files.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user