Skip to content

Commit 9f37d99

Browse files
committed
[WIP] OMF object support
1 parent 90e81fa commit 9f37d99

File tree

6 files changed

+7
-3
lines changed

6 files changed

+7
-3
lines changed

Cargo.lock

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

objdiff-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ itertools = { version = "0.14", default-features = false, features = ["use_alloc
132132
log = { version = "0.4", default-features = false, optional = true }
133133
memmap2 = { version = "0.9", optional = true }
134134
num-traits = { version = "0.2", default-features = false, optional = true }
135-
object = { version = "0.37", default-features = false, features = ["read_core", "elf", "coff"] }
135+
object = { git = "https://github.com/encounter/object", branch = "omf", default-features = false, features = ["read_core", "elf", "coff", "omf"] }
136136
pbjson = { version = "0.8", default-features = false, optional = true }
137137
prost = { version = "0.14", default-features = false, features = ["derive"], optional = true }
138138
regex = { version = "1.11", default-features = false, features = [], optional = true }

objdiff-core/src/arch/ppc/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ impl Arch for ArchPpc {
332332
pe::IMAGE_REL_PPC_PAIR => Some("IMAGE_REL_PPC_PAIR"),
333333
_ => None,
334334
},
335+
_ => None,
335336
}
336337
}
337338

objdiff-core/src/arch/x86.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ impl ArchX86 {
7272
elf::R_386_16 => Some(2),
7373
_ => None,
7474
},
75+
RelocationFlags::Omf() => Some(4), // TODO
7576
},
7677
Architecture::X86_64 => match flags {
7778
RelocationFlags::Coff(typ) => match typ {
@@ -84,6 +85,7 @@ impl ArchX86 {
8485
elf::R_X86_64_64 => Some(8),
8586
_ => None,
8687
},
88+
RelocationFlags::Omf() => None, // TODO
8789
},
8890
}
8991
}

objdiff-core/src/obj/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ pub struct Relocation {
370370
pub enum RelocationFlags {
371371
Elf(u32),
372372
Coff(u16),
373+
Omf(/* TODO */),
373374
}
374375

375376
#[derive(Debug, Copy, Clone)]

objdiff-core/src/obj/read.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ fn map_section_relocations(
510510
let flags = match reloc.flags() {
511511
object::RelocationFlags::Elf { r_type } => RelocationFlags::Elf(r_type),
512512
object::RelocationFlags::Coff { typ } => RelocationFlags::Coff(typ),
513+
object::RelocationFlags::Omf { .. } => RelocationFlags::Omf(/* TODO */),
513514
flags => bail!("Unhandled relocation flags: {:?}", flags),
514515
};
515516
let target_symbol = match symbol_indices.get(symbol_index.0).copied() {

0 commit comments

Comments
 (0)