File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -356,6 +356,8 @@ impl core::fmt::Write for Ctx {
356356/// (as it doesn't know where they are).
357357#[ cfg( all( target_os = "none" , not( feature = "lib-mode" ) ) ) ]
358358unsafe fn start_up_init ( ) {
359+ use core:: ptr:: { addr_of, addr_of_mut} ;
360+
359361 extern "C" {
360362
361363 // These symbols come from `link.x`
@@ -367,8 +369,12 @@ unsafe fn start_up_init() {
367369 static __sidata: u32 ;
368370 }
369371
370- r0:: zero_bss ( & mut __sbss, & mut __ebss) ;
371- r0:: init_data ( & mut __sdata, & mut __edata, & __sidata) ;
372+ r0:: zero_bss ( addr_of_mut ! ( __sbss) , addr_of_mut ! ( __ebss) ) ;
373+ r0:: init_data (
374+ addr_of_mut ! ( __sdata) ,
375+ addr_of_mut ! ( __edata) ,
376+ addr_of ! ( __sidata) ,
377+ ) ;
372378}
373379
374380#[ cfg( any( not( target_os = "none" ) , feature = "lib-mode" ) ) ]
Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ impl TransientProgramArea {
181181 // points to, as the linker can only invent symbols pointing at
182182 // addresses; it cannot actually put values in RAM.
183183 #[ cfg( all( target_os = "none" , target_arch = "arm" ) ) ]
184- let official_tpa_start: Option < * mut u32 > = Some ( ( & mut _tpa_start) as * mut u32 ) ;
184+ let official_tpa_start: Option < * mut u32 > = Some ( core :: ptr :: addr_of_mut! ( _tpa_start) ) ;
185185
186186 #[ cfg( not( all( target_os = "none" , target_arch = "arm" ) ) ) ]
187187 let official_tpa_start: Option < * mut u32 > = None ;
You can’t perform that action at this time.
0 commit comments