diff --git a/src/link/Elf.zig b/src/link/Elf.zig index 86b8def937..c3a2daa5a4 100644 --- a/src/link/Elf.zig +++ b/src/link/Elf.zig @@ -2508,7 +2508,7 @@ fn linkWithLLD(self: *Elf, arena: Allocator, prog_node: *std.Progress.Node) !voi try argv.append("-pie"); } - if (is_dyn_lib and target.os.tag == .netbsd) { + if (is_exe_or_dyn_lib and target.os.tag == .netbsd) { // Add options to produce shared objects with only 2 PT_LOAD segments. // NetBSD expects 2 PT_LOAD segments in a shared object, otherwise // ld.elf_so fails loading dynamic libraries with "not found" error.