Resolve TODOs about linker symbols

This commit is contained in:
jmaargh 2023-10-16 22:50:53 +01:00
parent 7a1f554b72
commit 4a13d52faf

View file

@ -129,8 +129,8 @@ fn iwram_data_end() -> usize {
static __iwram_end: usize; static __iwram_end: usize;
} }
// TODO: This seems completely wrong, but without the &, rust generates // Symbols defined in the linker have an address *but no data or value*.
// a double dereference :/. Maybe a bug in nightly? // As strange as this looks, they are only useful to take the address of.
(unsafe { &__iwram_end }) as *const _ as usize (unsafe { &__iwram_end }) as *const _ as usize
} }
@ -139,8 +139,8 @@ fn data_end() -> usize {
static __ewram_data_end: usize; static __ewram_data_end: usize;
} }
// TODO: This seems completely wrong, but without the &, rust generates // Symbols defined in the linker have an address *but no data or value*.
// a double dereference :/. Maybe a bug in nightly? // As strange as this looks, they are only useful to take the address of.
(unsafe { &__ewram_data_end }) as *const _ as usize (unsafe { &__ewram_data_end }) as *const _ as usize
} }