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