mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 10:05:29 +00:00
Callgrind: Broader handling of _dl_runtime_resolve variants
This is a supplement to commit 86277041 To improve its results, Callgrind does special handling for the runtime linker entry point to resolve symbols. However, it only used the exact symbol name "_dl_runtime_resolve", as well as specific machine code templates (when the runtime linker was stripped from symbol names) as basis. Recent glibc added multiple similar symbol names as variants, such as _dl_runtime_resolve_xsave. The above-mentioned commit 86277041 solves this by extending the check for machine code templates for specific Linux distributions. This patch extends this for more architectures and variants by checking if a function starts with "_dl_runtime_resolve". Furthermore, the original function names of the variants still are visible in the output (and not forced to the prefix). While the heuristic that every function symbol starting with the prefix "_dl_runtime_resolve" as being an entry point into the runtime linker for resolving a function address may be a bit rough, this prefix is not expected to be used often in other source code for anything else. The worst case is a slightly misleading call graph only visible in a very specific situation: if the wrongly-detected function does a tail call (ie instead of returning, jumping to another function), it will be shown as 2 calls in a row from the original caller.
This commit is contained in:
parent
19cae12c17
commit
5e41080720
@ -665,7 +665,7 @@ fn_node* CLG_(get_fn_node)(BB* bb)
|
||||
if (bb->sect_kind == Vg_SectPLT)
|
||||
fn->skip = CLG_(clo).skip_plt;
|
||||
|
||||
if (VG_(strcmp)(fn->name, "_dl_runtime_resolve")==0) {
|
||||
if (VG_(strncmp)(fn->name, "_dl_runtime_resolve", 19)==0) {
|
||||
fn->pop_on_jump = True;
|
||||
|
||||
if (VG_(clo_verbosity) > 1)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user