| ... | ... | @@ -1496,6 +1496,15 @@ fn linkWithLLD(self: *Elf, comp: *Compilation) !void { |
| 1496 | 1496 | try argv.append("-pie"); |
| 1497 | 1497 | } |
| 1498 | 1498 | |
| 1499 | if (self.base.options.link_mode == .Dynamic and target.os.tag == .netbsd) { |
| 1500 | // Add options to produce shared objects with only 2 PT_LOAD segments. |
| 1501 | // NetBSD expects 2 PT_LOAD segments in a shared object, otherwise |
| 1502 | // ld.elf_so fails to load, emitting a general "not found" error. |
| 1503 | // See https://github.com/ziglang/zig/issues/9109 . |
| 1504 | try argv.append("--no-rosegment"); |
| 1505 | try argv.append("-znorelro"); |
| 1506 | } |
| 1507 | |
| 1499 | 1508 | try argv.append("-o"); |
| 1500 | 1509 | try argv.append(full_out_path); |
| 1501 | 1510 | |