Skip to content
Open
Changes from all commits
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
11 changes: 9 additions & 2 deletions NativeScript/runtime/SymbolLoader.mm
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,23 @@ virtual bool load() override {
}

void* SymbolLoader::loadFunctionSymbol(const ModuleMeta* module, const char* symbolName) {
// An iOS app on a Mac opens /System/Library/Frameworks bundles that do not carry
// the iOS symbols (those live under /System/iOSSupport), so a miss falls through
// to the process-wide lookup. Applies to loadDataSymbol too.
if (auto resolver = this->resolveModule(module)) {
return resolver->loadFunctionSymbol(symbolName);
if (void* symbol = resolver->loadFunctionSymbol(symbolName)) {
return symbol;
}
}

return dlsym(RTLD_DEFAULT, symbolName);
}

void* SymbolLoader::loadDataSymbol(const ModuleMeta* module, const char* symbolName) {
if (auto resolver = this->resolveModule(module)) {
return resolver->loadDataSymbol(symbolName);
if (void* symbol = resolver->loadDataSymbol(symbolName)) {
return symbol;
}
}

return dlsym(RTLD_DEFAULT, symbolName);
Expand Down
Loading