MINOR: tools: improve symbol resolution without dl_addr
authorWilly Tarreau <w@1wt.eu>
Thu, 13 Mar 2025 16:21:24 +0000 (17:21 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 20 Mar 2025 10:38:00 +0000 (11:38 +0100)
commit7ac0d18ea5c85176369eb04a402761d08c96fc80
treeb7cff60f671e6b9894c704dbe0ab1063549e8871
parent6c79e9a60b981fd3c6f02e2029b2ead0fbe4a35c
MINOR: tools: improve symbol resolution without dl_addr

When dl_addr is not usable or fails, better fall back to the closest
symbol among the known ones instead of providing everything relative
to main. Most often, the location of the function will give some hints
about what it can be. Thus now we can emit fct+0xXXX in addition to
main+0xXXX or main-0xXXX. We keep a margin of +256kB maximum after a
function for a match, which is around the maximum size met in an object
file, otherwise it becomes pointless again.

(cherry picked from commit e920d73f598bd770a5dc861074268d1b2db4de59)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 9df54d8c1b4de89df9b933d9f58c0c388fed4a5b)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/tools.c