Skip to content

Commit 644d476

Browse files
authored
Preliminary SuperH support (#186)
* Preliminary SuperH support * fixes * clippy * clippy
1 parent b40fae5 commit 644d476

File tree

5 files changed

+2026
-3
lines changed

5 files changed

+2026
-3
lines changed

Cargo.lock

+10-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

objdiff-core/Cargo.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ all = [
2727
"mips",
2828
"ppc",
2929
"x86",
30+
"superh"
3031
]
3132
# Implicit, used to check if any arch is enabled
3233
any-arch = [
@@ -111,6 +112,9 @@ arm64 = [
111112
"dep:yaxpeax-arch",
112113
"dep:yaxpeax-arm",
113114
]
115+
superh = [
116+
"any-arch",
117+
]
114118

115119
[package.metadata.docs.rs]
116120
features = ["all"]
@@ -123,7 +127,7 @@ itertools = { version = "0.14", default-features = false, features = ["use_alloc
123127
log = { version = "0.4", default-features = false, optional = true }
124128
memmap2 = { version = "0.9", optional = true }
125129
num-traits = { version = "0.2", default-features = false, optional = true }
126-
object = { version = "0.36", default-features = false, features = ["read_core", "elf", "pe"] }
130+
object = { git = "https://github.com/gimli-rs/object", rev = "a74579249e21ab8fcd3a86be588de336f18297cb", default-features = false, features = ["read_core", "elf", "pe"] }
127131
pbjson = { version = "0.7", default-features = false, optional = true }
128132
prost = { version = "0.13", default-features = false, features = ["prost-derive"], optional = true }
129133
regex = { version = "1.11", default-features = false, features = [], optional = true }

objdiff-core/src/arch/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ pub mod arm64;
2525
pub mod mips;
2626
#[cfg(feature = "ppc")]
2727
pub mod ppc;
28+
#[cfg(feature = "superh")]
29+
pub mod superh;
2830
#[cfg(feature = "x86")]
2931
pub mod x86;
3032

@@ -313,6 +315,8 @@ pub fn new_arch(object: &object::File) -> Result<Box<dyn Arch>> {
313315
object::Architecture::Arm => Box::new(arm::ArchArm::new(object)?),
314316
#[cfg(feature = "arm64")]
315317
object::Architecture::Aarch64 => Box::new(arm64::ArchArm64::new(object)?),
318+
#[cfg(feature = "superh")]
319+
object::Architecture::SuperH => Box::new(superh::ArchSuperH::new(object)?),
316320
arch => bail!("Unsupported architecture: {arch:?}"),
317321
})
318322
}

0 commit comments

Comments
 (0)