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/powerpc/arch_ppc.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'arch/powerpc/arch_ppc.cpp') diff --git a/arch/powerpc/arch_ppc.cpp b/arch/powerpc/arch_ppc.cpp index a1605923..d806e0f6 100644 --- a/arch/powerpc/arch_ppc.cpp +++ b/arch/powerpc/arch_ppc.cpp @@ -2469,7 +2469,8 @@ public: virtual bool GetRelocationInfo(Ref view, Ref arch, vector& result) override { - (void)view; (void)arch; (void)result; + (void)arch; (void)result; + Ref logger = view->CreateLogger("PpcElfReloc"); set relocTypes; for (auto& reloc : result) { @@ -2526,7 +2527,7 @@ public: } } for (auto& reloc : relocTypes) - LogWarn("Unsupported ELF relocation type: %s", GetRelocationString((ElfPpcRelocationType)reloc)); + logger->LogWarn("Unsupported ELF relocation type: %s", GetRelocationString((ElfPpcRelocationType)reloc)); return true; } @@ -2555,7 +2556,8 @@ class PpcMachoRelocationHandler: public RelocationHandler public: virtual bool GetRelocationInfo(Ref view, Ref arch, vector& result) override { - (void)view; (void)arch; + (void)arch; + Ref logger = view->CreateLogger("PpcMachoReloc"); set relocTypes; for (auto& reloc : result) { @@ -2563,7 +2565,7 @@ public: relocTypes.insert(reloc.nativeType); } for (auto& reloc : relocTypes) - LogWarn("Unsupported Mach-O relocation type: %s", GetRelocationString((MachoPpcRelocationType)reloc)); + logger->LogWarn("Unsupported Mach-O relocation type: %s", GetRelocationString((MachoPpcRelocationType)reloc)); return false; } }; -- cgit v1.3.1