diff --git a/crates/linker/src/generate_dylib.rs b/crates/linker/src/generate_dylib.rs index 3feb1f2a99..653d690dbb 100644 --- a/crates/linker/src/generate_dylib.rs +++ b/crates/linker/src/generate_dylib.rs @@ -51,11 +51,7 @@ struct DynamicSymbol { gnu_hash: Option, } -#[derive(Debug)] -struct Section { - in_index: usize, - section: SectionHeader64, -} +type Section = SectionHeader64; struct Sections { hash: Section, @@ -93,11 +89,11 @@ impl Sections { for (i, out_offset) in offsets.iter_mut().enumerate().take(5) { // symtab, strtab and shstrtab is ignored because they are not ALLOC let in_section = match i { - 0 => sections.hash.section, - 1 => sections.gnu_hash.section, - 2 => sections.dynsym.section, - 3 => sections.dynstr.section, - 4 => sections.dynamic.section, + 0 => sections.hash, + 1 => sections.gnu_hash, + 2 => sections.dynsym, + 3 => sections.dynstr, + 4 => sections.dynamic, _ => unreachable!(), }; @@ -167,14 +163,10 @@ fn copy_file(in_data: &[u8], custom_names: &[String]) -> Result, Box