Lines Matching refs:sec
54 void enqueue(InputSectionBase *sec, uint64_t offset);
59 void resolveReloc(InputSectionBase &sec, RelTy &rel, bool fromFDE);
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()
125 for (InputSectionBase *sec : cNamedSections.lookup(sym.getName())) in resolveReloc()
126 enqueue(sec, 0); in resolveReloc()
170 static bool isReserved(InputSectionBase *sec) { in isReserved() argument
171 switch (sec->type) { in isReserved()
178 return !sec->nextInSectionGroup; in isReserved()
180 StringRef s = sec->name; in isReserved()
188 void MarkLive<ELFT>::enqueue(InputSectionBase *sec, uint64_t offset) { in enqueue() argument
193 if (sec == &InputSection::discarded) in enqueue()
199 if (auto *ms = dyn_cast<MergeInputSection>(sec)) in enqueue()
205 if (sec->partition == 1 || sec->partition == partition) in enqueue()
207 sec->partition = sec->partition ? 1 : partition; in enqueue()
210 if (InputSection *s = dyn_cast<InputSection>(sec)) in enqueue()
248 for (InputSectionBase *sec : inputSections) { in run()
253 if (auto *eh = dyn_cast<EhInputSection>(sec)) { in run()
264 if (sec->flags & SHF_GNU_RETAIN) { in run()
265 enqueue(sec, 0); in run()
268 if (sec->flags & SHF_LINK_ORDER) in run()
271 if (isReserved(sec) || script->shouldKeep(sec)) { in run()
272 enqueue(sec, 0); in run()
273 } else if ((!config->zStartStopGC || sec->name.startswith("__libc_")) && in run()
274 isValidCIdentifier(sec->name)) { in run()
278 cNamedSections[saver.save("__start_" + sec->name)].push_back(sec); in run()
279 cNamedSections[saver.save("__stop_" + sec->name)].push_back(sec); in run()
289 InputSectionBase &sec = *queue.pop_back_val(); in mark() local
291 if (sec.areRelocsRela) { in mark()
292 for (const typename ELFT::Rela &rel : sec.template relas<ELFT>()) in mark()
293 resolveReloc(sec, rel, false); in mark()
295 for (const typename ELFT::Rel &rel : sec.template rels<ELFT>()) in mark()
296 resolveReloc(sec, rel, false); in mark()
299 for (InputSectionBase *isec : sec.dependentSections) in mark()
303 if (sec.nextInSectionGroup) in mark()
304 enqueue(sec.nextInSectionGroup, 0); in mark()
325 for (InputSectionBase *sec : inputSections) { in moveToMain()
326 if (!sec->isLive() || !isValidCIdentifier(sec->name)) in moveToMain()
328 if (symtab->find(("__start_" + sec->name).str()) || in moveToMain()
329 symtab->find(("__stop_" + sec->name).str())) in moveToMain()
330 enqueue(sec, 0); in moveToMain()
343 for (InputSectionBase *sec : inputSections) in markLive()
344 sec->markLive(); in markLive()
382 for (InputSectionBase *sec : inputSections) { in markLive()
383 bool isAlloc = (sec->flags & SHF_ALLOC); in markLive()
384 bool isLinkOrder = (sec->flags & SHF_LINK_ORDER); in markLive()
385 bool isRel = (sec->type == SHT_REL || sec->type == SHT_RELA); in markLive()
387 if (!isAlloc && !isLinkOrder && !isRel && !sec->nextInSectionGroup) { in markLive()
388 sec->markLive(); in markLive()
389 for (InputSection *isec : sec->dependentSections) in markLive()
406 for (InputSectionBase *sec : inputSections) in markLive()
407 if (!sec->isLive()) in markLive()
408 message("removing unused section " + toString(sec)); in markLive()