From dd778f0c8d8e7b21fc161a47c4616a11e1455a13 Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 14 Oct 2023 12:43:05 +0200 Subject: [PATCH] FpDebug: On Linux read .dynsym if .symtab does not exist. If .symtab exists, then .dynsym should be a subset. (cherry picked from commit 1db2f6aab4b31e7560eeba6d21b15653ede645b8) --- components/fpdebug/fpimgreaderelf.pas | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/fpdebug/fpimgreaderelf.pas b/components/fpdebug/fpimgreaderelf.pas index cf3bd8d8e6..a3c40921ef 100644 --- a/components/fpdebug/fpimgreaderelf.pas +++ b/components/fpdebug/fpimgreaderelf.pas @@ -124,6 +124,8 @@ const // Symbol-map section name _symbol = '.symtab'; _symbolstrings = '.strtab'; + _symboldyn = '.dynsym'; + _symboldynstrings = '.dynstr'; { TElfFile } @@ -474,6 +476,11 @@ begin AfpSymbolInfo.SetAddressBounds(1, High(AFpSymbolInfo.HighAddr)); // always search / TODO: iterate all sections for bounds p := Section[_symbol]; ps := Section[_symbolstrings]; + if (p = nil) or (ps = nil) then begin + p := Section[_symboldyn]; + ps := Section[_symboldynstrings]; + end; + if assigned(p) and assigned(ps) then begin SymbolStr:=PDbgImageSectionEx(ps)^.Sect.RawData;