diff --git a/Cargo.lock b/Cargo.lock index e92a7c6d7a..885b28f1f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,6 +18,7 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" name = "bootstrap" version = "0.0.0" dependencies = [ + "hashbrown", "linked_list_allocator", "redox-exec", "redox-initfs", @@ -35,6 +36,12 @@ dependencies = [ "scroll", ] +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + [[package]] name = "linked_list_allocator" version = "0.10.5" diff --git a/Cargo.toml b/Cargo.toml index cfb3538b4c..feb816d5e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ name = "bootstrap" crate-type = ["staticlib"] [dependencies] +hashbrown = { version = "0.14", default-features = false, features = ["inline-more"] } linked_list_allocator = "0.10" redox-initfs = { git = "https://gitlab.redox-os.org/redox-os/redox-initfs.git", features = ["kernel"], default-features = false } redox-exec = { git = "https://gitlab.redox-os.org/redox-os/relibc.git" } @@ -17,6 +18,7 @@ redox_syscall = "0.4" [profile.release] panic = "abort" +lto = "fat" [profile.dev] panic = "abort" diff --git a/src/aarch64.ld b/src/aarch64.ld index a3c3b3b65c..3abb18108d 100644 --- a/src/aarch64.ld +++ b/src/aarch64.ld @@ -1,4 +1,4 @@ -ENTRY(ustart) +ENTRY(_start) OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64") SECTIONS { @@ -34,7 +34,6 @@ SECTIONS { . = ALIGN(4096); __bss_end = .; } - __end = .; /DISCARD/ : { *(.comment*) diff --git a/src/aarch64.rs b/src/aarch64.rs index 964c2c46e7..f94d41d37f 100644 --- a/src/aarch64.rs +++ b/src/aarch64.rs @@ -20,8 +20,8 @@ static MAP: Map = Map { core::arch::global_asm!( " - .globl ustart - ustart: + .globl _start + _start: // Setup a stack. ldr x8, ={number} ldr x0, ={fd} diff --git a/src/i686.ld b/src/i686.ld index 90bd467067..e07ab63713 100644 --- a/src/i686.ld +++ b/src/i686.ld @@ -1,4 +1,4 @@ -ENTRY(ustart) +ENTRY(_start) OUTPUT_FORMAT(elf32-i386) SECTIONS { @@ -34,7 +34,6 @@ SECTIONS { . = ALIGN(4096); __bss_end = .; } - __end = .; /DISCARD/ : { *(.comment*) diff --git a/src/i686.rs b/src/i686.rs index 2a0beac59b..f07beb4397 100644 --- a/src/i686.rs +++ b/src/i686.rs @@ -15,9 +15,9 @@ static MAP: Map = Map { }; core::arch::global_asm!( -" - .globl ustart - ustart: + " + .globl _start + _start: # Setup a stack. mov eax, {number} mov ebx, {fd} diff --git a/src/initfs.rs b/src/initfs.rs index 7303134594..e4ed8d4951 100644 --- a/src/initfs.rs +++ b/src/initfs.rs @@ -1,9 +1,11 @@ use core::convert::TryFrom; +#[allow(deprecated)] +use core::hash::{BuildHasherDefault, SipHasher}; use core::str; -use alloc::collections::BTreeMap; use alloc::string::String; +use hashbrown::HashMap; use redox_initfs::{InitFs, InodeStruct, Inode, InodeDir, InodeKind, types::Timespec}; use syscall::data::{Packet, Stat}; @@ -19,14 +21,15 @@ struct Handle { filename: String, } pub struct InitFsScheme { - handles: BTreeMap, + #[allow(deprecated)] + handles: HashMap>, next_id: usize, fs: InitFs<'static>, } impl InitFsScheme { pub fn new(bytes: &'static [u8]) -> Self { Self { - handles: BTreeMap::new(), + handles: HashMap::default(), next_id: 0, fs: InitFs::new(bytes).expect("failed to parse initfs"), } diff --git a/src/start.rs b/src/start.rs index c05980865c..920f285645 100644 --- a/src/start.rs +++ b/src/start.rs @@ -11,8 +11,6 @@ mod offsets { // data+bss (RW-) static __data_start: u8; static __bss_end: u8; - - static __end: u8; } pub fn text() -> (usize, usize) { unsafe { (&__text_start as *const u8 as usize, &__text_end as *const u8 as usize) } diff --git a/src/x86_64.ld b/src/x86_64.ld index c8c89bc868..232fbf72fc 100644 --- a/src/x86_64.ld +++ b/src/x86_64.ld @@ -1,4 +1,4 @@ -ENTRY(ustart) +ENTRY(_start) OUTPUT_FORMAT(elf64-x86-64) SECTIONS { @@ -34,7 +34,6 @@ SECTIONS { . = ALIGN(4096); __bss_end = .; } - __end = .; /DISCARD/ : { *(.comment*) diff --git a/src/x86_64.rs b/src/x86_64.rs index b1e7343e53..c4c051ca0a 100644 --- a/src/x86_64.rs +++ b/src/x86_64.rs @@ -17,8 +17,8 @@ static MAP: Map = Map { core::arch::global_asm!( " - .globl ustart - ustart: + .globl _start + _start: # Setup a stack. mov rax, {number} mov rdi, {fd}