From 5cf865189d01bff50536e5d637e98a958e66d8cb Mon Sep 17 00:00:00 2001 From: Anhad Singh Date: Wed, 18 Feb 2026 02:36:03 +1100 Subject: [PATCH] fix(ld.so): temporary rollback See the "Redox OS/Support" channel. This commit temporarily fixes the issue by rolling back the changes to preload the executable. Signed-off-by: Anhad Singh --- src/ld_so/dso.rs | 2 +- src/ld_so/start.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ld_so/dso.rs b/src/ld_so/dso.rs index 0533b3117a..b8ce022539 100644 --- a/src/ld_so/dso.rs +++ b/src/ld_so/dso.rs @@ -534,7 +534,7 @@ impl DSO { let size = end - start; let mut flags = sys_mman::MAP_ANONYMOUS | sys_mman::MAP_PRIVATE; if start != 0 { - flags |= sys_mman::MAP_FIXED_NOREPLACE; + flags |= sys_mman::MAP_FIXED; } log::trace!(" mmap({:#x}, {:x}, {:x})", start, size, flags); let ptr = Sys::mmap( diff --git a/src/ld_so/start.rs b/src/ld_so/start.rs index 355f1474fa..0e638cf714 100644 --- a/src/ld_so/start.rs +++ b/src/ld_so/start.rs @@ -286,7 +286,7 @@ pub unsafe extern "C" fn relibc_ld_so_start( } let mut base_addr = None; - if !is_manual { + if !is_manual && cfg!(not(target_os = "redox")) { // if we are not running in manual mode, then the main // program is already loaded by the kernel and we want // to use it. on redox, we treat it the same.