Skip to content
Permalink
Browse files

Minimized main more.

This is actually too minimal; as soon as we link in any code that uses
`panic!` we'll get link failures.  But better to start here and build up
than to inherit a bunch of stuff we don't actually need.
  • Loading branch information...
cbiffle committed Sep 17, 2016
1 parent 3f6898b commit b0054884e6e31b1d11e9034c653ba1e60ecbee46
Showing with 10 additions and 16 deletions.
  1. +5 −5 layout.ld
  2. +5 −11 src/main.rs
@@ -12,11 +12,11 @@ MEMORY

__STACK_BASE = ORIGIN(ram_c) + LENGTH(ram_c);

__aeabi_unwind_cpp_pr0 = abort;
__aeabi_unwind_cpp_pr1 = abort;
__aeabi_unwind_cpp_pr2 = abort;
__exidx_start = abort;
__exidx_end = abort;
/*__aeabi_unwind_cpp_pr0 = abort;*/
/*__aeabi_unwind_cpp_pr1 = abort;*/
/*__aeabi_unwind_cpp_pr2 = abort;*/
/*__exidx_start = abort;*/
/*__exidx_end = abort;*/

/*__aeabi_memclr4 = __aeabi_memclr;*/

@@ -1,20 +1,15 @@
#![no_std]
#![feature(lang_items,start)]
#![no_std]
#![no_main]

/******************************************************************************/

// Items required by some part of core or the runtime.

#[lang = "panic_fmt"]
extern fn panic_fmt() -> ! {loop {}}

#[no_mangle]
pub extern "C" fn abort() -> ! { loop {} }

/// This is included to mollify the compiler, but is not actually used and
/// doesn't wind up getting linked into the output.
#[start]
fn _start(_: isize, _: *const *const u8) -> isize {
pub extern fn panic_fmt(_msg: core::fmt::Arguments,
_file: &'static str,
_line: u32) -> ! {
loop {}
}

@@ -64,7 +59,6 @@ unsafe impl Sync for ExceptionTable {}

// Application.

#[no_mangle]
pub unsafe extern fn reset_handler() -> ! {
loop {}
}

0 comments on commit b005488

Please sign in to comment.
You can’t perform that action at this time.