Arch-independent demangling and add gnuv2_demangle for old g++ projects (#262)

This commit is contained in:
Anghelo Carvajal
2025-09-22 20:24:29 -03:00
committed by GitHub
parent e2c70342c9
commit fe8e7029f6
14 changed files with 132 additions and 79 deletions

View File

@@ -1,4 +1,4 @@
use alloc::{collections::BTreeMap, format, string::String, vec, vec::Vec};
use alloc::{collections::BTreeMap, format, vec, vec::Vec};
use anyhow::Result;
use object::elf;
@@ -132,12 +132,6 @@ impl Arch for ArchSuperH {
Ok(())
}
fn demangle(&self, name: &str) -> Option<String> {
cpp_demangle::Symbol::new(name)
.ok()
.and_then(|s| s.demangle(&cpp_demangle::DemangleOptions::default()).ok())
}
fn reloc_name(&self, flags: RelocationFlags) -> Option<&'static str> {
match flags {
RelocationFlags::Elf(r_type) => match r_type {