Lines Matching full: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 static uint64_t getAddend(InputSectionBase &sec, in getAddend() argument
97 void MarkLive<ELFT>::resolveReloc(InputSectionBase &sec, RelTy &rel, in resolveReloc() argument
100 Symbol &sym = sec.file->getRelocTargetSym(rel); in resolveReloc()
110 offset += getAddend<ELFT>(sec, rel); in resolveReloc()
130 for (InputSectionBase *sec : cNamedSections.lookup(sym.getName())) in resolveReloc()
131 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
193 if (auto *ms = dyn_cast<MergeInputSection>(sec)) in enqueue()
196 // Set Sec->Partition to the meet (i.e. the "minimum") of Partition and in enqueue()
197 // Sec->Partition in the following lattice: 1 < other < 0. If Sec->Partition 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()
256 for (InputSectionBase *sec : ctx.inputSections) { in run()
257 if (sec->flags & SHF_GNU_RETAIN) { in run()
258 enqueue(sec, 0); in run()
261 if (sec->flags & SHF_LINK_ORDER) in run()
286 if (!(sec->flags & SHF_ALLOC)) { in run()
287 if (!isStaticRelSecType(sec->type) && !sec->nextInSectionGroup) { in run()
288 sec->markLive(); in run()
289 for (InputSection *isec : sec->dependentSections) in run()
296 if (isReserved(sec) || script->shouldKeep(sec)) { in run()
297 enqueue(sec, 0); in run()
298 } else if ((!config->zStartStopGC || sec->name.starts_with("__libc_")) && in run()
299 isValidCIdentifier(sec->name)) { in run()
303 cNamedSections[saver().save("__start_" + sec->name)].push_back(sec); in run()
304 cNamedSections[saver().save("__stop_" + sec->name)].push_back(sec); in run()
314 InputSectionBase &sec = *queue.pop_back_val(); in mark() local
316 const RelsOrRelas<ELFT> rels = sec.template relsOrRelas<ELFT>(); in mark()
318 resolveReloc(sec, rel, false); in mark()
320 resolveReloc(sec, rel, false); in mark()
322 resolveReloc(sec, rel, false); in mark()
324 for (InputSectionBase *isec : sec.dependentSections) in mark()
328 if (sec.nextInSectionGroup) in mark()
329 enqueue(sec.nextInSectionGroup, 0); in mark()
350 for (InputSectionBase *sec : ctx.inputSections) { in moveToMain()
351 if (!sec->isLive() || !isValidCIdentifier(sec->name)) in moveToMain()
353 if (symtab.find(("__start_" + sec->name).str()) || in moveToMain()
354 symtab.find(("__stop_" + sec->name).str())) in moveToMain()
355 enqueue(sec, 0); in moveToMain()
376 for (InputSectionBase *sec : ctx.inputSections) in markLive()
377 sec->markDead(); in markLive()
391 for (InputSectionBase *sec : ctx.inputSections) in markLive()
392 if (!sec->isLive()) in markLive()
393 message("removing unused section " + toString(sec)); in markLive()