| author | |
| committer | |
| log | 89ed51bf5360f9abf07024e0a9f6c10382fbb624 |
| tree | d77ef11b1b14057222796d0e77bba155048b890d |
| parent | 764760df62c63bc2a3d4bd4ec95c000233625834 |
Executables are always ET_DYN on Haiku, so like shared libraries, they should
not have an image base set. Elf2 already got this right, but Elf and Lld didn't.
closes https://codeberg.org/ziglang/zig/issues/321002 files changed, 2 insertions(+), 2 deletions(-)
src/link/Elf.zig+1-1| ... | ... | @@ -286,7 +286,7 @@ pub fn createEmpty( |
| 286 | 286 | |
| 287 | 287 | .image_base = b: { |
| 288 | 288 | if (is_dyn_lib) break :b 0; |
| 289 | if (output_mode == .Exe and comp.config.pie) break :b 0; | |
| 289 | if (output_mode == .Exe and (comp.config.pie or target.os.tag == .haiku)) break :b 0; | |
| 290 | 290 | break :b options.image_base orelse switch (ptr_width) { |
| 291 | 291 | .p32 => 0x10000, |
| 292 | 292 | .p64 => 0x1000000, |
src/link/Lld.zig+1-1| ... | ... | @@ -126,7 +126,7 @@ pub const Elf = struct { |
| 126 | 126 | .hash_style = options.hash_style, |
| 127 | 127 | .image_base = b: { |
| 128 | 128 | if (is_dyn_lib) break :b 0; |
| 129 | if (output_mode == .Exe and comp.config.pie) break :b 0; | |
| 129 | if (output_mode == .Exe and (comp.config.pie or target.os.tag == .haiku)) break :b 0; | |
| 130 | 130 | break :b options.image_base orelse switch (ptr_width) { |
| 131 | 131 | .p32 => 0x10000, |
| 132 | 132 | .p64 => 0x1000000, |