DynsymIndex was used as symbol table index for -r.
Also it was reused in the same way in D28612 for
--emit-relocs, though it introduced few restrictions.
Since DynsymIndex is busy with symtab index,
there is no way to create .dynsym table.
Patch shows one of possible way to avoid reusing this variable.
Another and much simpler way would be just to add
SymtabIndex variable to Symbol class.
I am not sure what is better.
This function seems too heavy to run for each relocation. It is probably not ok to do this much here.