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))
245 for (InputSectionBase *sec : ctx.inputSections) {
246 if (sec->flags & SHF_GNU_RETAIN) {
247 enqueue(sec, 0);
250 if (sec->flags & SHF_LINK_ORDER)
275 if (!(sec->flags & SHF_ALLOC)) {
276 bool isRel = sec->type == SHT_REL || sec->type == SHT_RELA;
277 if (!isRel && !sec->nextInSectionGroup) {
278 sec->markLive();
279 for (InputSection *isec : sec->dependentSections)
286 if (isReserved(sec) || script->shouldKeep(sec)) {
287 enqueue(sec, 0);
288 } else if ((!config->zStartStopGC || sec->name.startswith("__libc_")) &&
289 isValidCIdentifier(sec->name)) {
293 cNamedSections[saver().save("__start_" + sec->name)].push_back(sec);
294 cNamedSections[saver().save("__stop_" + sec->name)].push_back(sec);
304 InputSectionBase &sec = *queue.pop_back_val();
306 const RelsOrRelas<ELFT> rels = sec.template relsOrRelas<ELFT>();
308 resolveReloc(sec, rel, false);
310 resolveReloc(sec, rel, false);
312 for (InputSectionBase *isec : sec.dependentSections)
316 if (sec.nextInSectionGroup)
317 enqueue(sec.nextInSectionGroup, 0);
338 for (InputSectionBase *sec : ctx.inputSections) {
339 if (!sec->isLive() || !isValidCIdentifier(sec->name))
341 if (symtab.find(("__start_" + sec->name).str()) ||
342 symtab.find(("__stop_" + sec->name).str()))
343 enqueue(sec, 0);
364 for (InputSectionBase *sec : ctx.inputSections)
365 sec->markDead();
379 for (InputSectionBase *sec : ctx.inputSections)
380 if (!sec->isLive())
381 message("removing unused section " + toString(sec));