summaryrefslogtreecommitdiff
path: root/arch/arm64
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-12-05 17:26:55 -0500
committerMason Reed <35282038+emesare@users.noreply.github.com>2025-12-29 10:14:48 -0500
commit6bfb18962ba4f3317a7944a4ed6f45f468690a3e (patch)
treec89f69b602d84168421e0070b1e4917b4312e375 /arch/arm64
parent9dbc09db3ad16db41cddcd98258c00c829924270 (diff)
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.
Diffstat (limited to 'arch/arm64')
-rw-r--r--arch/arm64/arch_arm64.cpp17
1 files changed, 8 insertions, 9 deletions
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<BinaryView> view, Ref<Architecture> arch, vector<BNRelocationInfo>& result) override
{
- (void)view;
(void)arch;
-
+ Ref<Logger> logger = view->CreateLogger("Arm64MachoReloc");
set<MachoArm64RelocationType> 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<BinaryView> view, Ref<Architecture> arch, vector<BNRelocationInfo>& result) override
{
- (void)view;
(void)arch;
(void)result;
+ Ref<Logger> logger = view->CreateLogger("Arm64ElfReloc");
set<uint64_t> 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<BinaryView> view, Ref<Architecture> arch, vector<BNRelocationInfo>& result) override
{
- (void)view;
(void)arch;
+ Ref<Logger> logger = view->CreateLogger("Arm64PeReloc");
set<uint64_t> 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<BinaryView> view, Ref<Architecture> arch, vector<BNRelocationInfo>& result) override
{
- (void)view;
(void)arch;
+ Ref<Logger> logger = view->CreateLogger("Arm64CoffReloc");
set<uint64_t> 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;
}
};