Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
lld/wasm/Relocations.cpp
Show All 26 Lines | static bool requiresGOTAccess(const Symbol *sym) { | ||||
// With `-Bsymbolic` (or when building an executable) as don't need to use | // With `-Bsymbolic` (or when building an executable) as don't need to use | ||||
// the GOT for symbols that are defined within the current module. | // the GOT for symbols that are defined within the current module. | ||||
if (sym->isDefined() && (!config->shared || config->bsymbolic)) | if (sym->isDefined() && (!config->shared || config->bsymbolic)) | ||||
return false; | return false; | ||||
return true; | return true; | ||||
} | } | ||||
static bool allowUndefined(const Symbol* sym) { | static bool allowUndefined(const Symbol* sym) { | ||||
// Symbols with explicit import names are always allowed to be undefined at | // Symbols that are explicitly imported are always allowed to be undefined at | ||||
// link time. | // link time. | ||||
if (sym->importName) | if (sym->isImported()) | ||||
return true; | return true; | ||||
if (isa<UndefinedFunction>(sym) && config->importUndefined) | if (isa<UndefinedFunction>(sym) && config->importUndefined) | ||||
return true; | return true; | ||||
return config->allowUndefinedSymbols.count(sym->getName()) != 0; | return config->allowUndefinedSymbols.count(sym->getName()) != 0; | ||||
} | } | ||||
static void reportUndefined(Symbol *sym) { | static void reportUndefined(Symbol *sym) { | ||||
▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines |