01: Remove LTO to fix linking bug.

For some reason, LTO caused "_start" to start at 0x00080020
instead of 0x00080000.
pull/99/head
Andre Richter 3 years ago
parent 18c7259c60
commit 53c1163c51
No known key found for this signature in database
GPG Key ID: 2116C1AB102F615E

@ -4,9 +4,6 @@ version = "0.1.0"
authors = ["Andre Richter <andre.o.richter@gmail.com>"]
edition = "2018"
[profile.release]
lto = true
# The features section is used to select the target board.
[features]
default = []

@ -6,21 +6,3 @@
// Assembly counterpart to this file.
global_asm!(include_str!("cpu.S"));
//--------------------------------------------------------------------------------------------------
// Public Code
//--------------------------------------------------------------------------------------------------
/// Pause execution on the core.
#[inline(always)]
pub fn wait_forever() -> ! {
unsafe {
loop {
#[rustfmt::skip]
asm!(
"wfe",
options(nomem, nostack, preserves_flags)
);
}
}
}

@ -4,10 +4,10 @@
//! A panic handler that infinitely waits.
use crate::cpu;
// use crate::cpu;
use core::panic::PanicInfo;
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
cpu::wait_forever()
unimplemented!()
}

@ -23,6 +23,46 @@
## Diff to previous
```diff
diff -uNr 01_wait_forever/Cargo.toml 02_runtime_init/Cargo.toml
--- 01_wait_forever/Cargo.toml
+++ 02_runtime_init/Cargo.toml
@@ -4,6 +4,9 @@
authors = ["Andre Richter <andre.o.richter@gmail.com>"]
edition = "2018"
+[profile.release]
+lto = true
+
# The features section is used to select the target board.
[features]
default = []
diff -uNr 01_wait_forever/src/_arch/aarch64/cpu.rs 02_runtime_init/src/_arch/aarch64/cpu.rs
--- 01_wait_forever/src/_arch/aarch64/cpu.rs
+++ 02_runtime_init/src/_arch/aarch64/cpu.rs
@@ -6,3 +6,21 @@
// Assembly counterpart to this file.
global_asm!(include_str!("cpu.S"));
+
+//--------------------------------------------------------------------------------------------------
+// Public Code
+//--------------------------------------------------------------------------------------------------
+
+/// Pause execution on the core.
+#[inline(always)]
+pub fn wait_forever() -> ! {
+ unsafe {
+ loop {
+ #[rustfmt::skip]
+ asm!(
+ "wfe",
+ options(nomem, nostack, preserves_flags)
+ );
+ }
+ }
+}
diff -uNr 01_wait_forever/src/_arch/aarch64/cpu.S 02_runtime_init/src/_arch/aarch64/cpu.S
--- 01_wait_forever/src/_arch/aarch64/cpu.S
+++ 02_runtime_init/src/_arch/aarch64/cpu.S
@ -191,6 +231,23 @@ diff -uNr 01_wait_forever/src/memory.rs 02_runtime_init/src/memory.rs
+ }
+}
diff -uNr 01_wait_forever/src/panic_wait.rs 02_runtime_init/src/panic_wait.rs
--- 01_wait_forever/src/panic_wait.rs
+++ 02_runtime_init/src/panic_wait.rs
@@ -4,10 +4,10 @@
//! A panic handler that infinitely waits.
-// use crate::cpu;
+use crate::cpu;
use core::panic::PanicInfo;
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
- unimplemented!()
+ cpu::wait_forever()
}
diff -uNr 01_wait_forever/src/runtime_init.rs 02_runtime_init/src/runtime_init.rs
--- 01_wait_forever/src/runtime_init.rs
+++ 02_runtime_init/src/runtime_init.rs

Loading…
Cancel
Save