Add x86 _start

This commit is contained in:
Jeremy Soller
2022-08-20 20:43:41 -06:00
parent 619245024a
commit c1b20cdeab
+27 -7
View File
@@ -5,6 +5,33 @@
use core::arch::global_asm;
#[cfg(target_arch = "aarch64")]
global_asm!("
.globl _start
_start:
mov x0, sp
bl relibc_start
");
#[cfg(target_arch = "x86")]
global_asm!("
.globl _start
.type _start, @function
_start:
sub esp, 8
mov DWORD PTR [esp], 0x00001F80
# ldmxcsr [esp]
mov WORD PTR [esp], 0x031F
fldcw [esp]
add esp, 8
push esp
call relibc_start
.size _start, . - _start
");
#[cfg(target_arch = "x86_64")]
global_asm!("
.globl _start
@@ -25,13 +52,6 @@ _start:
call relibc_start
.size _start, . - _start
");
#[cfg(target_arch = "aarch64")]
global_asm!("
.globl _start
_start:
mov x0, sp
bl relibc_start
");
#[linkage = "weak"]
#[no_mangle]