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 {
11
11
}
12
12
13
13
__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;
19
15
20
16
SECTIONS {
21
17
.text : {
@@ -55,4 +51,4 @@ SECTIONS {
55
51
/DISCARD/ : {
56
52
*(.ARM.exidx)
57
53
}
58
- }
54
+ }
Original file line number Diff line number Diff line change @@ -18,14 +18,24 @@ pub mod stdio;
18
18
pub mod thread;
19
19
pub mod time;
20
20
21
- use crate :: arch:: asm ;
21
+ use crate :: arch:: global_asm ;
22
22
use crate :: hash:: { DefaultHasher , Hasher } ;
23
23
use crate :: ptr:: { self , addr_of_mut} ;
24
24
use crate :: time:: { Duration , Instant } ;
25
25
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
+
26
37
#[ cfg( not( test) ) ]
27
38
#[ no_mangle]
28
- #[ link_section = ".boot" ]
29
39
pub unsafe extern "C" fn _start ( ) -> ! {
30
40
extern "C" {
31
41
static mut __bss_start: u8 ;
@@ -34,9 +44,6 @@ pub unsafe extern "C" fn _start() -> ! {
34
44
fn main ( ) -> i32 ;
35
45
}
36
46
37
- // Setup the stack
38
- asm ! ( "ldr sp, =__stack_top" , options( nostack) ) ;
39
-
40
47
// VEXos doesn't explicitly clean out .bss.
41
48
ptr:: slice_from_raw_parts_mut (
42
49
addr_of_mut ! ( __bss_start) ,
You can’t perform that action at this time.
0 commit comments