From: Maynard J. <may...@us...> - 2011-10-21 04:21:56
|
William Cohen wrote: > I have been looking into a bug reported on Fedora about oprofile not providing per function counts for libraries by opreport (Bug 746823 - oprofile and sysprof fail to read symbol files). We have narrowed down the cause to the prelink changing the address of sections in the shared library and then later bfd_info::translate_debuginfo_syms() is not able to find the matching section for the debuginfo in the share library section. The debuginfo section are left with the SEC_LOAD flag unset and are later removed as uninteresting symbols. There is additional information about the bug at: > > https://bugzilla.redhat.com/show_bug.cgi?id=746823 > > I am a bit leery just shoving a patch in to fix this particular bug because there have been a number of fixes in there for various cases. Any suggestions on how to best address this issue? Sheesh, translate_debuginfo_syms is fragile! This isn't the first time it's caused problems, if you recall. This hack of a function came into existence as a result of a bug I reported back on June 18, 2009 (subject "[PATCH] Fix computation of symbol size on corner case"). John wasn't enamored with my proposed fix, and we eventually agreed to fix the problem by filtering symbols whose section flags does not contain SEC_LOAD. In retrospect, this was not a good fix. In September, a user reported that debuginfo file processing was broken, and it was because the section flags in debuginfo files do NOT have SEC_LOAD, so they were ALL being filtered out. Instead of re-thinking the strategy of how to fix the original problem (the one I reported in June 2009), we doubled-down and came up with translate_debuginfo_syms(). I personally would be happy to do away with translate_debuginfo_syms, which should fix the problem your Fedora users see when using prelink. *Will*, maybe you've done this already, but can you comment out the following two lines in bfd_support.cpp:bfd_info::get_symbols() if (image_bfd_info) translate_debuginfo_syms(syms.get(), nr_syms); If that tests out OK, we'll then discuss alternatives for fixing the original problem. Thanks. -Maynard > > -Will > |