diff --git a/src/arch/aarch64/link.ld b/src/arch/aarch64/link.ld index 85b8635b..546787bb 100644 --- a/src/arch/aarch64/link.ld +++ b/src/arch/aarch64/link.ld @@ -36,10 +36,8 @@ SECTIONS *(.data.*) } :segment_rw .bss : ALIGN(8) { - bss_start = .; *(.bss) *(.bss.*) - bss_end = .; } :segment_rw . = ALIGN(4K); /* Align to page boundary */ /*********************************************************************************************** diff --git a/src/arch/x86_64/link.ld b/src/arch/x86_64/link.ld index 61ba0b39..92533ca0 100644 --- a/src/arch/x86_64/link.ld +++ b/src/arch/x86_64/link.ld @@ -22,10 +22,8 @@ SECTIONS *(.data.*) } .bss ALIGN(4096) : AT(ADDR(.bss)) { - bss_start = .; *(.bss) *(.bss.*) } - bss_end = .; kernel_end = .; } diff --git a/src/arch/x86_64/link_fc.ld b/src/arch/x86_64/link_fc.ld index 52ec610d..8faf4451 100644 --- a/src/arch/x86_64/link_fc.ld +++ b/src/arch/x86_64/link_fc.ld @@ -21,10 +21,8 @@ SECTIONS *(.data.*) } .bss ALIGN(4096) : AT(ADDR(.bss)) { - bss_start = .; *(.bss) *(.bss.*) } - bss_end = .; kernel_end = .; } diff --git a/src/none.rs b/src/none.rs index ec1c8161..1b5e8cf4 100644 --- a/src/none.rs +++ b/src/none.rs @@ -1,6 +1,5 @@ use core::fmt::Write; use core::mem::MaybeUninit; -use core::ptr::addr_of_mut; use core::slice; use hermit_entry::elf::KernelObject; @@ -17,7 +16,6 @@ extern "C" { /// (called from entry.asm or entry.rs) #[no_mangle] unsafe extern "C" fn loader_main() -> ! { - init_bss(); arch::message_output_init(); crate::log::init(); @@ -38,19 +36,6 @@ unsafe extern "C" fn loader_main() -> ! { arch::boot_kernel(kernel_info) } -unsafe fn init_bss() { - extern "C" { - static mut bss_start: MaybeUninit; - static mut bss_end: MaybeUninit; - } - - let start_ptr = addr_of_mut!(bss_start); - let end_ptr = addr_of_mut!(bss_end); - let len = end_ptr.offset_from(start_ptr).try_into().unwrap(); - let slice = slice::from_raw_parts_mut(start_ptr, len); - slice.fill(MaybeUninit::new(0)); -} - #[panic_handler] fn panic(info: &core::panic::PanicInfo<'_>) -> ! { // We can't use `println!` or related macros, because `_print` unwraps a result and might panic again