[OutputSection] Work around GCC not being able to deduce auto.

The build otherwise fails with:
[ 39%] Building CXX object
tools/lld/ELF/CMakeFiles/lldELF.dir/OutputSections.cpp.o
/export/gnu/import/git/llvm/tools/lld/ELF/OutputSections.cpp: In
member function ‘void
lld::elf::GnuHashTableSection<ELFT>::addSymbols(std::vector<std::pair<lld::elf::SymbolBody*,
long unsigned int> >&)’:
/export/gnu/import/git/llvm/tools/lld/ELF/OutputSections.cpp:585:8:
error: inconsistent deduction for ‘auto’: ‘auto’ and then
‘__gnu_cxx::__normal_iterator<std::pair<lld::elf::SymbolBody*, long
unsigned int>*, std::vector<std::pair<lld::elf::SymbolBody*, long
unsigned int> > >’

Reported by:  H. J. Liu

llvm-svn: 274518
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 32d48c3..325cae6 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -576,13 +576,18 @@
 template <class ELFT>
 void GnuHashTableSection<ELFT>::addSymbols(
     std::vector<std::pair<SymbolBody *, size_t>> &V) {
-  auto Mid = std::stable_partition(V.begin(), V.end(),
-                                   [](std::pair<SymbolBody *, size_t> &P) {
-                                     return P.first->isUndefined();
-                                   });
+  // Ideally this will just be 'auto' but GCC 6.1 is not able
+  // to deduce it correctly.
+  std::vector<std::pair<SymbolBody *, size_t>>::iterator Mid =
+      std::stable_partition(V.begin(), V.end(),
+                            [](std::pair<SymbolBody *, size_t> &P) {
+                              return P.first->isUndefined();
+                            });
   if (Mid == V.end())
     return;
-  for (auto I = Mid, E = V.end(); I != E; ++I) {
+  for (std::vector<std::pair<SymbolBody *, size_t>>::iterator I = Mid,
+                                                              E = V.end();
+       I != E; ++I) {
     SymbolBody *B = I->first;
     size_t StrOff = I->second;
     Symbols.push_back({B, StrOff, hashGnu(B->getName())});