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.content().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()
163 static bool isReserved(InputSectionBase *sec) { in isReserved() argument
164 switch (sec->type) { in isReserved()
171 return !sec->nextInSectionGroup; in isReserved()
176 StringRef s = sec->name; in isReserved()
183 void MarkLive<ELFT>::enqueue(InputSectionBase *sec, uint64_t offset) { in enqueue() argument
187 if (auto *ms = dyn_cast<MergeInputSection>(sec)) in enqueue()
193 if (sec->partition == 1 || sec->partition == partition) in enqueue()
195 sec->partition = sec->partition ? 1 : partition; in enqueue()
198 if (InputSection *s = dyn_cast<InputSection>(sec)) in enqueue()
245 for (InputSectionBase *sec : ctx.inputSections) { in run()
246 if (sec->flags & SHF_GNU_RETAIN) { in run()
247 enqueue(sec, 0); in run()
250 if (sec->flags & SHF_LINK_ORDER) in run()
275 if (!(sec->flags & SHF_ALLOC)) { in run()
276 bool isRel = sec->type == SHT_REL || sec->type == SHT_RELA; in run()
277 if (!isRel && !sec->nextInSectionGroup) { in run()
278 sec->markLive(); in run()
279 for (InputSection *isec : sec->dependentSections) in run()
286 if (isReserved(sec) || script->shouldKeep(sec)) { in run()
287 enqueue(sec, 0); in run()
288 } else if ((!config->zStartStopGC || sec->name.startswith("__libc_")) && in run()
289 isValidCIdentifier(sec->name)) { in run()
293 cNamedSections[saver().save("__start_" + sec->name)].push_back(sec); in run()
294 cNamedSections[saver().save("__stop_" + sec->name)].push_back(sec); in run()
304 InputSectionBase &sec = *queue.pop_back_val(); in mark() local
306 const RelsOrRelas<ELFT> rels = sec.template relsOrRelas<ELFT>(); in mark()
308 resolveReloc(sec, rel, false); in mark()
310 resolveReloc(sec, rel, false); in mark()
312 for (InputSectionBase *isec : sec.dependentSections) in mark()
316 if (sec.nextInSectionGroup) in mark()
317 enqueue(sec.nextInSectionGroup, 0); in mark()
338 for (InputSectionBase *sec : ctx.inputSections) { in moveToMain()
339 if (!sec->isLive() || !isValidCIdentifier(sec->name)) in moveToMain()
341 if (symtab.find(("__start_" + sec->name).str()) || in moveToMain()
342 symtab.find(("__stop_" + sec->name).str())) in moveToMain()
343 enqueue(sec, 0); in moveToMain()
364 for (InputSectionBase *sec : ctx.inputSections) in markLive()
365 sec->markDead(); in markLive()
379 for (InputSectionBase *sec : ctx.inputSections) in markLive()
380 if (!sec->isLive()) in markLive()
381 message("removing unused section " + toString(sec)); in markLive()