[PATCH] D120626: [ELF] Move section assignment from initializeSymbols to postParse

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 8 19:51:20 PST 2022


MaskRay added a comment.

> I agree that mixing symbol bindings in the same link is a niche use case, likely for compilers not derived from LLVM or GCC.
> I expect that parallel reading will be in development for some time. It probably isn't worth working extra hard right now.

This change is just a necessary step to unlock more parallelism (section initialization), unless there is any other approach I haven't thought of.
(Our progress is not particularly rapid, just incrementally making more stuff parallel)

> If it isn't possible to cleanly support it, then can we diagnose it with a specific error message? For example LLD does not support COMDAT groups where different groups use different symbol bindings for the same symbol name. is better than an undefined symbol error.
> We'll need to document and release note the restriction.

Unfortunately I can't think of a way to detect the case without introducing a new loop.
The best I can think of is to add a boolean variable to `InputFile`. After parallel section initialization, add some code to `postParse` to detect the case, then in a new loop, resolve the symbol to the prevailing (even if weak) COMDAT group.
This seems inelegant and a lot of engineering to give a good diagnostic to the case ...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120626



More information about the llvm-commits mailing list