zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit da417b851b8aa8522abfbd235c82193075054544 (tree)
parent 418b042f492417edbdd57b5b85610e6d36d9a7ac
Author: Jakub Konka <kubkon@jakubkonka.com>
Date:   Tue,  5 Dec 2023 18:12:58 +0100

elf: return error.FlushFailure in flushObject and flushStaticLib codepaths when found errors

Diffstat:
Msrc/link/Elf.zig | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git 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