[lld] r292903 - [ELF] - Added additional comments on top of r292789 (D29021)

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 24 01:31:02 PST 2017


Author: grimar
Date: Tue Jan 24 03:31:02 2017
New Revision: 292903

URL: http://llvm.org/viewvc/llvm-project?rev=292903&view=rev
Log:
[ELF] - Added additional comments on top of r292789 (D29021)

It was requested during post commit review.

Modified:
    lld/trunk/ELF/InputSection.cpp

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=292903&r1=292902&r2=292903&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Tue Jan 24 03:31:02 2017
@@ -237,6 +237,10 @@ template <class RelTy>
 void InputSection<ELFT>::copyRelocations(uint8_t *Buf, ArrayRef<RelTy> Rels) {
   InputSectionBase<ELFT> *RelocatedSection = getRelocatedSection();
 
+  // Loop is slow and have complexity O(N*M), where N - amount of
+  // relocations and M - amount of symbols in symbol table.
+  // That happens because getSymbolIndex(...) call below performs
+  // simple linear search.
   for (const RelTy &Rel : Rels) {
     uint32_t Type = Rel.getType(Config->Mips64EL);
     SymbolBody &Body = this->File->getRelocTargetSym(Rel);




More information about the llvm-commits mailing list