mirror of
https://github.com/encounter/objdiff.git
synced 2025-12-19 09:55:28 +00:00
Arch-independent demangling and add gnuv2_demangle for old g++ projects (#262)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use alloc::{boxed::Box, format, string::String, vec::Vec};
|
||||
use alloc::{boxed::Box, format, vec::Vec};
|
||||
use core::cmp::Ordering;
|
||||
|
||||
use anyhow::{Context, Result, anyhow, bail};
|
||||
@@ -300,16 +300,6 @@ impl Arch for ArchX86 {
|
||||
Ok(Some(RelocationOverride { target: RelocationOverrideTarget::Keep, addend }))
|
||||
}
|
||||
|
||||
fn demangle(&self, name: &str) -> Option<String> {
|
||||
if name.starts_with('?') {
|
||||
msvc_demangler::demangle(name, msvc_demangler::DemangleFlags::llvm()).ok()
|
||||
} else {
|
||||
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 self.arch {
|
||||
Architecture::X86 => match flags {
|
||||
|
||||
Reference in New Issue
Block a user