Lines Matching refs:sec
247 InputSectionBase &sec, uint64_t offset) { in getSrcMsgAux() argument
250 if (Optional<DILineInfo> info = file.getDILineInfo(&sec, offset)) in getSrcMsgAux()
262 std::string InputFile::getSrcMsg(const Symbol &sym, InputSectionBase &sec, in getSrcMsg() argument
270 return getSrcMsgAux(cast<ObjFile<ELF32LE>>(*this), sym, sec, offset); in getSrcMsg()
272 return getSrcMsgAux(cast<ObjFile<ELF32BE>>(*this), sym, sec, offset); in getSrcMsg()
274 return getSrcMsgAux(cast<ObjFile<ELF64LE>>(*this), sym, sec, offset); in getSrcMsg()
276 return getSrcMsgAux(cast<ObjFile<ELF64BE>>(*this), sym, sec, offset); in getSrcMsg()
352 for (const Elf_Shdr &sec : sections) in findSection() local
353 if (sec.sh_type == type) in findSection()
354 return &sec; in findSection()
424 const Elf_Shdr &sec) { in getShtGroupSignature() argument
426 if (sec.sh_info >= symbols.size()) in getShtGroupSignature()
428 const typename ELFT::Sym &sym = symbols[sec.sh_info]; in getShtGroupSignature()
439 return getSectionName(sec); in getShtGroupSignature()
444 bool ObjFile<ELFT>::shouldMerge(const Elf_Shdr &sec, StringRef name) { in shouldMerge() argument
445 if (!(sec.sh_flags & SHF_MERGE)) in shouldMerge()
467 if (sec.sh_size == 0) in shouldMerge()
475 uint64_t entSize = sec.sh_entsize; in shouldMerge()
478 if (sec.sh_size % entSize) in shouldMerge()
480 Twine(sec.sh_size) + ") must be a multiple of sh_entsize (" + in shouldMerge()
483 if (sec.sh_flags & SHF_WRITE) in shouldMerge()
578 const Elf_Shdr &sec = objSections[i]; in initializeSections() local
580 if (sec.sh_type == ELF::SHT_LLVM_CALL_GRAPH_PROFILE) in initializeSections()
586 if ((sec.sh_flags & SHF_EXCLUDE) && !config->relocatable) { in initializeSections()
587 if (sec.sh_type == SHT_LLVM_ADDRSIG) { in initializeSections()
592 if (sec.sh_link != 0) in initializeSections()
593 this->addrsigSec = &sec; in initializeSections()
606 switch (sec.sh_type) { in initializeSections()
609 StringRef signature = getShtGroupSignature(objSections, sec); in initializeSections()
613 CHECK(obj.template getSectionContentsAsArray<Elf_Word>(sec), this); in initializeSections()
627 this->sections[i] = createInputSection(sec); in initializeSections()
642 shndxTable = CHECK(obj.getSHNDXTable(sec, objSections), this); in initializeSections()
651 this->sections[i] = createInputSection(sec); in initializeSections()
665 const Elf_Shdr &sec = objSections[i]; in initializeSections() local
667 if (sec.sh_type == SHT_REL || sec.sh_type == SHT_RELA) in initializeSections()
668 this->sections[i] = createInputSection(sec); in initializeSections()
672 if (!(sec.sh_flags & SHF_LINK_ORDER) || !sec.sh_link) in initializeSections()
676 if (sec.sh_link < this->sections.size()) in initializeSections()
677 linkSec = this->sections[sec.sh_link]; in initializeSections()
679 fatal(toString(this) + ": invalid sh_link index: " + Twine(sec.sh_link)); in initializeSections()
793 template <class ELFT> static uint32_t readAndFeatures(const InputSection &sec) { in readAndFeatures() argument
798 ArrayRef<uint8_t> data = sec.data(); in readAndFeatures()
800 fatal(toString(sec.file) + ":(" + sec.name + "+0x" + in readAndFeatures()
801 Twine::utohexstr(place - sec.data().data()) + "): " + msg); in readAndFeatures()
852 InputSectionBase *ObjFile<ELFT>::getRelocTarget(const Elf_Shdr &sec) { in getRelocTarget() argument
853 uint32_t idx = sec.sh_info; in getRelocTarget()
871 static InputSection *toRegularSection(MergeInputSection *sec) { in toRegularSection() argument
872 return make<InputSection>(sec->file, sec->flags, sec->type, sec->alignment, in toRegularSection()
873 sec->data(), sec->name); in toRegularSection()
877 InputSectionBase *ObjFile<ELFT>::createInputSection(const Elf_Shdr &sec) { in createInputSection() argument
878 StringRef name = getSectionName(sec); in createInputSection()
880 if (config->emachine == EM_ARM && sec.sh_type == SHT_ARM_ATTRIBUTES) { in createInputSection()
882 ArrayRef<uint8_t> contents = check(this->getObj().getSectionContents(sec)); in createInputSection()
886 auto *isec = make<InputSection>(*this, sec, name); in createInputSection()
897 in.attributes = make<InputSection>(*this, sec, name); in createInputSection()
904 if (config->emachine == EM_RISCV && sec.sh_type == SHT_RISCV_ATTRIBUTES) { in createInputSection()
906 ArrayRef<uint8_t> contents = check(this->getObj().getSectionContents(sec)); in createInputSection()
908 auto *isec = make<InputSection>(*this, sec, name); in createInputSection()
919 in.attributes = make<InputSection>(*this, sec, name); in createInputSection()
926 switch (sec.sh_type) { in createInputSection()
931 CHECK(this->getObj().template getSectionContentsAsArray<char>(sec), this); in createInputSection()
952 InputSectionBase *target = getRelocTarget(sec); in createInputSection()
963 this->sections[sec.sh_info] = target; in createInputSection()
970 if (sec.sh_type == SHT_RELA) { in createInputSection()
971 ArrayRef<Elf_Rela> rels = CHECK(getObj().relas(sec), this); in createInputSection()
976 ArrayRef<Elf_Rel> rels = CHECK(getObj().rels(sec), this); in createInputSection()
989 InputSection *relocSec = make<InputSection>(*this, sec, name); in createInputSection()
1022 this->andFeatures = readAndFeatures<ELFT>(InputSection(*this, sec, name)); in createInputSection()
1068 return make<EhInputSection>(*this, sec, name); in createInputSection()
1070 if (shouldMerge(sec, name)) in createInputSection()
1071 return make<MergeInputSection>(*this, sec, name); in createInputSection()
1072 return make<InputSection>(*this, sec, name); in createInputSection()
1076 StringRef ObjFile<ELFT>::getSectionName(const Elf_Shdr &sec) { in getSectionName() argument
1077 return CHECK(getObj().getSectionName(sec, sectionStringTable), this); in getSectionName()
1113 InputSectionBase *sec = this->sections[secIdx]; in initializeSymbols() local
1124 else if (sec == &InputSection::discarded) in initializeSymbols()
1130 type, eSym.st_value, eSym.st_size, sec); in initializeSymbols()
1142 InputSectionBase *sec = this->sections[secIdx]; in initializeSymbols() local
1170 if (sec == &InputSection::discarded) { in initializeSymbols()
1192 Defined{this, name, binding, stOther, type, value, size, sec}); in initializeSymbols()
1354 const typename ELFT::Shdr *sec) { in parseVerdefs() argument
1355 if (!sec) in parseVerdefs()
1362 unsigned verdefCount = sec->sh_info; in parseVerdefs()
1367 const uint8_t *verdef = base + sec->sh_offset; in parseVerdefs()
1384 const typename ELFT::Shdr *sec) { in parseVerneed() argument
1385 if (!sec) in parseVerneed()
1388 ArrayRef<uint8_t> data = CHECK(obj.getSectionContents(*sec), this); in parseVerneed()
1390 for (unsigned i = 0; i != sec->sh_info; ++i) { in parseVerneed()
1458 for (const Elf_Shdr &sec : sections) { in parse() local
1459 switch (sec.sh_type) { in parse()
1464 CHECK(obj.template getSectionContentsAsArray<Elf_Dyn>(sec), this); in parse()
1467 versymSec = &sec; in parse()
1470 verdefSec = &sec; in parse()
1473 verneedSec = &sec; in parse()
1842 for (const typename ELFT::Shdr &sec : sections) { in parse() local
1843 if (sec.sh_type != SHT_SYMTAB) in parse()
1847 ArrayRef<Elf_Sym> eSyms = CHECK(obj.symbols(&sec), this); in parse()
1848 uint32_t firstGlobal = sec.sh_info; in parse()
1849 StringRef strtab = CHECK(obj.getStringTableForSymtab(sec, sections), this); in parse()