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,
78 return target->getImplicitAddend(sec.content().begin() + rel.r_offset,
83 static uint64_t getAddend(InputSectionBase &sec,
90 void MarkLive<ELFT>::resolveReloc(InputSectionBase &sec, RelTy &rel,
92 Symbol &sym = sec.getFile<ELFT>()->getRelocTargetSym(rel);
104 offset += getAddend<ELFT>(sec, rel);
124 for (InputSectionBase *sec : cNamedSections.lookup(sym.getName()))
125 enqueue(sec, 0);
163 static bool isReserved(InputSectionBase *sec) {
164 switch (sec->type) {
171 return !sec->nextInSectionGroup;
176 StringRef s = sec->name;
183 void MarkLive<ELFT>::enqueue(InputSectionBase *sec, uint64_t offset) {
187 if (auto *ms = dyn_cast<MergeInputSection>(sec))
193 if (sec->partition == 1 || sec->partition == partition)
195 sec->partition = sec->partition ? 1 : partition;
198 if (InputSection *s = dyn_cast<InputSection>(sec))
249 for (InputSectionBase *sec : ctx.inputSections) {
250 if (sec->flags & SHF_GNU_RETAIN) {
251 enqueue(sec, 0);
254 if (sec->flags & SHF_LINK_ORDER)
279 if (!(sec->flags & SHF_ALLOC)) {
280 bool isRel = sec->type == SHT_REL || sec->type == SHT_RELA;
281 if (!isRel && !sec->nextInSectionGroup) {
282 sec->markLive();
283 for (InputSection *isec : sec->dependentSections)
290 if (isReserved(sec) || script->shouldKeep(sec)) {
291 enqueue(sec, 0);
292 } else if ((!config->zStartStopGC || sec->name.starts_with("__libc_")) &&
293 isValidCIdentifier(sec->name)) {
297 cNamedSections[saver().save("__start_" + sec->name)].push_back(sec);
298 cNamedSections[saver().save("__stop_" + sec->name)].push_back(sec);
308 InputSectionBase &sec = *queue.pop_back_val();
310 const RelsOrRelas<ELFT> rels = sec.template relsOrRelas<ELFT>();
312 resolveReloc(sec, rel, false);
314 resolveReloc(sec, rel, false);
316 for (InputSectionBase *isec : sec.dependentSections)
320 if (sec.nextInSectionGroup)
321 enqueue(sec.nextInSectionGroup, 0);
342 for (InputSectionBase *sec : ctx.inputSections) {
343 if (!sec->isLive() || !isValidCIdentifier(sec->name))
345 if (symtab.find(("__start_" + sec->name).str()) ||
346 symtab.find(("__stop_" + sec->name).str()))
347 enqueue(sec, 0);
368 for (InputSectionBase *sec : ctx.inputSections)
369 sec->markDead();
383 for (InputSectionBase *sec : ctx.inputSections)
384 if (!sec->isLive())
385 message("removing unused section " + toString(sec));