From 8127c87b2e5ddf6987dbd4104b37f4cbc4624356 Mon Sep 17 00:00:00 2001 From: Josh Ferrell Date: Tue, 18 Mar 2025 12:30:59 -0400 Subject: Fix loading .gnu_debugdata when loading an ELF with non-zero base --- view/elf/elfview.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'view/elf/elfview.cpp') diff --git a/view/elf/elfview.cpp b/view/elf/elfview.cpp index d6e9006e..c87c9e05 100644 --- a/view/elf/elfview.cpp +++ b/view/elf/elfview.cpp @@ -2700,7 +2700,9 @@ void ElfView::ParseMiniDebugInfo() return; } - Ref debugBv = Load(debugElf, false); + // Load debug bv at same address as this bv + string debugBvOptions = fmt::format("{{\"loader.imageBase\": {}}}", GetStart()); + Ref debugBv = Load(debugElf, false, debugBvOptions); if (!debugBv) { m_logger->LogError("Invalid .gnu_debugdata contents: Failed to create BinaryView"); @@ -2712,7 +2714,7 @@ void ElfView::ParseMiniDebugInfo() DefineElfSymbol( symbol->GetType(), symbol->GetRawName(), - GetStart() + symbol->GetAddress(), + symbol->GetAddress(), false, symbol->GetBinding() ); -- cgit v1.3.1