Skip to content

Commit da417b8

Browse files
committed
elf: return error.FlushFailure in flushObject and flushStaticLib codepaths when found errors
1 parent 418b042 commit da417b8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/link/Elf.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,6 +1442,8 @@ pub fn flushStaticLib(self: *Elf, comp: *Compilation, module_obj_path: ?[]const
14421442

14431443
try self.base.file.?.setEndPos(total_size);
14441444
try self.base.file.?.pwriteAll(buffer.items, 0);
1445+
1446+
if (self.misc_errors.items.len > 0) return error.FlushFailure;
14451447
}
14461448

14471449
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)
15121514
try self.writeSyntheticSectionsObject();
15131515
try self.writeShdrTable();
15141516
try self.writeElfHeader();
1517+
1518+
if (self.misc_errors.items.len > 0) return error.FlushFailure;
15151519
}
15161520

15171521
/// --verbose-link output

0 commit comments

Comments
 (0)