[PATCH] D14084: [ELF2] Move sorting from symbol table to the GNU hash section.

Igor Kudrin via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 26 11:20:37 PDT 2015


ikudrin added inline comments.

================
Comment at: ELF/OutputSections.cpp:350
@@ -351,2 +349,3 @@
 template <class ELFT> void GnuHashTableSection<ELFT>::writeTo(uint8_t *Buf) {
+  assert(NumHashed == HashedSymbols.size());
   writeHeader(Buf);
----------------
ruiu wrote:
> Is NumHashed always the same as HashedSymbols.size()? If so, remove the variable and use HashedSymbols.size() instead.
This class requires the other class to call sortSymbols() method. Plus, it requires that addSymbol() is called the exact number of times, and these calls come from the third place. This assert ensures that everything is in sync.


http://reviews.llvm.org/D14084





More information about the llvm-commits mailing list