Lines Matching refs:sec

53   void enqueue(InputSectionBase *sec, uint64_t offset);
58 void resolveReloc(InputSectionBase &sec, RelTy &rel, bool fromFDE);
76 static uint64_t getAddend(InputSectionBase &sec, in getAddend() argument
78 return target->getImplicitAddend(sec.rawData.begin() + rel.r_offset, in getAddend()
83 static uint64_t getAddend(InputSectionBase &sec, in getAddend() argument
90 void MarkLive<ELFT>::resolveReloc(InputSectionBase &sec, RelTy &rel, in resolveReloc() argument
92 Symbol &sym = sec.getFile<ELFT>()->getRelocTargetSym(rel); in resolveReloc()
104 offset += getAddend<ELFT>(sec, rel); in resolveReloc()
124 for (InputSectionBase *sec : cNamedSections.lookup(sym.getName())) in resolveReloc()
125 enqueue(sec, 0); in resolveReloc()
169 static bool isReserved(InputSectionBase *sec) { in isReserved() argument
170 switch (sec->type) { in isReserved()
177 return !sec->nextInSectionGroup; in isReserved()
182 StringRef s = sec->name; in isReserved()
189 void MarkLive<ELFT>::enqueue(InputSectionBase *sec, uint64_t offset) { in enqueue() argument
194 if (sec == &InputSection::discarded) in enqueue()
200 if (auto *ms = dyn_cast<MergeInputSection>(sec)) in enqueue()
206 if (sec->partition == 1 || sec->partition == partition) in enqueue()
208 sec->partition = sec->partition ? 1 : partition; in enqueue()
211 if (InputSection *s = dyn_cast<InputSection>(sec)) in enqueue()
247 for (InputSectionBase *sec : inputSections) { in run()
252 if (auto *eh = dyn_cast<EhInputSection>(sec)) { in run()
263 if (sec->flags & SHF_GNU_RETAIN) { in run()
264 enqueue(sec, 0); in run()
267 if (sec->flags & SHF_LINK_ORDER) in run()
292 if (!(sec->flags & SHF_ALLOC)) { in run()
293 bool isRel = sec->type == SHT_REL || sec->type == SHT_RELA; in run()
294 if (!isRel && !sec->nextInSectionGroup) { in run()
295 sec->markLive(); in run()
296 for (InputSection *isec : sec->dependentSections) in run()
303 if (isReserved(sec) || script->shouldKeep(sec)) { in run()
304 enqueue(sec, 0); in run()
305 } else if ((!config->zStartStopGC || sec->name.startswith("__libc_")) && in run()
306 isValidCIdentifier(sec->name)) { in run()
310 cNamedSections[saver().save("__start_" + sec->name)].push_back(sec); in run()
311 cNamedSections[saver().save("__stop_" + sec->name)].push_back(sec); in run()
321 InputSectionBase &sec = *queue.pop_back_val(); in mark() local
323 const RelsOrRelas<ELFT> rels = sec.template relsOrRelas<ELFT>(); in mark()
325 resolveReloc(sec, rel, false); in mark()
327 resolveReloc(sec, rel, false); in mark()
329 for (InputSectionBase *isec : sec.dependentSections) in mark()
333 if (sec.nextInSectionGroup) in mark()
334 enqueue(sec.nextInSectionGroup, 0); in mark()
355 for (InputSectionBase *sec : inputSections) { in moveToMain()
356 if (!sec->isLive() || !isValidCIdentifier(sec->name)) in moveToMain()
358 if (symtab->find(("__start_" + sec->name).str()) || in moveToMain()
359 symtab->find(("__stop_" + sec->name).str())) in moveToMain()
360 enqueue(sec, 0); in moveToMain()
381 for (InputSectionBase *sec : inputSections) in markLive()
382 sec->markDead(); in markLive()
396 for (InputSectionBase *sec : inputSections) in markLive()
397 if (!sec->isLive()) in markLive()
398 message("removing unused section " + toString(sec)); in markLive()