Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions llvm/lib/Support/DynamicLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class DynamicLibrary::HandleSet {
typedef std::vector<void *> HandleList;
HandleList Handles;
void *Process = nullptr;
bool ProcessAdded = false;

public:
static void *DLOpen(const char *Filename, std::string *Err);
Expand Down Expand Up @@ -66,6 +67,7 @@ class DynamicLibrary::HandleSet {
}
#endif
Process = Handle;
ProcessAdded = true;
}
return true;
}
Expand Down Expand Up @@ -97,11 +99,11 @@ class DynamicLibrary::HandleSet {
assert(!((Order & SO_LoadedFirst) && (Order & SO_LoadedLast)) &&
"Invalid Ordering");

if (!Process || (Order & SO_LoadedFirst)) {
if (!ProcessAdded || (Order & SO_LoadedFirst)) {
if (void *Ptr = LibLookup(Symbol, Order))
return Ptr;
}
if (Process) {
if (ProcessAdded) {
// Use OS facilities to search the current binary and all loaded libs.
if (void *Ptr = DLSym(Process, Symbol))
return Ptr;
Expand Down
Loading