Skip to content

Commit 61c1933

Browse files
committed
Correct docs for __pre_init
Signed-off-by: Gabriel Smith <[email protected]>
1 parent 5480888 commit 61c1933

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cortex-m-rt/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,10 @@
238238
//! `__EXCEPTIONS` in the `.vector_table` section.
239239
//!
240240
//! - `__pre_init`. This is a function to be run before RAM is initialized. It defaults pointing at
241-
//! `0` and if not changed to point to another address, usually by calling the `pre_init!` macro,
242-
//! the `_pre_init` function is skipped.
241+
//! `1` and if not changed to point to another address, usually by calling the `pre_init!` macro,
242+
//! the `_pre_init` function is skipped. The function cannot default to `0` as the compiler
243+
//! optimizes out the check for `0` under the assumption that a function pointer cannot point to
244+
//! `0`.
243245
//!
244246
//! If you override any exception handler you'll find it as an unmangled symbol, e.g. `SysTick` or
245247
//! `SVCall`, in the output of `objdump`,

0 commit comments

Comments
 (0)