From 6b60c13834e6abb2585b2f03241df4af94bff4c8 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Mon, 3 Jun 2024 18:03:39 -0600 Subject: [PATCH] Change REL "invalid relocation" to warning Also ensures that `block_relocations` works to remove the warning Resolves #53 --- src/analysis/tracker.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/analysis/tracker.rs b/src/analysis/tracker.rs index 10feb87..24bb321 100644 --- a/src/analysis/tracker.rs +++ b/src/analysis/tracker.rs @@ -650,6 +650,12 @@ impl Tracker { // Skip external relocations, they already exist continue; }; + if obj.blocked_relocation_sources.contains(addr) + || obj.blocked_relocation_targets.contains(target) + { + // Skip blocked relocations + continue; + } if obj.kind == ObjKind::Relocatable { // Sanity check: relocatable objects already have relocations, // did our analyzer find one that isn't real? @@ -658,8 +664,8 @@ impl Tracker { // We _do_ want to rebuild missing R_PPC_REL24 relocations && !matches!(reloc_kind, ObjRelocKind::PpcRel24) { - bail!( - "Found invalid relocation {} {:#?} (target {}) in relocatable object", + log::warn!( + "Found invalid relocation {} {:?} (target {}) in relocatable object", addr, reloc, target