summaryrefslogtreecommitdiff
path: root/view/elf/elfview.cpp
diff options
context:
space:
mode:
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()
);