Lines Matching refs:sym

22 static bool requiresGOTAccess(const Symbol *sym) {  in requiresGOTAccess()  argument
26 if (sym->isHidden() || sym->isLocal()) in requiresGOTAccess()
30 if (sym->isDefined() && (!config->shared || config->bsymbolic)) in requiresGOTAccess()
35 static bool allowUndefined(const Symbol* sym) { in allowUndefined() argument
38 if (sym->importName) in allowUndefined()
40 if (isa<UndefinedFunction>(sym) && config->importUndefined) in allowUndefined()
43 return config->allowUndefinedSymbols.count(sym->getName()) != 0; in allowUndefined()
46 static void reportUndefined(Symbol *sym) { in reportUndefined() argument
47 if (!allowUndefined(sym)) { in reportUndefined()
50 error(toString(sym->getFile()) + ": undefined symbol: " + toString(*sym)); in reportUndefined()
53 warn(toString(sym->getFile()) + ": undefined symbol: " + toString(*sym)); in reportUndefined()
56 LLVM_DEBUG(dbgs() << "ignoring undefined symbol: " + toString(*sym) + in reportUndefined()
59 if (auto *f = dyn_cast<UndefinedFunction>(sym)) { in reportUndefined()
76 static void addGOTEntry(Symbol *sym) { in addGOTEntry() argument
77 if (requiresGOTAccess(sym)) in addGOTEntry()
78 out.importSec->addGOTEntry(sym); in addGOTEntry()
80 out.globalSec->addInternalGOTEntry(sym); in addGOTEntry()
98 Symbol *sym = file->getSymbols()[reloc.Index]; in scanRelocations() local
107 if (requiresGOTAccess(sym)) in scanRelocations()
109 out.elemSec->addEntry(cast<FunctionSymbol>(sym)); in scanRelocations()
113 if (!isa<GlobalSymbol>(sym)) in scanRelocations()
114 addGOTEntry(sym); in scanRelocations()
118 if (!sym->isDefined()) { in scanRelocations()
120 " cannot be used against an undefined symbol `" + toString(*sym) + in scanRelocations()
127 if (!sym->isTLS()) { in scanRelocations()
130 " cannot be used against non-TLS symbol `" + toString(*sym) + in scanRelocations()
133 if (auto *D = dyn_cast<DefinedData>(sym)) { in scanRelocations()
137 toString(*sym) + in scanRelocations()
146 (sym->isUndefined() && in scanRelocations()
158 " cannot be used against symbol `" + toString(*sym) + in scanRelocations()
168 if (requiresGOTAccess(sym)) in scanRelocations()
169 addGOTEntry(sym); in scanRelocations()
172 } else if (sym->isUndefined() && !config->relocatable && !sym->isWeak()) { in scanRelocations()
174 reportUndefined(sym); in scanRelocations()