diff --git a/src/link/Elf.zig b/src/link/Elf.zig index 2c035b6f07230872ca42bb4d93117de3489e211c..71000e3e60b180daa77097493e436338af9d23dd 100644 --- a/src/link/Elf.zig +++ b/src/link/Elf.zig @@ -286,7 +286,7 @@ pub fn createEmpty( .image_base = b: { if (is_dyn_lib) break :b 0; - if (output_mode == .Exe and comp.config.pie) break :b 0; + if (output_mode == .Exe and (comp.config.pie or target.os.tag == .haiku)) break :b 0; break :b options.image_base orelse switch (ptr_width) { .p32 => 0x10000, .p64 => 0x1000000, diff --git a/src/link/Lld.zig b/src/link/Lld.zig index 51d40f70971419150f5500c982d01f5892f113f1..cb6863ca0872d46b67f13437f7307dcdbb99cd48 100644 --- a/src/link/Lld.zig +++ b/src/link/Lld.zig @@ -126,7 +126,7 @@ pub const Elf = struct { .hash_style = options.hash_style, .image_base = b: { if (is_dyn_lib) break :b 0; - if (output_mode == .Exe and comp.config.pie) break :b 0; + if (output_mode == .Exe and (comp.config.pie or target.os.tag == .haiku)) break :b 0; break :b options.image_base orelse switch (ptr_width) { .p32 => 0x10000, .p64 => 0x1000000,