Index: lld/MachO/InputFiles.cpp =================================================================== --- lld/MachO/InputFiles.cpp +++ lld/MachO/InputFiles.cpp @@ -807,7 +807,7 @@ // subsection here. if (sections[i]->doneSplitting) { for (size_t j = 0; j < symbolIndices.size(); ++j) { - uint32_t symIndex = symbolIndices[j]; + const uint32_t symIndex = symbolIndices[j]; const NList &sym = nList[symIndex]; StringRef name = strtab + sym.n_strx; uint64_t symbolOffset = sym.n_value - sectionAddr; @@ -833,7 +833,7 @@ return nList[lhs].n_value < nList[rhs].n_value; }); for (size_t j = 0; j < symbolIndices.size(); ++j) { - uint32_t symIndex = symbolIndices[j]; + const uint32_t symIndex = symbolIndices[j]; const NList &sym = nList[symIndex]; StringRef name = strtab + sym.n_strx; Subsection &subsec = subsections.back();