Skip to content

Commit 6365452

Browse files
committed
PPC: Calculate pooled relocations
Reimplements encounter#140 The relocations are now generated when the object is first read in `parse`, right after the real relocations are read. `resolve_relocation` was changed to take `obj.symbols` instead of `obj` as an argument, because `obj` itself doesn't exist yet at the time the relocations are being read.
1 parent 1cdfa1e commit 6365452

File tree

6 files changed

+299
-275
lines changed

6 files changed

+299
-275
lines changed

objdiff-core/src/arch/mod.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ use crate::{
1010
DiffObjConfig,
1111
},
1212
obj::{
13-
InstructionArg, Object, ParsedInstruction, RelocationFlags, ResolvedInstructionRef,
14-
ScannedInstruction, SymbolFlagSet, SymbolKind,
13+
InstructionArg, Object, ParsedInstruction, Relocation, RelocationFlags,
14+
ResolvedInstructionRef, ScannedInstruction, Symbol, SymbolFlagSet, SymbolKind,
1515
},
1616
util::ReallySigned,
1717
};
@@ -212,6 +212,17 @@ pub trait Arch: Send + Sync + Debug {
212212
cb: &mut dyn FnMut(InstructionPart) -> Result<()>,
213213
) -> Result<()>;
214214

215+
/// Generate a list of fake relocations from the given code that represent pooled data accesses.
216+
fn generate_pooled_relocations(
217+
&self,
218+
_address: u64,
219+
_code: &[u8],
220+
_relocations: &[Relocation],
221+
_symbols: &[Symbol],
222+
) -> Vec<Relocation> {
223+
vec![]
224+
}
225+
215226
fn implcit_addend(
216227
&self,
217228
file: &object::File<'_>,

0 commit comments

Comments
 (0)