[lld] r251502 - [ELF2] Move sorting and data to the GNU hash table section.
Igor Kudrin via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 30 01:06:19 PDT 2015
What about this variant? http://reviews.llvm.org/D14196
On 30.10.2015 09:18, Igor Kudrin wrote:
> Hi Rafael,
>
> On 30.10.2015 3:25, Rafael EspĂndola wrote:
>>> template <class ELFT> void GnuHashTableSection<ELFT>::finalize() {
>>> - const unsigned NumHashed =
>>> Out<ELFT>::DynSymTab->getNumGnuHashSymbols();
>>> + ArrayRef<SymbolBody *> A = Out<ELFT>::DynSymTab->getSymbols();
>>> + unsigned NumHashed = std::count_if(A.begin(), A.end(),
>>> includeInGnuHashTable);
>>> NBuckets = calcNBuckets(NumHashed);
>>> MaskWords = calcMaskWords(NumHashed);
>> Could we write this as:
>> unsigned NumHashed = HashedSymbols.size();
> HashSymbols is filled in the addSymbols() method which is called from
> DynSymTab's finalize() method.
> Do we have any guarantee that DynSymTab's finalize() is called before
> GnuHashTab's one?
> How to force that guarantee in code?
>
> -Igor
More information about the llvm-commits
mailing list