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

It was requested during post commit review.

llvm-svn: 292903
This commit is contained in:
George Rimar 2017-01-24 09:31:02 +00:00
parent 200ead56c6
commit e3c2051d27
1 changed files with 4 additions and 0 deletions

View File

@ -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);