From 2be84328fc0d741ca13a42d4e36e06b3eea9064f Mon Sep 17 00:00:00 2001 From: Marijn Kneppers Date: Mon, 16 Nov 2026 22:08:12 +0100 Subject: [PATCH 1/3] Allow underscore in symbol section name --- src/util/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/config.rs b/src/util/config.rs index d34cfb9f..417f600a 100644 --- a/src/util/config.rs +++ b/src/util/config.rs @@ -70,7 +70,7 @@ pub fn apply_symbols_file( pub fn parse_symbol_line(line: &str, obj: &mut ObjInfo) -> Result> { static SYMBOL_LINE: Lazy = Lazy::new(|| { Regex::new( - "^\\s*(?P[^\\s=]+)\\s*=\\s*(?:(?P
[A-Za-z0-9.]+):)?(?P[0-9A-Fa-fXx]+);(?:\\s*//\\s*(?P.*))?$", + "^\\s*(?P[^\\s=]+)\\s*=\\s*(?:(?P
[A-Za-z0-9._]+):)?(?P[0-9A-Fa-fXx]+);(?:\\s*//\\s*(?P.*))?$", ) .unwrap() }); From 229b345abd2406a447c06cef4029451cce8435a8 Mon Sep 17 00:00:00 2001 From: Marijn Kneppers Date: Mon, 16 Nov 2026 22:17:59 +0100 Subject: [PATCH 2/3] Add support for "wii_embedded" section --- src/cmd/elf2dol.rs | 2 +- src/obj/sections.rs | 2 +- src/util/asm.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd/elf2dol.rs b/src/cmd/elf2dol.rs index 7604ab13..dbbe5dc5 100644 --- a/src/cmd/elf2dol.rs +++ b/src/cmd/elf2dol.rs @@ -196,7 +196,7 @@ fn section_kind(section: &object::Section) -> SectionKind { .and_then(|name| match name { ".init" | ".text" | ".vmtext" | ".dbgtext" => Some(SectionKind::Text), ".ctors" | ".dtors" | ".data" | ".rodata" | ".sdata" | ".sdata2" | "extab" - | "extabindex" | ".BINARY" => Some(SectionKind::Data), + | "extabindex" | ".BINARY" | "wii_embedded" => Some(SectionKind::Data), ".bss" | ".sbss" | ".sbss2" => Some(SectionKind::UninitializedData), _ => None, }) diff --git a/src/obj/sections.rs b/src/obj/sections.rs index 75a7da99..2984fa7c 100644 --- a/src/obj/sections.rs +++ b/src/obj/sections.rs @@ -237,7 +237,7 @@ impl ObjSection { pub fn section_kind_for_section(section_name: &str) -> Result { Ok(match section_name { ".init" | ".text" | ".dbgtext" | ".vmtext" => ObjSectionKind::Code, - ".ctors" | ".dtors" | ".rodata" | ".sdata2" | "extab" | "extabindex" | ".BINARY" => { + ".ctors" | ".dtors" | ".rodata" | ".sdata2" | "extab" | "extabindex" | ".BINARY" | "wii_embedded" => { ObjSectionKind::ReadOnlyData } ".bss" | ".sbss" | ".sbss2" => ObjSectionKind::Bss, diff --git a/src/util/asm.rs b/src/util/asm.rs index 919dafb6..f89029cf 100644 --- a/src/util/asm.rs +++ b/src/util/asm.rs @@ -975,7 +975,7 @@ where write!(w, ", \"a\", @nobits")?; } ".ctors" | ".dtors" | ".ctors$10" | ".dtors$10" | ".dtors$15" | "extab" | "extabindex" - | ".BINARY" => { + | ".BINARY" | "wii_embedded" => { write!(w, ".section {}", section.name)?; write!(w, ", \"a\"")?; } From cf2da8538329361d710a3a4df187d38808db1524 Mon Sep 17 00:00:00 2001 From: Marijn Kneppers Date: Mon, 16 Nov 2026 23:17:52 +0100 Subject: [PATCH 3/3] Move to writeable data --- src/obj/sections.rs | 4 ++-- src/util/asm.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/obj/sections.rs b/src/obj/sections.rs index 2984fa7c..ba96aa55 100644 --- a/src/obj/sections.rs +++ b/src/obj/sections.rs @@ -237,11 +237,11 @@ impl ObjSection { pub fn section_kind_for_section(section_name: &str) -> Result { Ok(match section_name { ".init" | ".text" | ".dbgtext" | ".vmtext" => ObjSectionKind::Code, - ".ctors" | ".dtors" | ".rodata" | ".sdata2" | "extab" | "extabindex" | ".BINARY" | "wii_embedded" => { + ".ctors" | ".dtors" | ".rodata" | ".sdata2" | "extab" | "extabindex" | ".BINARY" => { ObjSectionKind::ReadOnlyData } ".bss" | ".sbss" | ".sbss2" => ObjSectionKind::Bss, - ".data" | ".sdata" => ObjSectionKind::Data, + ".data" | ".sdata" | "wii_embedded" => ObjSectionKind::Data, name => bail!("Unknown section {name}"), }) } diff --git a/src/util/asm.rs b/src/util/asm.rs index f89029cf..a4241024 100644 --- a/src/util/asm.rs +++ b/src/util/asm.rs @@ -958,7 +958,7 @@ where write!(w, ".section {}", section.name)?; write!(w, ", \"ax\"")?; } - ".data" | ".sdata" => { + ".data" | ".sdata" | "wii_embedded" => { write!(w, ".section {}", section.name)?; write!(w, ", \"wa\"")?; } @@ -975,7 +975,7 @@ where write!(w, ", \"a\", @nobits")?; } ".ctors" | ".dtors" | ".ctors$10" | ".dtors$10" | ".dtors$15" | "extab" | "extabindex" - | ".BINARY" | "wii_embedded" => { + | ".BINARY" => { write!(w, ".section {}", section.name)?; write!(w, ", \"a\"")?; }