|
From: <Jos...@gm...> - 2021-04-08 00:16:20
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hi,</div> <div> </div> <div>see attached patch to let the debuginfo module detect the sections</div> <div>".plt.got" and ".plt.sec" as PLT sections.</div> <div> </div> <div>Both these sections appear in binaries of e.g. Ubuntu 20.4, and they</div> <div>are obviously trampolines for shared lib calls, ie like other entries in</div> <div>a regular ".plt" section. E.g. the ".plt.sec" section is added to the</div> <div>amd64 ABI for support of Intel CET, which obviously is enabled for</div> <div>all Ubuntu 20.04 packages (since last year).</div> <div>Not so sure about the purpuse of ".plt.got"...</div> <div> </div> <div>For better results, Callgrind suppresses calls to code in PLT sections in the</div> <div>generated call graph (instead, cost is attributed to the caller). Without this, calls</div> <div>to shared lib functions do show up as calls routed via unnamed functions</div> <div>(specifeid as hex address), as VG does not load symbols from PLT sections.</div> <div>This is currently happening on Ubuntu 20.04 (in addition to missing special handling</div> <div>of _dl_runtime_resolve_xsave, for what I just committed a fix).</div> <div> </div> <div>I am a bit unsure about these aspects of the attached patch:</div> <div>- no new section type is added, but VG_(DebugInfo_sect_kind) returns Vg_SectPLT</div> <div> now also for addresses within ".plt.sec" and ".plt.got"</div> <div>- for loading symbol names, the new sections are treated like ".plt", ie. VG refuses</div> <div> to add symbols from these sections</div> <div> </div> <div>I think the latter is fine, but I am unsure about the first, esp as VG also distinguishes</div> <div>GOT and GOTPLT sections. Next to Callgrind, DRD and Helgrind check for Vg_SectPLT</div> <div>at some point, and it looks fine to me to keep the single section type Vg_SectPLT,</div> <div>but wanted to check before applying the patch.</div> <div> </div> <div>Thanks,</div> <div>Josef</div> <div> </div> <div> </div> <div> <div class="signature"><br/> EMail Address: Jos...@gm...</div> </div></div></body></html> |