[Lldb-commits] [PATCH] D44041: Only replace object file sections when non-empty

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 6 08:33:49 PST 2018

labath added a comment.

Ok, as of r326805 it should be very easy to write a test for this. You can look at the test in that commit for inspiration.

Btw, do you happen to know why we have two copies of the section merging code? While working on that patch I noticed an issue that is caused (in part*) by the fact that we merge the sections three times. I've tried to remove the copy in ObjectFileELF, and everything seems to work fine, but our test support coverage for the debug-info-in-separate-file is not that awesome. If you have any other tests for this, I'd appreciate if you can run them before I check that in (I'll send you a patch soon).

(*) The problem is that we are replacing the sections by their IDs, but (ELF?) section IDs are unique only if they all come from a single object file. So when we start replacing them the second time round, we end up overwriting random sections. When we replace the sections only once, the code will be technically correct, but the replacement-by-id idea seems still a bit sketchy.


More information about the lldb-commits mailing list