Lines Matching refs:Sec
46 static typename ELFT::uint getAddend(InputSectionBase &Sec, in getAddend() argument
48 return Target->getImplicitAddend(Sec.data().begin() + Rel.r_offset, in getAddend()
53 static typename ELFT::uint getAddend(InputSectionBase &Sec, in getAddend() argument
64 resolveReloc(InputSectionBase &Sec, RelT &Rel, in resolveReloc() argument
66 Symbol &B = Sec.getFile<ELFT>()->getRelocTargetSym(Rel); in resolveReloc()
80 Offset += getAddend<ELFT>(Sec, Rel); in resolveReloc()
86 for (InputSectionBase *Sec : CNamedSections.lookup(B.getName())) in resolveReloc()
87 Fn(Sec, 0); in resolveReloc()
93 forEachSuccessor(InputSection &Sec, in forEachSuccessor() argument
95 if (Sec.AreRelocsRela) { in forEachSuccessor()
96 for (const typename ELFT::Rela &Rel : Sec.template relas<ELFT>()) in forEachSuccessor()
97 resolveReloc<ELFT>(Sec, Rel, Fn); in forEachSuccessor()
99 for (const typename ELFT::Rel &Rel : Sec.template rels<ELFT>()) in forEachSuccessor()
100 resolveReloc<ELFT>(Sec, Rel, Fn); in forEachSuccessor()
103 for (InputSectionBase *IS : Sec.DependentSections) in forEachSuccessor()
147 [&](InputSectionBase *Sec, uint64_t Offset) { in scanEhFrameSection() argument
148 if (Sec && Sec != &InputSection::Discarded && in scanEhFrameSection()
149 !(Sec->Flags & SHF_EXECINSTR)) in scanEhFrameSection()
150 Fn(Sec, 0); in scanEhFrameSection()
172 template <class ELFT> static bool isReserved(InputSectionBase *Sec) { in isReserved() argument
173 switch (Sec->Type) { in isReserved()
180 StringRef S = Sec->Name; in isReserved()
194 auto Enqueue = [&](InputSectionBase *Sec, uint64_t Offset) { in doGcSections() argument
199 if (Sec == &InputSection::Discarded) in doGcSections()
206 if (auto *MS = dyn_cast<MergeInputSection>(Sec)) in doGcSections()
209 if (Sec->Live) in doGcSections()
211 Sec->Live = true; in doGcSections()
214 if (InputSection *S = dyn_cast<InputSection>(Sec)) in doGcSections()
241 for (InputSectionBase *Sec : InputSections) { in doGcSections()
246 if (auto *EH = dyn_cast<EhInputSection>(Sec)) { in doGcSections()
251 if (Sec->Flags & SHF_LINK_ORDER) in doGcSections()
254 if (isReserved<ELFT>(Sec) || Script->shouldKeep(Sec)) { in doGcSections()
255 Enqueue(Sec, 0); in doGcSections()
256 } else if (isValidCIdentifier(Sec->Name)) { in doGcSections()
257 CNamedSections[Saver.save("__start_" + Sec->Name)].push_back(Sec); in doGcSections()
258 CNamedSections[Saver.save("__stop_" + Sec->Name)].push_back(Sec); in doGcSections()
273 for (InputSectionBase *Sec : InputSections) in markLive()
274 Sec->Live = true; in markLive()
303 for (InputSectionBase *Sec : InputSections) { in markLive()
304 bool IsAlloc = (Sec->Flags & SHF_ALLOC); in markLive()
305 bool IsLinkOrder = (Sec->Flags & SHF_LINK_ORDER); in markLive()
306 bool IsRel = (Sec->Type == SHT_REL || Sec->Type == SHT_RELA); in markLive()
308 Sec->Live = true; in markLive()
316 for (InputSectionBase *Sec : InputSections) in markLive()
317 if (!Sec->Live) in markLive()
318 message("removing unused section " + toString(Sec)); in markLive()