From 6bfb18962ba4f3317a7944a4ed6f45f468690a3e Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Fri, 5 Dec 2025 17:26:55 -0500 Subject: Use session scoped logger instance for unhandled relocation information Ran into this when running over certain object files on ppc, we can do it for all of them though. --- arch/arm64/arch_arm64.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'arch/arm64/arch_arm64.cpp') diff --git a/arch/arm64/arch_arm64.cpp b/arch/arm64/arch_arm64.cpp index 15845559..4dc59f86 100644 --- a/arch/arm64/arch_arm64.cpp +++ b/arch/arm64/arch_arm64.cpp @@ -2843,9 +2843,8 @@ class Arm64MachoRelocationHandler : public RelocationHandler virtual bool GetRelocationInfo( Ref view, Ref arch, vector& result) override { - (void)view; (void)arch; - + Ref logger = view->CreateLogger("Arm64MachoReloc"); set unsupportedRelocations; for (size_t i = 0; i < result.size(); i++) { @@ -2897,7 +2896,7 @@ class Arm64MachoRelocationHandler : public RelocationHandler } for (auto& relocType : unsupportedRelocations) - LogWarn("Unsupported relocation: %s (%x)", GetRelocationString(relocType), relocType); + logger->LogWarn("Unsupported relocation: %s (%x)", GetRelocationString(relocType), relocType); return true; } }; @@ -3159,9 +3158,9 @@ class Arm64ElfRelocationHandler : public RelocationHandler virtual bool GetRelocationInfo(Ref view, Ref arch, vector& result) override { - (void)view; (void)arch; (void)result; + Ref logger = view->CreateLogger("Arm64ElfReloc"); set relocTypes; for (auto& reloc : result) { @@ -3253,7 +3252,7 @@ class Arm64ElfRelocationHandler : public RelocationHandler } } for (auto& reloc : relocTypes) - LogWarn("Unsupported ELF relocation type: %s", GetRelocationString((ElfArm64RelocationType)reloc)); + logger->LogWarn("Unsupported ELF relocation type: %s", GetRelocationString((ElfArm64RelocationType)reloc)); return true; } @@ -3282,8 +3281,8 @@ class Arm64PeRelocationHandler : public RelocationHandler virtual bool GetRelocationInfo( Ref view, Ref arch, vector& result) override { - (void)view; (void)arch; + Ref logger = view->CreateLogger("Arm64PeReloc"); set relocTypes; for (auto& reloc : result) { @@ -3291,7 +3290,7 @@ class Arm64PeRelocationHandler : public RelocationHandler relocTypes.insert(reloc.nativeType); } for (auto& reloc : relocTypes) - LogWarn( + logger->LogWarn( "Unsupported PE relocation type: %s", GetRelocationString((PeArm64RelocationType)reloc)); return false; } @@ -3407,8 +3406,8 @@ public: virtual bool GetRelocationInfo(Ref view, Ref arch, vector& result) override { - (void)view; (void)arch; + Ref logger = view->CreateLogger("Arm64CoffReloc"); set relocTypes; for (auto& reloc : result) { @@ -3477,7 +3476,7 @@ public: } } for (auto& reloc : relocTypes) - LogWarn("Unsupported PE relocation type: %s", GetRelocationString((PeArm64RelocationType)reloc)); + logger->LogWarn("Unsupported PE relocation type: %s", GetRelocationString((PeArm64RelocationType)reloc)); return false; } }; -- cgit v1.3.1