[PATCH] D46502: [ELF] - Fix for "LLD can create incorrect debug PC ranges for functions in Comdat groups."

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 11 02:30:15 PDT 2018


peter.smith added a comment.

In https://reviews.llvm.org/D46502#1095700, @grimar wrote:

> In https://reviews.llvm.org/D46502#1095496, @ruiu wrote:
>
> > I tried this patch locally, experimented some other ideas, and do some benchmark. My feeling is that this patch is too much as a workaround for a buggy input. This is too intrusive, and it creates too many objects at runtime. For instance, Firefox contains almost 1 million discarded comdat sections, and creating "proxy" objects for them isn't negligible. You probably should fix the compiler instead of implementing a workaround to the linekr.
>
>
> Thanks for looking, Rui. I agree that it this functionality is too hacky probably.
>
> Let's see for people other opinions. If there will be no strong arguments to do something like that in the linker, I'll abandon this patch then.


I suggest asking on the PR as that had quite a few people involved in debug generation on the CC list. They may have a better view on how important it is for a linker to fix up the relocations or not.

A possible alternative, that I haven't thought through fully, that might not require the creation of a proxy section is for each selected group store the tuple <Group Signature Name (as we do today), InputFile*, Group Section Index in InputFile>. With this information could we look up the selected InputSection and store it in Sections[] rather than a proxy section. This would mean having an InputSection from Object A in the Sections array for Object B which could have some unforeseen side effects.


https://reviews.llvm.org/D46502





More information about the llvm-commits mailing list