Lines Matching refs:sym
280 std::string InputSectionBase::getSrcMsg(const Symbol &sym, in getSrcMsg() argument
282 return file->getSrcMsg(sym, *this, offset); in getSrcMsg()
400 Symbol &sym = *rel.sym; in copyRelocations() local
411 p->setSymbolAndType(in.symTab->getSymbolIndex(&sym), type, in copyRelocations()
414 if (sym.type == STT_SECTION) { in copyRelocations()
427 auto *d = dyn_cast<Defined>(&sym); in copyRelocations()
432 uint32_t secIdx = cast<Undefined>(sym).discardedSecIdx; in copyRelocations()
450 target.getRelExpr(type, sym, bufLoc) == R_MIPS_GOTREL) { in copyRelocations()
466 p->r_addend = sym.getVA(addend) - section->getOutputSection()->addr; in copyRelocations()
474 sec->addReloc({R_ABS, type, rel.offset, addend, &sym}); in copyRelocations()
573 static uint64_t getARMStaticBase(const Symbol &sym) { in getARMStaticBase() argument
574 OutputSection *os = sym.getOutputSection(); in getARMStaticBase()
576 fatal("SBREL relocation to " + sym.getName() + " without static base"); in getARMStaticBase()
586 static Relocation *getRISCVPCRelHi20(const Symbol *sym, uint64_t addend) { in getRISCVPCRelHi20() argument
587 const Defined *d = cast<Defined>(sym); in getRISCVPCRelHi20()
590 sym->getName()); in getRISCVPCRelHi20()
671 const Symbol &sym, RelExpr expr) { in getRelocTargetVA() argument
679 return sym.getVA(a); in getRelocTargetVA()
685 return sym.getVA(a) - getARMStaticBase(sym); in getRelocTargetVA()
688 return sym.getGotVA() + a; in getRelocTargetVA()
693 if (sym.hasFlag(NEEDS_TLSGD) && type != R_LARCH_TLS_IE_PC_LO12) in getRelocTargetVA()
695 return in.got->getGlobalDynAddr(sym) + a; in getRelocTargetVA()
696 return getRelocTargetVA(file, type, a, p, sym, R_GOT); in getRelocTargetVA()
703 return sym.getVA(a) - in.got->getVA(); in getRelocTargetVA()
705 return sym.getVA(a) - in.gotPlt->getVA(); in getRelocTargetVA()
708 return sym.getGotVA() + a - in.gotPlt->getVA(); in getRelocTargetVA()
712 return sym.getGotOffset() + a; in getRelocTargetVA()
715 return getAArch64Page(sym.getGotVA() + a) - getAArch64Page(p); in getRelocTargetVA()
717 return sym.getGotVA() + a - getAArch64Page(in.got->getVA()); in getRelocTargetVA()
720 return sym.getGotVA() + a - p; in getRelocTargetVA()
722 return sym.getGotPltVA() + a - in.got->getVA(); in getRelocTargetVA()
724 return sym.getGotPltVA() + a - p; in getRelocTargetVA()
726 if (sym.hasFlag(NEEDS_TLSGD)) in getRelocTargetVA()
727 return getLoongArchPageDelta(in.got->getGlobalDynAddr(sym) + a, p, type); in getRelocTargetVA()
728 return getLoongArchPageDelta(sym.getGotVA() + a, p, type); in getRelocTargetVA()
730 return sym.getVA(a) - in.mipsGot->getGp(file); in getRelocTargetVA()
752 return in.mipsGot->getVA() + in.mipsGot->getPageEntryOffset(file, sym, a) - in getRelocTargetVA()
759 return in.mipsGot->getVA() + in.mipsGot->getSymEntryOffset(file, sym, a) - in getRelocTargetVA()
762 return in.mipsGot->getVA() + in.mipsGot->getGlobalDynOffset(file, sym) - in getRelocTargetVA()
768 uint64_t val = sym.isUndefWeak() ? p + a : sym.getVA(a); in getRelocTargetVA()
772 if (const Relocation *hiRel = getRISCVPCRelHi20(&sym, a)) in getRelocTargetVA()
773 return getRelocTargetVA(file, hiRel->type, hiRel->addend, sym.getVA(), in getRelocTargetVA()
774 *hiRel->sym, hiRel->expr); in getRelocTargetVA()
778 return getLoongArchPageDelta(sym.getVA(a), p, type); in getRelocTargetVA()
785 if (sym.isUndefined()) { in getRelocTargetVA()
801 dest = sym.getVA(a); in getRelocTargetVA()
803 dest = sym.getVA(a); in getRelocTargetVA()
808 return sym.getPltVA() + a; in getRelocTargetVA()
811 return sym.getPltVA() + a - p; in getRelocTargetVA()
813 return getLoongArchPageDelta(sym.getPltVA() + a, p, type); in getRelocTargetVA()
815 return sym.getPltVA() + a - in.gotPlt->getVA(); in getRelocTargetVA()
817 return sym.getPltVA() + a - in.got->getVA(); in getRelocTargetVA()
822 return sym.getPltVA() - p; in getRelocTargetVA()
824 uint64_t symVA = sym.getVA(a); in getRelocTargetVA()
837 return symVA - p + getPPC64GlobalEntryToLocalEntryOffset(sym.stOther); in getRelocTargetVA()
843 return sym.getVA(a) - p; in getRelocTargetVA()
852 if (sym.isUndefined()) in getRelocTargetVA()
854 return getTlsTpOffset(sym) + a; in getRelocTargetVA()
857 if (sym.isUndefined()) in getRelocTargetVA()
859 return -getTlsTpOffset(sym) + a; in getRelocTargetVA()
861 return sym.getSize() + a; in getRelocTargetVA()
863 return in.got->getTlsDescAddr(sym) + a; in getRelocTargetVA()
865 return in.got->getTlsDescAddr(sym) + a - p; in getRelocTargetVA()
867 return in.got->getTlsDescAddr(sym) + a - in.gotPlt->getVA(); in getRelocTargetVA()
869 return getAArch64Page(in.got->getTlsDescAddr(sym) + a) - getAArch64Page(p); in getRelocTargetVA()
871 return in.got->getGlobalDynOffset(sym) + a; in getRelocTargetVA()
873 return in.got->getGlobalDynAddr(sym) + a - in.gotPlt->getVA(); in getRelocTargetVA()
875 return in.got->getGlobalDynAddr(sym) + a - p; in getRelocTargetVA()
877 return getLoongArchPageDelta(in.got->getGlobalDynAddr(sym) + a, p, type); in getRelocTargetVA()
927 Symbol &sym = getFile<ELFT>()->getRelocTargetSym(rel); in relocateNonAlloc() local
928 RelExpr expr = target.getRelExpr(type, sym, bufLoc); in relocateNonAlloc()
931 auto *ds = dyn_cast<Defined>(&sym); in relocateNonAlloc()
941 val = sym.getVA(addend) - in relocateNonAlloc()
948 lld::toString(sym) + "'"); in relocateNonAlloc()
1001 if (config->relocatable && (RelTy::IsRela || sym.type != STT_SECTION)) in relocateNonAlloc()
1008 target.relocateNoSym(bufLoc, type, SignExtend64<bits>(sym.getVA(addend))); in relocateNonAlloc()
1014 SignExtend64<bits>(sym.getSize() + addend)); in relocateNonAlloc()
1019 toString(type) + " against symbol '" + toString(sym) + in relocateNonAlloc()
1041 SignExtend64<bits>(sym.getVA(addend - offset - outSecOff))); in relocateNonAlloc()
1097 (*it)->sym = moreStackNonSplit; in switchMorestackCallsToMorestackNonSplit()
1123 if (rel.sym->getName().starts_with("__morestack")) { in adjustSplitStackFunctionPrologues()
1124 if (rel.sym->getName().equals("__morestack")) in adjustSplitStackFunctionPrologues()
1132 if (rel.sym->type != STT_FUNC) in adjustSplitStackFunctionPrologues()
1140 if (Defined *d = dyn_cast<Defined>(rel.sym)) in adjustSplitStackFunctionPrologues()
1155 " (with -fsplit-stack) calls " + rel.sym->getName() + in adjustSplitStackFunctionPrologues()