Lines Matching refs:sec

54   void enqueue(InputSectionBase *sec, uint64_t offset);
59 void resolveReloc(InputSectionBase &sec, RelTy &rel, bool isLSDA);
77 static uint64_t getAddend(InputSectionBase &sec, in getAddend() argument
79 return target->getImplicitAddend(sec.data().begin() + rel.r_offset, in getAddend()
84 static uint64_t getAddend(InputSectionBase &sec, in getAddend() argument
91 void MarkLive<ELFT>::resolveReloc(InputSectionBase &sec, RelTy &rel, in resolveReloc() argument
93 Symbol &sym = sec.getFile<ELFT>()->getRelocTargetSym(rel); in resolveReloc()
105 offset += getAddend<ELFT>(sec, rel); in resolveReloc()
116 for (InputSectionBase *sec : cNamedSections.lookup(sym.getName())) in resolveReloc()
117 enqueue(sec, 0); in resolveReloc()
164 static bool isReserved(InputSectionBase *sec) { in isReserved() argument
165 switch (sec->type) { in isReserved()
172 return !sec->nextInSectionGroup; in isReserved()
174 StringRef s = sec->name; in isReserved()
182 void MarkLive<ELFT>::enqueue(InputSectionBase *sec, uint64_t offset) { in enqueue() argument
187 if (sec == &InputSection::discarded) in enqueue()
193 if (auto *ms = dyn_cast<MergeInputSection>(sec)) in enqueue()
199 if (sec->partition == 1 || sec->partition == partition) in enqueue()
201 sec->partition = sec->partition ? 1 : partition; in enqueue()
204 if (InputSection *s = dyn_cast<InputSection>(sec)) in enqueue()
242 for (InputSectionBase *sec : inputSections) { in run()
247 if (auto *eh = dyn_cast<EhInputSection>(sec)) { in run()
258 if (sec->flags & SHF_LINK_ORDER) in run()
261 if (isReserved(sec) || script->shouldKeep(sec)) { in run()
262 enqueue(sec, 0); in run()
263 } else if (isValidCIdentifier(sec->name)) { in run()
264 cNamedSections[saver.save("__start_" + sec->name)].push_back(sec); in run()
265 cNamedSections[saver.save("__stop_" + sec->name)].push_back(sec); in run()
275 InputSectionBase &sec = *queue.pop_back_val(); in mark() local
277 if (sec.areRelocsRela) { in mark()
278 for (const typename ELFT::Rela &rel : sec.template relas<ELFT>()) in mark()
279 resolveReloc(sec, rel, false); in mark()
281 for (const typename ELFT::Rel &rel : sec.template rels<ELFT>()) in mark()
282 resolveReloc(sec, rel, false); in mark()
285 for (InputSectionBase *isec : sec.dependentSections) in mark()
289 if (sec.nextInSectionGroup) in mark()
290 enqueue(sec.nextInSectionGroup, 0); in mark()
311 for (InputSectionBase *sec : inputSections) { in moveToMain()
312 if (!sec->isLive() || !isValidCIdentifier(sec->name)) in moveToMain()
314 if (symtab->find(("__start_" + sec->name).str()) || in moveToMain()
315 symtab->find(("__stop_" + sec->name).str())) in moveToMain()
316 enqueue(sec, 0); in moveToMain()
329 for (InputSectionBase *sec : inputSections) in markLive()
330 sec->markLive(); in markLive()
368 for (InputSectionBase *sec : inputSections) { in markLive()
369 bool isAlloc = (sec->flags & SHF_ALLOC); in markLive()
370 bool isLinkOrder = (sec->flags & SHF_LINK_ORDER); in markLive()
371 bool isRel = (sec->type == SHT_REL || sec->type == SHT_RELA); in markLive()
373 if (!isAlloc && !isLinkOrder && !isRel && !sec->nextInSectionGroup) { in markLive()
374 sec->markLive(); in markLive()
375 for (InputSection *isec : sec->dependentSections) in markLive()
392 for (InputSectionBase *sec : inputSections) in markLive()
393 if (!sec->isLive()) in markLive()
394 message("removing unused section " + toString(sec)); in markLive()