Lines Matching defs:sym
21 static bool requiresGOTAccess(const Symbol *sym) {
22 if (sym->isShared())
27 if (sym->isHidden() || sym->isLocal())
31 if (sym->isDefined() && (!ctx.arg.shared || ctx.arg.bsymbolic))
36 static bool allowUndefined(const Symbol* sym) {
39 if (sym->isImported())
41 if (isa<UndefinedFunction>(sym) && ctx.arg.importUndefined)
44 return ctx.arg.allowUndefinedSymbols.count(sym->getName()) != 0;
47 static void reportUndefined(ObjFile *file, Symbol *sym) {
48 if (!allowUndefined(sym)) {
51 error(toString(file) + ": undefined symbol: " + toString(*sym));
54 warn(toString(file) + ": undefined symbol: " + toString(*sym));
57 LLVM_DEBUG(dbgs() << "ignoring undefined symbol: " + toString(*sym) +
64 if (auto *f = dyn_cast<UndefinedFunction>(sym)) {
78 static void addGOTEntry(Symbol *sym) {
79 if (requiresGOTAccess(sym))
80 out.importSec->addGOTEntry(sym);
82 out.globalSec->addInternalGOTEntry(sym);
100 Symbol *sym = file->getSymbols()[reloc.Index];
109 if (requiresGOTAccess(sym))
111 out.elemSec->addEntry(cast<FunctionSymbol>(sym));
115 if (!isa<GlobalSymbol>(sym))
116 addGOTEntry(sym);
120 if (!sym->isDefined()) {
122 " cannot be used against an undefined symbol `" + toString(*sym) +
129 if (!sym->isTLS()) {
132 " cannot be used against non-TLS symbol `" + toString(*sym) +
135 if (auto *D = dyn_cast<DefinedData>(sym)) {
139 toString(*sym) +
147 if (ctx.isPic || sym->isShared() ||
148 (sym->isUndefined() &&
160 " cannot be used against symbol `" + toString(*sym) +
170 if (requiresGOTAccess(sym))
171 addGOTEntry(sym);
176 if (!ctx.arg.relocatable && sym->isUndefined()) {
187 toString(*sym) + "`");
191 if (!sym->isWeak()) {
193 reportUndefined(file, sym);