summaryrefslogtreecommitdiff
path: root/view/elf/elfview.cpp
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2026-05-06 13:50:59 -0400
committerBrian Potchik <brian@vector35.com>2026-05-06 13:50:59 -0400
commitdc2a8e2de09b14c88cde7865f2c3e8f655b68f8d (patch)
tree992c4b1be1d244a532e154cbb59059565ecec421 /view/elf/elfview.cpp
parent0a626589144ad46dca1934f3ab869b57a111c17c (diff)
Fix ARM/Thumb2 function platform for .gnu_debugdata symbols.
Diffstat (limited to 'view/elf/elfview.cpp')
-rw-r--r--view/elf/elfview.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/view/elf/elfview.cpp b/view/elf/elfview.cpp
index 58e82efc..abf860a2 100644
--- a/view/elf/elfview.cpp
+++ b/view/elf/elfview.cpp
@@ -2786,7 +2786,7 @@ void ElfView::ParseMiniDebugInfo()
}
// Load debug bv at same address as this bv
- string debugBvOptions = fmt::format("{{\"loader.imageBase\": {}, \"analysis.outlining.builtins\": false}}", GetStart());
+ string debugBvOptions = fmt::format("{{\"loader.imageBase\": {}, \"analysis.outlining.builtins\": false, \"analysis.functions.allowUnbackedMemory\": true}}", GetStart());
Ref<BinaryView> debugBv = Load(debugElf, false, debugBvOptions);
if (!debugBv)
{
@@ -2796,10 +2796,22 @@ void ElfView::ParseMiniDebugInfo()
for (const auto& symbol : debugBv->GetSymbols())
{
+ uint64_t addr = symbol->GetAddress();
+ auto symbolType = symbol->GetType();
+ if ((symbolType == FunctionSymbol) || (symbolType == ImportedFunctionSymbol) || (symbolType == LibraryFunctionSymbol))
+ {
+ if (auto funcs = debugBv->GetAnalysisFunctionsForAddress(addr); !funcs.empty())
+ {
+ const auto& archName = funcs[0]->GetArchitecture()->GetName();
+ if ((archName == "thumb2") || (archName == "thumb2eb"))
+ addr |= 1;
+ }
+ }
+
DefineElfSymbol(
symbol->GetType(),
symbol->GetRawName(),
- symbol->GetAddress(),
+ addr,
false,
symbol->GetBinding()
);