diff options
| author | Shankar Easwaran <shankare@codeaurora.org> | 2013-10-11 01:50:04 +0000 |
|---|---|---|
| committer | Shankar Easwaran <shankare@codeaurora.org> | 2013-10-11 01:50:04 +0000 |
| commit | bcf36560fdfb491afa91e555b1fc4957b73c3a93 (patch) | |
| tree | ee171d16a1a6d2635008bbe25ab21d869411593e /lld/lib/ReaderWriter/ELF/File.h | |
| parent | 04a8bab0477b9b916a6d6d04df6b8ebd55b4f721 (diff) | |
| download | bcm5719-llvm-bcf36560fdfb491afa91e555b1fc4957b73c3a93.tar.gz bcm5719-llvm-bcf36560fdfb491afa91e555b1fc4957b73c3a93.zip | |
[ELF] Fix Atoms in the same file had overlapping ordinals.
This also reverts the LayoutPass to use std::sort as all files
have an ordinal now.
llvm-svn: 192409
Diffstat (limited to 'lld/lib/ReaderWriter/ELF/File.h')
| -rw-r--r-- | lld/lib/ReaderWriter/ELF/File.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lld/lib/ReaderWriter/ELF/File.h b/lld/lib/ReaderWriter/ELF/File.h index 51f1b3bffa8..9811f80267e 100644 --- a/lld/lib/ReaderWriter/ELF/File.h +++ b/lld/lib/ReaderWriter/ELF/File.h @@ -278,7 +278,6 @@ public: if (SymI != SymE) ++SymI; - int commonOrd = 0; for (; SymI != SymE; ++SymI) { const Elf_Shdr *section = _objFile->getSection(&*SymI); @@ -303,7 +302,7 @@ public: } else if (isCommonSymbol(&*SymI)) { auto *newAtom = new (_readerStorage) ELFCommonAtom<ELFT>(*this, *symbolName, &*SymI); - newAtom->setOrdinal(commonOrd++); + newAtom->setOrdinal(_ordinal++); _definedAtoms._atoms.push_back(newAtom); _symbolToAtomMapping.insert(std::make_pair(&*SymI, newAtom)); } else { |

