diff options
author | Pete Cooper <peter_cooper@apple.com> | 2016-08-11 20:10:14 +0000 |
---|---|---|
committer | Pete Cooper <peter_cooper@apple.com> | 2016-08-11 20:10:14 +0000 |
commit | 46cd113c871761c0c4831a44022ac2e1098d7b03 (patch) | |
tree | f3821ea348a22ed3efb382cdee19c2faf56ffd88 /lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp | |
parent | 610adaeec4557013b441960dc6ba1b6a72c1d337 (diff) | |
download | bcm5719-llvm-46cd113c871761c0c4831a44022ac2e1098d7b03.tar.gz bcm5719-llvm-46cd113c871761c0c4831a44022ac2e1098d7b03.zip |
Change when we choose to add an LC_LOAD_DYLIB to the final image.
Currently we do this when an atom is used, but we need to do it when a
dylib is referenced on the cmdline as this matches ld64.
This fixes much confusion over which maps are indexed with installName
vs path. There is likely other confusion so i'll be seeing if i can remove
path() completely in a future commit as path() shouldn't really be needed by anyone.
llvm-svn: 278396
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp')
-rw-r--r-- | lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp b/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp index ebd4bf3abf9..1fb66558aa3 100644 --- a/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp +++ b/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp @@ -772,7 +772,10 @@ void MachOLinkingContext::createImplicitFiles( void MachOLinkingContext::registerDylib(MachODylibFile *dylib, bool upward) const { std::lock_guard<std::mutex> lock(_dylibsMutex); - _allDylibs.insert(dylib); + + if (std::find(_allDylibs.begin(), + _allDylibs.end(), dylib) == _allDylibs.end()) + _allDylibs.push_back(dylib); _pathToDylibMap[dylib->installName()] = dylib; // If path is different than install name, register path too. if (!dylib->path().equals(dylib->installName())) |