[PATCH] D46755: [LLD][ELF] Implement --keep-unique option
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 11 10:16:49 PDT 2018
ruiu added a comment.
I agree that we should support this option.
================
Comment at: ELF/ICF.cpp:439-440
if (auto *S = dyn_cast<InputSection>(Sec))
- if (isEligible(S))
+ if (isEligible(S) &&
+ KeepUniqueSections.find(S) == KeepUniqueSections.end())
Sections.push_back(S);
----------------
I think that looking up a hash function for each input section is slow, so I'd avoid doing this. Instead, I believe you can add a `KeepUnique` bit to the InputSection and set that bit in the driver.
https://reviews.llvm.org/D46755
More information about the llvm-commits
mailing list