[ELF] Make addressOfAtom thread safe.

The expression _atomToAddressMap[atom] may modify _atomToAddressMap.

llvm-svn: 182793
This commit is contained in:
Michael J. Spencer 2013-05-28 19:09:25 +00:00
parent 0d9d3110c7
commit 9ae1408556
1 changed files with 2 additions and 1 deletions

View File

@ -84,7 +84,8 @@ protected:
// This is called by the write section to apply relocations
virtual uint64_t addressOfAtom(const Atom *atom) {
return _atomToAddressMap[atom];
auto addr = _atomToAddressMap.find(atom);
return addr == _atomToAddressMap.end() ? 0 : addr->second;
}
// This is a hook for creating default dynamic entries