Skip to content

Commit 94eb63b

Browse files
authored
Add nostack to the abort function asm sequences. (#134)
CPU abort instructions do not use stack, so we can use `nostack`.
1 parent 06a8714 commit 94eb63b

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/arch/aarch64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub(super) unsafe extern "C" fn _start() -> ! {
4747
#[cfg(relocation_model = "pic")]
4848
pub(super) fn abort() -> ! {
4949
unsafe {
50-
asm!("brk #0x1", options(noreturn));
50+
asm!("brk #0x1", options(noreturn, nostack));
5151
}
5252
}
5353

src/arch/arm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub(super) unsafe extern "C" fn _start() -> ! {
4747
#[cfg(relocation_model = "pic")]
4848
pub(super) fn abort() -> ! {
4949
unsafe {
50-
asm!(".inst 0xe7ffdefe", options(noreturn));
50+
asm!(".inst 0xe7ffdefe", options(noreturn, nostack));
5151
}
5252
}
5353

src/arch/riscv64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub(super) unsafe extern "C" fn _start() -> ! {
4747
#[cfg(relocation_model = "pic")]
4848
pub(super) fn abort() -> ! {
4949
unsafe {
50-
asm!("unimp", options(noreturn));
50+
asm!("unimp", options(noreturn, nostack));
5151
}
5252
}
5353

src/arch/x86.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub(super) unsafe extern "C" fn _start() -> ! {
5252
#[cfg(relocation_model = "pic")]
5353
pub(super) fn abort() -> ! {
5454
unsafe {
55-
asm!("ud2", options(noreturn));
55+
asm!("ud2", options(noreturn, nostack));
5656
}
5757
}
5858

src/arch/x86_64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub(super) unsafe extern "C" fn _start() -> ! {
4747
#[cfg(relocation_model = "pic")]
4848
pub(super) fn abort() -> ! {
4949
unsafe {
50-
asm!("ud2", options(noreturn));
50+
asm!("ud2", options(noreturn, nostack));
5151
}
5252
}
5353

0 commit comments

Comments
 (0)