Summary: | [PATCH]valgrind does not support debug info for read only segments (generated by LLD) | ||
---|---|---|---|
Product: | [Developer tools] valgrind | Reporter: | Orivej Desh <orivej> |
Component: | general | Assignee: | Ivo Raisr <ivosh> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | ivosh, jseward, l.lunak, peter.klotz99, ruiu |
Priority: | NOR | ||
Version: | 3.14 SVN | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | valgrind patch |
Description
Orivej Desh
2017-09-15 04:25:04 UTC
We independently found the same issue: https://bugs.llvm.org/show_bug.cgi?id=35032 This is not particularly specific to lld. It is reproducible by passing --rosegment to gold. Created attachment 113765 [details] valgrind patch I think this patch completes the fix (i.e. it's meant to be added on top of the above-mentioned https://github.com/orivej/valgrind/commit/c59bf5c215f85fb08605708b51f88777227885ae.patch ). With these two patches, valgrind works for me fine with lld-generated binaries (and my testcase is LibreOffice, so if it works there, it must work for everything else too :) ). The only place I'm somewhat unsure of is the "FIND(rodata, rw)", i.e. the last snippet, but I assume that doesn't actually matter. As noted in "JRS 2013-Jun-01" a couple of lines above, all the code related to the second argument to FIND(), variables like rx_dsvma_limit and all that are actually unused. Please could you try one of the patches from bug https://bugs.kde.org/show_bug.cgi?id=395682 These two bugs seem to be very similar. (In reply to Ivo Raisr from comment #3) > Please could you try one of the patches from bug > https://bugs.kde.org/show_bug.cgi?id=395682 > These two bugs seem to be very similar. That seems to help, yes. On aarch64-linux, with a big C++ executable (SpiderMonkey) compiled by clang-6.0.0 and ld.lld, it makes the difference between no debuginfo at all and, as far as I can see, everything working normally. (In reply to Ivo Raisr from comment #3) > Please could you try one of the patches from bug > https://bugs.kde.org/show_bug.cgi?id=395682 > These two bugs seem to be very similar. Yes, the patch from bug #395682 seems to work for me too (again tested with LibreOffice debug build with with clang6 and lld6). The bugreports look like duplicates to me and that patch seems better than mine (no idea why I got confused into thinking that .rodata could be encountered twice in one binary). *** This bug has been marked as a duplicate of bug 395682 *** |