Lines Matching refs:sec
218 InputSectionBase &sec, uint64_t offset) { in getSrcMsgAux() argument
221 if (Optional<DILineInfo> info = file.getDILineInfo(&sec, offset)) in getSrcMsgAux()
233 std::string InputFile::getSrcMsg(const Symbol &sym, InputSectionBase &sec, in getSrcMsg() argument
241 return getSrcMsgAux(cast<ObjFile<ELF32LE>>(*this), sym, sec, offset); in getSrcMsg()
243 return getSrcMsgAux(cast<ObjFile<ELF32BE>>(*this), sym, sec, offset); in getSrcMsg()
245 return getSrcMsgAux(cast<ObjFile<ELF64LE>>(*this), sym, sec, offset); in getSrcMsg()
247 return getSrcMsgAux(cast<ObjFile<ELF64BE>>(*this), sym, sec, offset); in getSrcMsg()
323 for (const Elf_Shdr &sec : sections) in findSection() local
324 if (sec.sh_type == type) in findSection()
325 return &sec; in findSection()
388 const Elf_Shdr &sec) { in getShtGroupSignature() argument
390 if (sec.sh_info >= symbols.size()) in getShtGroupSignature()
392 const typename ELFT::Sym &sym = symbols[sec.sh_info]; in getShtGroupSignature()
397 bool ObjFile<ELFT>::shouldMerge(const Elf_Shdr &sec, StringRef name) { in shouldMerge() argument
417 if (sec.sh_size == 0) in shouldMerge()
425 uint64_t entSize = sec.sh_entsize; in shouldMerge()
428 if (sec.sh_size % entSize) in shouldMerge()
430 Twine(sec.sh_size) + ") must be a multiple of sh_entsize (" + in shouldMerge()
433 if (sec.sh_flags & SHF_WRITE) in shouldMerge()
525 const Elf_Shdr &sec = objSections[i]; in initializeSections() local
530 if ((sec.sh_flags & SHF_EXCLUDE) && !config->relocatable) { in initializeSections()
531 if (sec.sh_type == SHT_LLVM_CALL_GRAPH_PROFILE) in initializeSections()
533 if (sec.sh_type == SHT_LLVM_ADDRSIG) { in initializeSections()
538 if (sec.sh_link != 0) in initializeSections()
539 this->addrsigSec = &sec; in initializeSections()
552 switch (sec.sh_type) { in initializeSections()
555 StringRef signature = getShtGroupSignature(objSections, sec); in initializeSections()
559 CHECK(obj.template getSectionContentsAsArray<Elf_Word>(sec), this); in initializeSections()
574 i, sec, check(obj.getSectionName(sec, shstrtab))); in initializeSections()
589 shndxTable = CHECK(obj.getSHNDXTable(sec, objSections), this); in initializeSections()
602 createInputSection(i, sec, check(obj.getSectionName(sec, shstrtab))); in initializeSections()
616 const Elf_Shdr &sec = objSections[i]; in initializeSections() local
618 if (sec.sh_type == SHT_REL || sec.sh_type == SHT_RELA) { in initializeSections()
624 const uint32_t info = sec.sh_info; in initializeSections()
625 InputSectionBase *s = getRelocTarget(i, sec, info); in initializeSections()
652 *this, sec, check(obj.getSectionName(sec, shstrtab))); in initializeSections()
663 if (!sec.sh_link || !(sec.sh_flags & SHF_LINK_ORDER)) in initializeSections()
667 if (sec.sh_link < size) in initializeSections()
668 linkSec = this->sections[sec.sh_link]; in initializeSections()
670 fatal(toString(this) + ": invalid sh_link index: " + Twine(sec.sh_link)); in initializeSections()
784 template <class ELFT> static uint32_t readAndFeatures(const InputSection &sec) { in readAndFeatures() argument
789 ArrayRef<uint8_t> data = sec.rawData; in readAndFeatures()
791 fatal(toString(sec.file) + ":(" + sec.name + "+0x" + in readAndFeatures()
792 Twine::utohexstr(place - sec.rawData.data()) + "): " + msg); in readAndFeatures()
844 const Elf_Shdr &sec, in getRelocTarget() argument
866 const Elf_Shdr &sec, in createInputSection() argument
868 if (sec.sh_type == SHT_ARM_ATTRIBUTES && config->emachine == EM_ARM) { in createInputSection()
870 ArrayRef<uint8_t> contents = check(this->getObj().getSectionContents(sec)); in createInputSection()
874 auto *isec = make<InputSection>(*this, sec, name); in createInputSection()
885 in.attributes = std::make_unique<InputSection>(*this, sec, name); in createInputSection()
892 if (sec.sh_type == SHT_RISCV_ATTRIBUTES && config->emachine == EM_RISCV) { in createInputSection()
894 ArrayRef<uint8_t> contents = check(this->getObj().getSectionContents(sec)); in createInputSection()
896 auto *isec = make<InputSection>(*this, sec, name); in createInputSection()
907 in.attributes = std::make_unique<InputSection>(*this, sec, name); in createInputSection()
914 if (sec.sh_type == SHT_LLVM_DEPENDENT_LIBRARIES && !config->relocatable) { in createInputSection()
916 CHECK(this->getObj().template getSectionContentsAsArray<char>(sec), this); in createInputSection()
957 this->andFeatures = readAndFeatures<ELFT>(InputSection(*this, sec, name)); in createInputSection()
996 return make<EhInputSection>(*this, sec, name); in createInputSection()
998 if ((sec.sh_flags & SHF_MERGE) && shouldMerge(sec, name)) in createInputSection()
999 return make<MergeInputSection>(*this, sec, name); in createInputSection()
1000 return make<InputSection>(*this, sec, name); in createInputSection()
1086 InputSectionBase *sec = sections[secIdx]; in initializeLocalSymbols() local
1095 if (eSym.st_shndx == SHN_UNDEF || sec == &InputSection::discarded) in initializeLocalSymbols()
1100 eSym.st_value, eSym.st_size, sec); in initializeLocalSymbols()
1141 InputSectionBase *sec = sections[secIdx]; in postParse() local
1142 if (sec == &InputSection::discarded) { in postParse()
1156 cast<Defined>(sym).section = sec; in postParse()
1163 ctx->duplicates.push_back({&sym, this, sec, eSym.st_value}); in postParse()
1240 parseVerdefs(const uint8_t *base, const typename ELFT::Shdr *sec) { in parseVerdefs() argument
1241 if (!sec) in parseVerdefs()
1247 const uint8_t *verdef = base + sec->sh_offset; in parseVerdefs()
1248 for (unsigned i = 0, e = sec->sh_info; i != e; ++i) { in parseVerdefs()
1265 const typename ELFT::Shdr *sec) { in parseVerneed() argument
1266 if (!sec) in parseVerneed()
1269 ArrayRef<uint8_t> data = CHECK(obj.getSectionContents(*sec), this); in parseVerneed()
1271 for (unsigned i = 0; i != sec->sh_info; ++i) { in parseVerneed()
1339 for (const Elf_Shdr &sec : sections) { in parse() local
1340 switch (sec.sh_type) { in parse()
1345 CHECK(obj.template getSectionContentsAsArray<Elf_Dyn>(sec), this); in parse()
1348 versymSec = &sec; in parse()
1351 verdefSec = &sec; in parse()
1354 verneedSec = &sec; in parse()