diff --git a/src/lib.rs b/src/lib.rs index 98305751..536fb489 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -82,7 +82,7 @@ pub mod x86_64; #[cfg_attr(not(feature = "mangled-names"), no_mangle)] #[linkage = "weak"] pub unsafe extern "C" fn abort() -> ! { - let syscall: extern "C" fn() -> ! = core::mem::transmute(3069975057u64); // murmur32 hash of "abort" + let syscall: extern "C" fn() -> ! = core::mem::transmute(1usize); // 1 is the code for "abort" syscall() } diff --git a/src/mem/mod.rs b/src/mem/mod.rs index c22c3a7e..d4c2de3e 100644 --- a/src/mem/mod.rs +++ b/src/mem/mod.rs @@ -219,25 +219,24 @@ mod syscalls { mod syscalls { pub(crate) fn sol_memcpy_(dest: *mut u8, src: *const u8, n: u64) { let syscall: extern "C" fn(*mut u8, *const u8, u64) = - unsafe { core::mem::transmute(1904002211u64) }; // murmur32 hash of "sol_memcpy_" + unsafe { core::mem::transmute(3usize) }; // 3 is the code for "sol_memcpy_" syscall(dest, src, n) } pub(crate) fn sol_memmove_(dest: *mut u8, src: *const u8, n: u64) { let syscall: extern "C" fn(*mut u8, *const u8, u64) = - unsafe { core::mem::transmute(1128493560u64) }; // murmur32 hash of "sol_memmove_" + unsafe { core::mem::transmute(4usize) }; // 4 is the code for "sol_memmove_" syscall(dest, src, n) } pub(crate) fn sol_memcmp_(dest: *const u8, src: *const u8, n: u64, result: *mut i32) { let syscall: extern "C" fn(*const u8, *const u8, u64, *mut i32) = - unsafe { core::mem::transmute(1608310321u64) }; // murmur32 hash of "sol_memcmp_" + unsafe { core::mem::transmute(6usize) }; // 6 is the code for "sol_memcmp_" syscall(dest, src, n, result) } pub(crate) fn sol_memset_(dest: *mut u8, c: u8, n: u64) { - let syscall: extern "C" fn(*mut u8, u8, u64) = - unsafe { core::mem::transmute(930151202u64) }; // murmur32 hash of "sol_memset_" + let syscall: extern "C" fn(*mut u8, u8, u64) = unsafe { core::mem::transmute(5usize) }; // 5 is the code for "sol_memset_" syscall(dest, c, n) } }