From dc2a8e2de09b14c88cde7865f2c3e8f655b68f8d Mon Sep 17 00:00:00 2001 From: Brian Potchik Date: Wed, 6 May 2026 13:50:59 -0400 Subject: Fix ARM/Thumb2 function platform for .gnu_debugdata symbols. --- view/elf/elfview.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'view/elf/elfview.cpp') 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 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() ); -- cgit v1.3.1