Lines Matching defs:expr
155 // expr and use a simple shift and bitwise-and to test for membership.
156 template <RelExpr... Exprs> static bool oneof(RelExpr expr) {
157 assert(0 <= expr && (int)expr < 128 &&
160 if (expr >= 64)
161 return (uint64_t(1) << (expr - 64)) & buildMask((Exprs - 64)...);
162 return (uint64_t(1) << expr) & buildMask(Exprs...);
205 static bool needsPlt(RelExpr expr) {
208 R_PPC64_CALL_PLT>(expr);
211 bool lld::elf::needsGot(RelExpr expr) {
215 expr);
220 static bool isRelExpr(RelExpr expr) {
224 R_LOONGARCH_PAGE_PC>(expr);
227 static RelExpr toPlt(RelExpr expr) {
228 switch (expr) {
240 return expr;
244 static RelExpr fromPlt(RelExpr expr) {
247 switch (expr) {
262 return expr;
474 int64_t computeMipsAddend(const RelTy &rel, RelExpr expr, bool isLocal) const;
477 void processAux(RelExpr expr, RelType type, uint64_t offset, Symbol &sym,
490 int64_t RelocationScanner::computeMipsAddend(const RelTy &rel, RelExpr expr,
492 if (expr == R_MIPS_GOTREL && isLocal)
873 Symbol &sym, int64_t addend, RelExpr expr,
880 addend, type, expr);
890 isec.relocations.push_back({expr, type, offsetInSec, addend, &sym});
901 isec.addReloc({expr, type, offsetInSec, addend, &sym});
910 sym, addend, type, expr);
1055 void RelocationScanner::processAux(RelExpr expr, RelType type, uint64_t offset,
1061 if (expr != R_GOT_PC) {
1064 if (config->emachine == EM_PPC && expr == R_PPC32_PLTREL)
1072 expr = fromPlt(expr);
1074 expr =
1078 if (expr == R_RELAX_GOT_PC)
1092 if (needsGot(expr)) {
1101 in.mipsGot->addEntry(*sec->file, sym, addend, expr);
1107 } else if (needsPlt(expr)) {
1127 if (isStaticLinkTimeConstant(expr, type, sym, offset) ||
1129 sec->addReloc({expr, type, offset, addend, &sym});
1144 if (oneof<R_GOT, R_LOONGARCH_GOT>(expr) ||
1146 addRelativeReloc<true>(*sec, offset, sym, addend, expr, type);
1164 sec->addReloc({expr, type, offset, addend, &sym});
1191 in.mipsGot->addEntry(*sec->file, sym, addend, expr);
1218 sec->addReloc({expr, type, offset, addend, &sym});
1230 // For the static linking part, we just return a plt expr and everything
1255 sec->addReloc({expr, type, offset, addend, &sym});
1274 int64_t addend, RelExpr expr) {
1275 if (expr == R_MIPS_TLSLD) {
1277 c.addReloc({expr, type, offset, addend, &sym});
1280 if (expr == R_MIPS_TLSGD) {
1282 c.addReloc({expr, type, offset, addend, &sym});
1297 int64_t addend, RelExpr expr) {
1298 if (expr == R_TPREL || expr == R_TPREL_NEG) {
1308 return handleMipsTlsRelocation(type, sym, c, offset, addend, expr);
1314 R_TLSDESC_CALL>(expr)) {
1315 if (expr != R_TLSDESC_CALL) {
1317 c.addReloc({expr, type, offset, addend, &sym});
1325 R_TLSDESC_GOTPLT>(expr) &&
1329 if (expr != R_TLSDESC_CALL) {
1332 c.addReloc({expr, type, offset, addend, &sym});
1345 !(isRISCV && expr != R_TLSDESC_PC && expr != R_TLSDESC_CALL) &&
1361 if (oneof<R_TLSLD_GOT, R_TLSLD_GOTPLT, R_TLSLD_PC, R_TLSLD_HINT>(expr)) {
1368 if (expr == R_TLSLD_HINT)
1371 c.addReloc({expr, type, offset, addend, &sym});
1376 if (expr == R_DTPREL) {
1378 expr = target->adjustTlsExpr(type, R_RELAX_TLS_LD_TO_LE);
1379 c.addReloc({expr, type, offset, addend, &sym});
1386 if (expr == R_TLSLD_GOT_OFF) {
1388 c.addReloc({expr, type, offset, addend, &sym});
1394 R_LOONGARCH_TLSGD_PAGE_PC>(expr)) {
1397 c.addReloc({expr, type, offset, addend, &sym});
1419 R_LOONGARCH_GOT_PAGE_PC, R_GOT_OFF, R_TLSIE_HINT>(expr)) {
1425 } else if (expr != R_TLSIE_HINT) {
1428 if (expr == R_GOT && config->isPic && !target->usesOnlyLowPageBits(type))
1429 addRelativeReloc<true>(c, offset, sym, addend, expr, type);
1431 c.addReloc({expr, type, offset, addend, &sym});
1462 RelExpr expr = target->getRelExpr(type, sym, sec->content().data() + offset);
1468 addend += computeMipsAddend<ELFT>(rel, expr, sym.isLocal());
1473 if (expr == R_NONE)
1500 if ((type == R_PPC64_TLSGD && expr == R_TLSDESC_CALL) ||
1501 (type == R_PPC64_TLSLD && expr == R_TLSLD_HINT)) {
1524 R_TLSDESC_GOTPLT, R_TLSGD_GOTPLT>(expr)) {
1527 R_PPC64_RELAX_TOC>(expr)) {
1536 if (sym.isTls() || oneof<R_TLSDESC_PC, R_TLSDESC_CALL>(expr)) {
1538 handleTlsRelocation(type, sym, *sec, offset, addend, expr)) {
1544 processAux(expr, type, offset, sym, addend);
2265 rel.expr = toPlt(rel.expr);
2320 if (!target->needsThunk(rel.expr, rel.type, isec->file, src,
2341 rel.expr = fromPlt(rel.expr);
2372 if (rel.sym->type == llvm::ELF::STT_TLS && rel.expr == R_PLT_PC) {
2389 if (rel.sym->type == llvm::ELF::STT_TLS && rel.expr == R_PLT_PC) {