Closed marxin closed 1 month ago
Thanks for noticing that! You're right. However using PartId
rather than OutputSectionId
won't help, since for cases where we're doing string merging, alignment is always 1-1, so we only have a single string-merge PartId
in the output section. There can however be multiple string-merge input sections from the same input file that map to the same PartId
/ OutputSectionId
. I've switched to keying by the offset in the input file rather than the offset in the input section. That removes the need for OutputSectionId
.
I diffed a dump of the debug info for a trivial C program with and without the fix and didn't see any change, but maybe I just got luck (or unlucky) and didn't get any collisions.
I noticed that while preparing a
gimli
verification check forlinker-diff
. If I build a simple C program, I get the following with Wild:while the correct output should look like:
The problem is that the cache is now one for each output section. However, it should be per output section part.
@davidlattimore Will you fix it, please? In the meantime, I plan to integrate a basic
gimli
checker to handle this problem.