summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-01-27 03:05:34 +0000
committerRui Ueyama <ruiu@google.com>2015-01-27 03:05:34 +0000
commit9af09d758a52cd978ccc15fbbf3fbe1d97bd2eb4 (patch)
treec1adc507311d8f7e006a498fff2ce9fecf72acb4
parent15ac9363a7f139ae674c99a883fbeae9a239f3ce (diff)
downloadbcm5719-llvm-9af09d758a52cd978ccc15fbbf3fbe1d97bd2eb4.tar.gz
bcm5719-llvm-9af09d758a52cd978ccc15fbbf3fbe1d97bd2eb4.zip
Fix incorrect atom ordinal.
Anonymous atoms created there were getting wrong atom ordinal. LayoutAfter references take precedence over atom ordinals, so the bug was not visible, though. llvm-svn: 227168
-rw-r--r--lld/lib/ReaderWriter/ELF/ELFFile.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/lld/lib/ReaderWriter/ELF/ELFFile.h b/lld/lib/ReaderWriter/ELF/ELFFile.h
index 5a5c7b6da21..f8c4900b371 100644
--- a/lld/lib/ReaderWriter/ELF/ELFFile.h
+++ b/lld/lib/ReaderWriter/ELF/ELFFile.h
@@ -687,7 +687,6 @@ template <class ELFT> std::error_code ELFFile<ELFT>::createAtoms() {
sym->setBinding(llvm::ELF::STB_GLOBAL);
anonAtom = createDefinedAtomAndAssignRelocations(
"", *sectionName, sym, section, symbolData, *sectionContents);
- anonAtom->setOrdinal(++_ordinal);
symbolData = ArrayRef<uint8_t>();
// If this is the last atom, let's not create a followon reference.
@@ -728,8 +727,10 @@ template <class ELFT> std::error_code ELFFile<ELFT>::createAtoms() {
_definedAtoms._atoms.push_back(newAtom);
_symbolToAtomMapping.insert(std::make_pair(&*symbol, newAtom));
- if (anonAtom)
+ if (anonAtom) {
+ anonAtom->setOrdinal(++_ordinal);
_definedAtoms._atoms.push_back(anonAtom);
+ }
}
}
OpenPOWER on IntegriCloud