Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions arch/arm64/arch_arm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
{
Expand Down Expand Up @@ -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;
}
};
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -3282,16 +3281,16 @@ 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)
{
reloc.type = UnhandledRelocation;
relocTypes.insert(reloc.nativeType);
}
for (auto& reloc : relocTypes)
LogWarn(
logger->LogWarn(
"Unsupported PE relocation type: %s", GetRelocationString((PeArm64RelocationType)reloc));
return false;
}
Expand Down Expand Up @@ -3407,8 +3406,8 @@ class Arm64COFFRelocationHandler: public RelocationHandler

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)
{
Expand Down Expand Up @@ -3477,7 +3476,7 @@ class Arm64COFFRelocationHandler: public RelocationHandler
}
}
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;
}
};
Expand Down
16 changes: 8 additions & 8 deletions arch/armv7/arch_armv7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2497,8 +2497,8 @@ class ArmElfRelocationHandler: public RelocationHandler

virtual bool GetRelocationInfo(Ref<BinaryView> view, Ref<Architecture> arch, vector<BNRelocationInfo>& result) override
{
(void)view;
(void)arch;
Ref<Logger> logger = view->CreateLogger("ArmElfReloc");
set<uint64_t> relocTypes;
for (auto& reloc: result)
{
Expand Down Expand Up @@ -2670,7 +2670,7 @@ class ArmElfRelocationHandler: public RelocationHandler
}
}
for (auto& reloc : relocTypes)
LogWarn("Unsupported ELF relocation: %s", GetRelocationString((ElfArmRelocationType)reloc));
logger->LogWarn("Unsupported ELF relocation: %s", GetRelocationString((ElfArmRelocationType)reloc));
return true;
}
};
Expand All @@ -2693,16 +2693,16 @@ class ArmMachORelocationHandler: public RelocationHandler

virtual bool GetRelocationInfo(Ref<BinaryView> view, Ref<Architecture> arch, vector<BNRelocationInfo>& result) override
{
(void)view;
(void)arch;
Ref<Logger> logger = view->CreateLogger("ArmMachoReloc");
set<uint64_t> relocTypes;
for (auto& reloc: result)
{
reloc.type = UnhandledRelocation;
relocTypes.insert(reloc.nativeType);
}
for (auto& reloc : relocTypes)
LogWarn("Unsupported Mach-O relocation %s", GetRelocationString((MachoArmRelocationType)reloc));
logger->LogWarn("Unsupported Mach-O relocation %s", GetRelocationString((MachoArmRelocationType)reloc));
return false;
};
};
Expand Down Expand Up @@ -2745,8 +2745,8 @@ class ArmPERelocationHandler: public RelocationHandler

virtual bool GetRelocationInfo(Ref<BinaryView> view, Ref<Architecture> arch, vector<BNRelocationInfo>& result) override
{
(void)view;
(void)arch;
Ref<Logger> logger = view->CreateLogger("ArmPeReloc");
set<uint64_t> relocTypes;
for (auto& reloc: result)
{
Expand Down Expand Up @@ -2775,7 +2775,7 @@ class ArmPERelocationHandler: public RelocationHandler
}
}
for (auto& reloc : relocTypes)
LogWarn("Unsupported PE relocation %s", GetRelocationString((PeRelocationType)reloc));
logger->LogWarn("Unsupported PE relocation %s", GetRelocationString((PeRelocationType)reloc));
return false;
}

Expand Down Expand Up @@ -3162,8 +3162,8 @@ class ArmCOFFRelocationHandler: public RelocationHandler

virtual bool GetRelocationInfo(Ref<BinaryView> view, Ref<Architecture> arch, vector<BNRelocationInfo>& result) override
{
(void)view;
(void)arch;
Ref<Logger> logger = view->CreateLogger("ArmCoffReloc");
set<uint64_t> relocTypes;
for (auto& reloc: result)
{
Expand Down Expand Up @@ -3236,7 +3236,7 @@ class ArmCOFFRelocationHandler: public RelocationHandler
}
}
for (auto& reloc : relocTypes)
LogWarn("Unsupported COFF relocation %s", GetRelocationString((PeArmRelocationType)reloc));
logger->LogWarn("Unsupported COFF relocation %s", GetRelocationString((PeArmRelocationType)reloc));
return true;
}
};
Expand Down
10 changes: 6 additions & 4 deletions arch/powerpc/arch_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2469,7 +2469,8 @@ class PpcElfRelocationHandler: public RelocationHandler

virtual bool GetRelocationInfo(Ref<BinaryView> view, Ref<Architecture> arch, vector<BNRelocationInfo>& result) override
{
(void)view; (void)arch; (void)result;
(void)arch; (void)result;
Ref<Logger> logger = view->CreateLogger("PpcElfReloc");
set<uint64_t> relocTypes;
for (auto& reloc : result)
{
Expand Down Expand Up @@ -2526,7 +2527,7 @@ class PpcElfRelocationHandler: public RelocationHandler
}
}
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;
}

Expand Down Expand Up @@ -2555,15 +2556,16 @@ class PpcMachoRelocationHandler: public RelocationHandler
public:
virtual bool GetRelocationInfo(Ref<BinaryView> view, Ref<Architecture> arch, vector<BNRelocationInfo>& result) override
{
(void)view; (void)arch;
(void)arch;
Ref<Logger> logger = view->CreateLogger("PpcMachoReloc");
set<uint64_t> relocTypes;
for (auto& reloc : result)
{
reloc.type = UnhandledRelocation;
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;
}
};
Expand Down
32 changes: 19 additions & 13 deletions arch/x86/arch_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4058,7 +4058,8 @@ class x86MachoRelocationHandler: public RelocationHandler

virtual bool GetRelocationInfo(Ref<BinaryView> view, Ref<Architecture> arch, vector<BNRelocationInfo>& result) override
{
(void)view; (void)arch;
(void)arch;
Ref<Logger> logger = view->CreateLogger("X86MachoReloc");
set<uint64_t> relocTypes;
for (size_t i = 0; i < result.size(); i++)
{
Expand All @@ -4080,7 +4081,7 @@ class x86MachoRelocationHandler: public RelocationHandler
}

for (auto& reloc : relocTypes)
LogWarn("Unsupported Mach-O relocation type: %s", GetRelocationString((Machox86RelocationType)reloc));
logger->LogWarn("Unsupported Mach-O relocation type: %s", GetRelocationString((Machox86RelocationType)reloc));
return true;
}
};
Expand All @@ -4090,7 +4091,8 @@ class x86ElfRelocationHandler: public RelocationHandler
public:
virtual bool GetRelocationInfo(Ref<BinaryView> view, Ref<Architecture> arch, vector<BNRelocationInfo>& result) override
{
(void)view; (void)arch;
(void)arch;
Ref<Logger> logger = view->CreateLogger("X86ElfReloc");
set<uint64_t> relocTypes;
for (auto& reloc : result)
{
Expand Down Expand Up @@ -4154,7 +4156,7 @@ class x86ElfRelocationHandler: public RelocationHandler
}
}
for (auto& reloc : relocTypes)
LogWarn("Unsupported ELF relocation type: %s", GetRelocationString((Elfx86RelocationType)reloc));
logger->LogWarn("Unsupported ELF relocation type: %s", GetRelocationString((Elfx86RelocationType)reloc));
return true;
}
};
Expand Down Expand Up @@ -4221,7 +4223,8 @@ class x64MachoRelocationHandler: public RelocationHandler

virtual bool GetRelocationInfo(Ref<BinaryView> view, Ref<Architecture> arch, vector<BNRelocationInfo>& result) override
{
(void)view; (void)arch;
(void)arch;
Ref<Logger> logger = view->CreateLogger("X86MachoReloc");
set<uint64_t> relocTypes;
for (size_t i = 0; i < result.size(); i++)
{
Expand Down Expand Up @@ -4286,7 +4289,7 @@ class x64MachoRelocationHandler: public RelocationHandler
}

for (auto& reloc : relocTypes)
LogWarn("Unsupported Mach-O relocation: %s", GetRelocationString((Machox64RelocationType)reloc));
logger->LogWarn("Unsupported Mach-O relocation: %s", GetRelocationString((Machox64RelocationType)reloc));
return true;
}
};
Expand Down Expand Up @@ -4345,7 +4348,8 @@ class x64ElfRelocationHandler: public RelocationHandler
The AMD64 ILP32 ABI architecture uses only Elf32_Rela relocation entries in relocatable files. Relocations
contained within executable files or shared objects may use either Elf32_Rela relocation or Elf32_Rel relocation.
*/
(void)view; (void)arch;
(void)arch;
Ref<Logger> logger = view->CreateLogger("X86ElfReloc");
set<uint64_t> relocTypes;
for (auto& reloc : result)
{
Expand Down Expand Up @@ -4477,7 +4481,7 @@ class x64ElfRelocationHandler: public RelocationHandler
}
}
for (auto& reloc : relocTypes)
LogWarn("Unsupported ELF relocation: %s", GetRelocationString((Elfx64RelocationType)reloc));
logger->LogWarn("Unsupported ELF relocation: %s", GetRelocationString((Elfx64RelocationType)reloc));
return true;
}
};
Expand Down Expand Up @@ -4547,7 +4551,8 @@ class CoffRelocationHandler: public RelocationHandler

virtual bool GetRelocationInfo(Ref<BinaryView> view, Ref<Architecture> arch, vector<BNRelocationInfo>& result) override
{
(void)view; (void)arch;
(void)arch;
Ref<Logger> logger = view->CreateLogger("X86CoffReloc");
set<uint64_t> relocTypes;
for (auto& reloc : result)
{
Expand Down Expand Up @@ -4608,7 +4613,7 @@ class CoffRelocationHandler: public RelocationHandler
relocTypes.insert(reloc.nativeType);
}
for (auto& reloc : relocTypes)
LogWarn("Unsupported COFF relocation: %s", GetRelocationString((COFFx64RelocationType)reloc));
logger->LogWarn("Unsupported COFF relocation: %s", GetRelocationString((COFFx64RelocationType)reloc));
}
else if (arch->GetName() == "x86")
{
Expand Down Expand Up @@ -4652,7 +4657,7 @@ class CoffRelocationHandler: public RelocationHandler
relocTypes.insert(reloc.nativeType);
}
for (auto& reloc : relocTypes)
LogWarn("Unsupported COFF relocation: %s", GetRelocationString((COFFx86RelocationType)reloc));
logger->LogWarn("Unsupported COFF relocation: %s", GetRelocationString((COFFx86RelocationType)reloc));
}
}

Expand Down Expand Up @@ -4708,7 +4713,8 @@ class PeRelocationHandler: public RelocationHandler

virtual bool GetRelocationInfo(Ref<BinaryView> view, Ref<Architecture> arch, vector<BNRelocationInfo>& result) override
{
(void)view; (void)arch;
(void)arch;
Ref<Logger> logger = view->CreateLogger("X86PeReloc");
set<uint64_t> relocTypes;
for (auto& reloc : result)
{
Expand Down Expand Up @@ -4741,7 +4747,7 @@ class PeRelocationHandler: public RelocationHandler
}

for (auto& reloc : relocTypes)
LogWarn("Unsupported PE relocation: %s", GetRelocationString((PeRelocationType)reloc));
logger->LogWarn("Unsupported PE relocation: %s", GetRelocationString((PeRelocationType)reloc));
return false;
}

Expand Down