[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
Mon May 14 09:01:53 PDT 2018


peter.smith added a comment.

In https://reviews.llvm.org/D46502#1096122, @ruiu wrote:

> I'd agree that there might be some alternative way of doing this. I thought that, if there's some way to obtain a replacing comdat section from here
>
> https://github.com/llvm-project/llvm-project-20170507/blob/master/lld/ELF/Symbols.cpp#L54
>
> then we can get an address for a replaced comdat section which might solve the issue. But with the data structure it doesn't seem to be easy thing to do (and that's not lld's fault as it is for a compiler bug workaround).


I can't think of a way that doesn't involve storing a mapping between discarded symbols/sections or just storing the input file of the selected group, but then having to do some potentially non-trivial processing to find the equivalent section for each discarded one. If each InputFile did store a mapping table then in theory copyLocalSymbols could populate the section field of a local symbol defined against a discarded section with that of the selected group.


https://reviews.llvm.org/D46502





More information about the llvm-commits mailing list