File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed
compiler/rustc_target/src/spec/targets
library/std/src/sys/pal/vexos Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,7 @@ MEMORY {
1111}
1212
1313__stack_length = 0x400000 ;
14- /*
15- It's currently unclear why subtracting anything is necessary, but it fixes memory permission errors.
16- 0x100 is an arbitrary number that works.
17- */
18- __heap_end = __user_ram_end - __stack_length - 0x100 ;
14+ __heap_end = __user_ram_end - __stack_length;
1915
2016SECTIONS {
2117 .text : {
@@ -55,4 +51,4 @@ SECTIONS {
5551 /DISCARD/ : {
5652 *(.ARM .exidx )
5753 }
58- }
54+ }
Original file line number Diff line number Diff line change @@ -18,14 +18,24 @@ pub mod stdio;
1818pub mod thread;
1919pub mod time;
2020
21- use crate :: arch:: asm ;
21+ use crate :: arch:: global_asm ;
2222use crate :: hash:: { DefaultHasher , Hasher } ;
2323use crate :: ptr:: { self , addr_of_mut} ;
2424use crate :: time:: { Duration , Instant } ;
2525
26+ global_asm ! (
27+ r#"
28+ .section .boot, "ax"
29+ .global _boot
30+
31+ _boot:
32+ ldr sp, =__stack_top @ Set up the user stack.
33+ b _start @ Jump to the Rust entrypoint.
34+ "#
35+ ) ;
36+
2637#[ cfg( not( test) ) ]
2738#[ no_mangle]
28- #[ link_section = ".boot" ]
2939pub unsafe extern "C" fn _start ( ) -> ! {
3040 extern "C" {
3141 static mut __bss_start: u8 ;
@@ -34,9 +44,6 @@ pub unsafe extern "C" fn _start() -> ! {
3444 fn main ( ) -> i32 ;
3545 }
3646
37- // Setup the stack
38- asm ! ( "ldr sp, =__stack_top" , options( nostack) ) ;
39-
4047 // VEXos doesn't explicitly clean out .bss.
4148 ptr:: slice_from_raw_parts_mut (
4249 addr_of_mut ! ( __bss_start) ,
You can’t perform that action at this time.
0 commit comments