summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/File.h
diff options
context:
space:
mode:
authorShankar Easwaran <shankare@codeaurora.org>2013-10-11 01:50:04 +0000
committerShankar Easwaran <shankare@codeaurora.org>2013-10-11 01:50:04 +0000
commitbcf36560fdfb491afa91e555b1fc4957b73c3a93 (patch)
treeee171d16a1a6d2635008bbe25ab21d869411593e /lld/lib/ReaderWriter/ELF/File.h
parent04a8bab0477b9b916a6d6d04df6b8ebd55b4f721 (diff)
downloadbcm5719-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.h3
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 {
OpenPOWER on IntegriCloud