aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2023-12-05 18:12:58 +0100
committerJakub Konka <kubkon@jakubkonka.com>2023-12-05 18:12:58 +0100
commitda417b851b8aa8522abfbd235c82193075054544 (patch)
treebb101d7b0862b739abf48dcb785f580d9f94dfaf
parent418b042f492417edbdd57b5b85610e6d36d9a7ac (diff)
downloadzig-da417b851b8aa8522abfbd235c82193075054544.tar.gz
zig-da417b851b8aa8522abfbd235c82193075054544.zip
elf: return error.FlushFailure in flushObject and flushStaticLib codepaths when found errors
-rw-r--r--src/link/Elf.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/link/Elf.zig b/src/link/Elf.zig
index 515d0e6e32..d52a5fa423 100644
--- a/src/link/Elf.zig
+++ b/src/link/Elf.zig
@@ -1442,6 +1442,8 @@ pub fn flushStaticLib(self: *Elf, comp: *Compilation, module_obj_path: ?[]const
try self.base.file.?.setEndPos(total_size);
try self.base.file.?.pwriteAll(buffer.items, 0);
+
+ if (self.misc_errors.items.len > 0) return error.FlushFailure;
}
pub fn flushObject(self: *Elf, comp: *Compilation, module_obj_path: ?[]const u8) link.File.FlushError!void {
@@ -1512,6 +1514,8 @@ pub fn flushObject(self: *Elf, comp: *Compilation, module_obj_path: ?[]const u8)
try self.writeSyntheticSectionsObject();
try self.writeShdrTable();
try self.writeElfHeader();
+
+ if (self.misc_errors.items.len > 0) return error.FlushFailure;
}
/// --verbose-link output