[PATCH] D59649: [ELF] Improve error message for relocations to symbols defined in discarded COMDAT

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 21 17:21:40 PDT 2019


smeenai added a comment.

In D59649#1438809 <https://reviews.llvm.org/D59649#1438809>, @MaskRay wrote:

> In D59649#1438330 <https://reviews.llvm.org/D59649#1438330>, @smeenai wrote:
>
> > Thank you!
> >
> > If I'm understanding correctly, for the case where the relocation is not in the same object file as the discarded section, we'll still get the "undefined symbol" error message. I don't know if it would be possible to enhance that case to print the "relocation against discarded section" message as well. (gold does print that message in this case; it just doesn't print the additional information about the section group signature and prevailing definition.)
>
>
> `Symbol` has the `File` field but not the section index (`st_shndx`). If the relocation is not in the same object as the discarded section, we can't get the defined section easily.


Could we do so via symbol table lookup? Rui said in https://bugs.llvm.org/show_bug.cgi?id=41133 that "We already insert all symbols (including ones for discarded sections) to the symbol table".


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59649/new/

https://reviews.llvm.org/D59649





More information about the llvm-commits mailing list