Build application at 0x0 in release mode.
This commit is contained in:
parent
63aaa9d0a1
commit
4b01ff7cc4
4 changed files with 3 additions and 40 deletions
|
@ -11,7 +11,6 @@ mod lang_items;
|
|||
#[no_mangle]
|
||||
#[link_section = ".text.entry"]
|
||||
pub extern "C" fn _start() -> ! {
|
||||
clear_bss();
|
||||
syscall::sys_exit(main());
|
||||
panic!("unreachable after sys_exit!");
|
||||
}
|
||||
|
@ -22,14 +21,5 @@ fn main() -> i32 {
|
|||
panic!("Cannot find main!");
|
||||
}
|
||||
|
||||
fn clear_bss() {
|
||||
extern "C" {
|
||||
fn start_bss();
|
||||
fn end_bss();
|
||||
}
|
||||
(start_bss as usize..end_bss as usize).for_each(|addr| {
|
||||
unsafe { (addr as *mut u8).write_volatile(0); }
|
||||
});
|
||||
}
|
||||
|
||||
pub use syscall::*;
|
|
@ -2,7 +2,7 @@
|
|||
OUTPUT_ARCH(riscv)
|
||||
ENTRY(_start)
|
||||
|
||||
BASE_ADDRESS = 0x80100000;
|
||||
BASE_ADDRESS = 0x0;
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
|
@ -18,9 +18,7 @@ SECTIONS
|
|||
*(.data .data.*)
|
||||
}
|
||||
.bss : {
|
||||
start_bss = .;
|
||||
*(.bss .bss.*)
|
||||
end_bss = .;
|
||||
}
|
||||
/DISCARD/ : {
|
||||
*(.eh_frame)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue