[PATCH] D119908: [ELF] Move duplicate symbol check after input file parsing
Igor Kudrin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 16 07:37:17 PST 2022
ikudrin added inline comments.
================
Comment at: lld/ELF/Driver.cpp:2291
+ parallelForEach(objectFiles, [](ELFFileBase *file) {
+ switch (config->ekind) {
----------------
ikudrin wrote:
> In D119909, a helper function `initializeLocalSymbols()` is added for a similar purpose. It would be better to do the same for `ObjFile<T>::postParse()`.
In D119909, this loop is moved later in the method. It would be better to place it in the right position from the beginning.
================
Comment at: lld/ELF/Driver.cpp:2291-2308
+ parallelForEach(objectFiles, [](ELFFileBase *file) {
+ switch (config->ekind) {
+ case ELF32LEKind:
+ cast<ObjFile<ELF32LE>>(file)->postParse();
+ break;
+ case ELF32BEKind:
+ cast<ObjFile<ELF32BE>>(file)->postParse();
----------------
In D119909, a helper function `initializeLocalSymbols()` is added for a similar purpose. It would be better to do the same for `ObjFile<T>::postParse()`.
================
Comment at: lld/ELF/Driver.cpp:2309-2310
+ });
+ for (BitcodeFile *file : bitcodeFiles)
+ file->postParse();
+
----------------
- Why no parallel execution for bitcode files?
- Shouldn't this loop be placed later in the function to detect duplicate symbols if some bitcode files are parsed after this point? They may define an `--entry` symbol, as an example.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119908/new/
https://reviews.llvm.org/D119908
More information about the llvm-commits
mailing list