[lld] r227168 - Fix incorrect atom ordinal.
Rui Ueyama
ruiu at google.com
Mon Jan 26 19:05:34 PST 2015
Author: ruiu
Date: Mon Jan 26 21:05:34 2015
New Revision: 227168
URL: http://llvm.org/viewvc/llvm-project?rev=227168&view=rev
Log:
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.
Modified:
lld/trunk/lib/ReaderWriter/ELF/ELFFile.h
Modified: lld/trunk/lib/ReaderWriter/ELF/ELFFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ELFFile.h?rev=227168&r1=227167&r2=227168&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ELFFile.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ELFFile.h Mon Jan 26 21:05:34 2015
@@ -687,7 +687,6 @@ template <class ELFT> std::error_code EL
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 EL
_definedAtoms._atoms.push_back(newAtom);
_symbolToAtomMapping.insert(std::make_pair(&*symbol, newAtom));
- if (anonAtom)
+ if (anonAtom) {
+ anonAtom->setOrdinal(++_ordinal);
_definedAtoms._atoms.push_back(anonAtom);
+ }
}
}
More information about the llvm-commits
mailing list