Lines Matching refs:sym

316 std::string InputSectionBase::getSrcMsg(const Symbol &sym,  in getSrcMsg()  argument
318 return file->getSrcMsg(sym, *this, offset); in getSrcMsg()
444 Symbol &sym = *rel.sym; in copyRelocations() local
455 p->setSymbolAndType(in.symTab->getSymbolIndex(sym), type, in copyRelocations()
458 if (sym.type == STT_SECTION) { in copyRelocations()
471 auto *d = dyn_cast<Defined>(&sym); in copyRelocations()
476 uint32_t secIdx = cast<Undefined>(sym).discardedSecIdx; in copyRelocations()
494 target.getRelExpr(type, sym, bufLoc) == R_MIPS_GOTREL) { in copyRelocations()
510 p->r_addend = sym.getVA(addend) - section->getOutputSection()->addr; in copyRelocations()
518 sec->addReloc({R_ABS, type, rel.offset, addend, &sym}); in copyRelocations()
617 static uint64_t getARMStaticBase(const Symbol &sym) { in getARMStaticBase() argument
618 OutputSection *os = sym.getOutputSection(); in getARMStaticBase()
620 fatal("SBREL relocation to " + sym.getName() + " without static base"); in getARMStaticBase()
630 static Relocation *getRISCVPCRelHi20(const Symbol *sym, uint64_t addend) { in getRISCVPCRelHi20() argument
631 const Defined *d = cast<Defined>(sym); in getRISCVPCRelHi20()
634 sym->getName()); in getRISCVPCRelHi20()
720 const Symbol &sym, RelExpr expr) { in getRelocTargetVA() argument
729 return sym.getVA(a); in getRelocTargetVA()
735 return sym.getVA(a) - getARMStaticBase(sym); in getRelocTargetVA()
738 return sym.getGotVA() + a; in getRelocTargetVA()
743 if (sym.hasFlag(NEEDS_TLSGD) && type != R_LARCH_TLS_IE_PC_LO12) in getRelocTargetVA()
745 return in.got->getGlobalDynAddr(sym) + a; in getRelocTargetVA()
746 return getRelocTargetVA(file, type, a, p, sym, R_GOT); in getRelocTargetVA()
753 return sym.getVA(a) - in.got->getVA(); in getRelocTargetVA()
755 return sym.getVA(a) - in.gotPlt->getVA(); in getRelocTargetVA()
758 return sym.getGotVA() + a - in.gotPlt->getVA(); in getRelocTargetVA()
762 return sym.getGotOffset() + a; in getRelocTargetVA()
765 return getAArch64Page(sym.getGotVA() + a) - getAArch64Page(p); in getRelocTargetVA()
767 return sym.getGotVA() + a - getAArch64Page(in.got->getVA()); in getRelocTargetVA()
770 return sym.getGotVA() + a - p; in getRelocTargetVA()
772 return sym.getGotPltVA() + a - in.got->getVA(); in getRelocTargetVA()
774 return sym.getGotPltVA() + a - p; in getRelocTargetVA()
776 if (sym.hasFlag(NEEDS_TLSGD)) in getRelocTargetVA()
777 return getLoongArchPageDelta(in.got->getGlobalDynAddr(sym) + a, p, type); in getRelocTargetVA()
778 return getLoongArchPageDelta(sym.getGotVA() + a, p, type); in getRelocTargetVA()
780 return sym.getVA(a) - in.mipsGot->getGp(file); in getRelocTargetVA()
802 return in.mipsGot->getVA() + in.mipsGot->getPageEntryOffset(file, sym, a) - in getRelocTargetVA()
809 return in.mipsGot->getVA() + in.mipsGot->getSymEntryOffset(file, sym, a) - in getRelocTargetVA()
812 return in.mipsGot->getVA() + in.mipsGot->getGlobalDynOffset(file, sym) - in getRelocTargetVA()
818 uint64_t val = sym.isUndefWeak() ? p + a : sym.getVA(a); in getRelocTargetVA()
822 if (const Relocation *hiRel = getRISCVPCRelHi20(&sym, a)) in getRelocTargetVA()
823 return getRelocTargetVA(file, hiRel->type, hiRel->addend, sym.getVA(), in getRelocTargetVA()
824 *hiRel->sym, hiRel->expr); in getRelocTargetVA()
828 return getLoongArchPageDelta(sym.getVA(a), p, type); in getRelocTargetVA()
835 if (sym.isUndefined()) { in getRelocTargetVA()
851 dest = sym.getVA(a); in getRelocTargetVA()
853 dest = sym.getVA(a); in getRelocTargetVA()
858 return sym.getPltVA() + a; in getRelocTargetVA()
861 return sym.getPltVA() + a - p; in getRelocTargetVA()
863 return getLoongArchPageDelta(sym.getPltVA() + a, p, type); in getRelocTargetVA()
865 return sym.getPltVA() + a - in.gotPlt->getVA(); in getRelocTargetVA()
867 return sym.getPltVA() + a - in.got->getVA(); in getRelocTargetVA()
872 return sym.getPltVA() - p; in getRelocTargetVA()
874 uint64_t symVA = sym.getVA(a); in getRelocTargetVA()
887 return symVA - p + getPPC64GlobalEntryToLocalEntryOffset(sym.stOther); in getRelocTargetVA()
893 return sym.getVA(a) - p; in getRelocTargetVA()
902 if (sym.isUndefined()) in getRelocTargetVA()
904 return getTlsTpOffset(sym) + a; in getRelocTargetVA()
907 if (sym.isUndefined()) in getRelocTargetVA()
909 return -getTlsTpOffset(sym) + a; in getRelocTargetVA()
911 return sym.getSize() + a; in getRelocTargetVA()
913 return in.got->getTlsDescAddr(sym) + a; in getRelocTargetVA()
915 return in.got->getTlsDescAddr(sym) + a - p; in getRelocTargetVA()
917 return in.got->getTlsDescAddr(sym) + a - in.gotPlt->getVA(); in getRelocTargetVA()
919 return getAArch64Page(in.got->getTlsDescAddr(sym) + a) - getAArch64Page(p); in getRelocTargetVA()
921 return getLoongArchPageDelta(in.got->getTlsDescAddr(sym) + a, p, type); in getRelocTargetVA()
923 return in.got->getGlobalDynOffset(sym) + a; in getRelocTargetVA()
925 return in.got->getGlobalDynAddr(sym) + a - in.gotPlt->getVA(); in getRelocTargetVA()
927 return in.got->getGlobalDynAddr(sym) + a - p; in getRelocTargetVA()
929 return getLoongArchPageDelta(in.got->getGlobalDynAddr(sym) + a, p, type); in getRelocTargetVA()
980 Symbol &sym = f->getRelocTargetSym(rel); in relocateNonAlloc() local
981 RelExpr expr = target.getRelExpr(type, sym, bufLoc); in relocateNonAlloc()
984 auto *ds = dyn_cast<Defined>(&sym); in relocateNonAlloc()
994 val = sym.getVA(addend) - in relocateNonAlloc()
1000 lld::toString(sym) + "'"); in relocateNonAlloc()
1054 if (config->relocatable && (RelTy::HasAddend || sym.type != STT_SECTION)) in relocateNonAlloc()
1061 target.relocateNoSym(bufLoc, type, SignExtend64<bits>(sym.getVA(addend))); in relocateNonAlloc()
1067 SignExtend64<bits>(sym.getSize() + addend)); in relocateNonAlloc()
1072 toString(type) + " against symbol '" + toString(sym) + in relocateNonAlloc()
1094 SignExtend64<bits>(sym.getVA(addend - offset - outSecOff))); in relocateNonAlloc()
1146 (*it)->sym = moreStackNonSplit; in switchMorestackCallsToMorestackNonSplit()
1172 if (rel.sym->getName().starts_with("__morestack")) { in adjustSplitStackFunctionPrologues()
1173 if (rel.sym->getName() == "__morestack") in adjustSplitStackFunctionPrologues()
1181 if (rel.sym->type != STT_FUNC) in adjustSplitStackFunctionPrologues()
1189 if (Defined *d = dyn_cast<Defined>(rel.sym)) in adjustSplitStackFunctionPrologues()
1204 " (with -fsplit-stack) calls " + rel.sym->getName() + in adjustSplitStackFunctionPrologues()