authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-10-16 14:47:34-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-10-23 16:27:38-07:00
loge331e8171987a59a882c63e1156e7a3a8eb871a1
treea011b05a4a9f4592ae8b108614513b41e67379e0
parentcbcd67ea90979eca4a2b46838c54472058886fed

link.Elf: refactor output mode checking


1 files changed, 9 insertions(+), 2 deletions(-)

src/link/Elf.zig+9-2
......@@ -790,8 +790,15 @@ pub fn flushModule(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_nod
790790 if (comp.verbose_link) try self.dumpArgv(comp);
791791
792792 if (self.zigObjectPtr()) |zig_object| try zig_object.flush(self, tid);
793 if (self.base.isStaticLib()) return relocatable.flushStaticLib(self, comp, module_obj_path);
794 if (self.base.isObject()) return relocatable.flushObject(self, comp, module_obj_path);
793
794 switch (comp.config.output_mode) {
795 .Obj => return relocatable.flushObject(self, comp, module_obj_path),
796 .Lib => switch (comp.config.link_mode) {
797 .dynamic => {},
798 .static => return relocatable.flushStaticLib(self, comp, module_obj_path),
799 },
800 .Exe => {},
801 }
795802
796803 const csu = try comp.getCrtPaths(arena);
797804