Lines Matching refs:sec
352 const InputSectionBase &sec, uint64_t offset) { in getSrcMsgAux() argument
355 if (std::optional<DILineInfo> info = file.getDILineInfo(&sec, offset)) in getSrcMsgAux()
367 std::string InputFile::getSrcMsg(const Symbol &sym, const InputSectionBase &sec, in getSrcMsg() argument
375 return getSrcMsgAux(cast<ObjFile<ELF32LE>>(*this), sym, sec, offset); in getSrcMsg()
377 return getSrcMsgAux(cast<ObjFile<ELF32BE>>(*this), sym, sec, offset); in getSrcMsg()
379 return getSrcMsgAux(cast<ObjFile<ELF64LE>>(*this), sym, sec, offset); in getSrcMsg()
381 return getSrcMsgAux(cast<ObjFile<ELF64BE>>(*this), sym, sec, offset); in getSrcMsg()
500 for (const Elf_Shdr &sec : sections) in findSection() local
501 if (sec.sh_type == type) in findSection()
502 return &sec; in findSection()
581 const Elf_Shdr &sec = objSections[i]; in parse() local
582 if (sec.sh_type == SHT_LLVM_DEPENDENT_LIBRARIES && !config->relocatable) { in parse()
583 StringRef name = check(obj.getSectionName(sec, shstrtab)); in parse()
585 this->getObj().template getSectionContentsAsArray<char>(sec), this); in parse()
602 if (sec.sh_type == SHT_ARM_ATTRIBUTES && config->emachine == EM_ARM) { in parse()
605 check(this->getObj().getSectionContents(sec)); in parse()
606 StringRef name = check(obj.getSectionName(sec, shstrtab)); in parse()
611 InputSection isec(*this, sec, name); in parse()
622 in.attributes = std::make_unique<InputSection>(*this, sec, name); in parse()
632 if (sec.sh_type == SHT_AARCH64_MEMTAG_GLOBALS_STATIC && in parse()
638 if (sec.sh_type != SHT_GROUP) in parse()
640 StringRef signature = getShtGroupSignature(objSections, sec); in parse()
642 CHECK(obj.template getSectionContentsAsArray<Elf_Word>(sec), this); in parse()
657 i, sec, check(obj.getSectionName(sec, shstrtab))); in parse()
679 const Elf_Shdr &sec) { in getShtGroupSignature() argument
681 if (sec.sh_info >= symbols.size()) in getShtGroupSignature()
683 const typename ELFT::Sym &sym = symbols[sec.sh_info]; in getShtGroupSignature()
688 bool ObjFile<ELFT>::shouldMerge(const Elf_Shdr &sec, StringRef name) { in shouldMerge() argument
708 if (sec.sh_size == 0) in shouldMerge()
716 uint64_t entSize = sec.sh_entsize; in shouldMerge()
719 if (sec.sh_size % entSize) in shouldMerge()
721 Twine(sec.sh_size) + ") must be a multiple of sh_entsize (" + in shouldMerge()
724 if (sec.sh_flags & SHF_WRITE) in shouldMerge()
754 const Elf_Shdr &sec = objSections[i]; in initializeSections() local
759 if ((sec.sh_flags & SHF_EXCLUDE) && !config->relocatable) { in initializeSections()
760 if (sec.sh_type == SHT_LLVM_CALL_GRAPH_PROFILE) in initializeSections()
762 if (sec.sh_type == SHT_LLVM_ADDRSIG) { in initializeSections()
767 if (sec.sh_link != 0) in initializeSections()
768 this->addrsigSec = &sec; in initializeSections()
781 switch (sec.sh_type) { in initializeSections()
786 cantFail(this->getELFSyms<ELFT>()[sec.sh_info].getName(stringTable)); in initializeSections()
788 cantFail(obj.template getSectionContentsAsArray<Elf_Word>(sec)); in initializeSections()
796 shndxTable = CHECK(obj.getSHNDXTable(sec, objSections), this); in initializeSections()
809 createInputSection(i, sec, check(obj.getSectionName(sec, shstrtab))); in initializeSections()
823 const Elf_Shdr &sec = objSections[i]; in initializeSections() local
825 if (sec.sh_type == SHT_REL || sec.sh_type == SHT_RELA) { in initializeSections()
831 const uint32_t info = sec.sh_info; in initializeSections()
832 InputSectionBase *s = getRelocTarget(i, sec, info); in initializeSections()
860 *this, sec, check(obj.getSectionName(sec, shstrtab))); in initializeSections()
871 if (!sec.sh_link || !(sec.sh_flags & SHF_LINK_ORDER)) in initializeSections()
875 if (sec.sh_link < size) in initializeSections()
876 linkSec = this->sections[sec.sh_link]; in initializeSections()
878 fatal(toString(this) + ": invalid sh_link index: " + Twine(sec.sh_link)); in initializeSections()
906 template <class ELFT> static uint32_t readAndFeatures(const InputSection &sec) { in readAndFeatures() argument
911 ArrayRef<uint8_t> data = sec.content(); in readAndFeatures()
913 fatal(toString(sec.file) + ":(" + sec.name + "+0x" + in readAndFeatures()
914 Twine::utohexstr(place - sec.content().data()) + "): " + msg); in readAndFeatures()
920 data.size() < nhdr->getSize(sec.addralign)) in readAndFeatures()
925 data = data.slice(nhdr->getSize(sec.addralign)); in readAndFeatures()
934 ArrayRef<uint8_t> desc = note.getDesc(sec.addralign); in readAndFeatures()
959 data = data.slice(nhdr->getSize(sec.addralign)); in readAndFeatures()
967 const Elf_Shdr &sec, in getRelocTarget() argument
991 const Elf_Shdr &sec, in createInputSection() argument
1019 this->andFeatures = readAndFeatures<ELFT>(InputSection(*this, sec, name)); in createInputSection()
1058 return makeThreadLocal<EhInputSection>(*this, sec, name); in createInputSection()
1060 if ((sec.sh_flags & SHF_MERGE) && shouldMerge(sec, name)) in createInputSection()
1061 return makeThreadLocal<MergeInputSection>(*this, sec, name); in createInputSection()
1062 return makeThreadLocal<InputSection>(*this, sec, name); in createInputSection()
1153 InputSectionBase *sec = sections[secIdx]; in initSectionsAndLocalSyms() local
1162 if (eSym.st_shndx == SHN_UNDEF || sec == &InputSection::discarded) in initSectionsAndLocalSyms()
1167 eSym.st_value, eSym.st_size, sec); in initSectionsAndLocalSyms()
1209 InputSectionBase *sec = sections[secIdx]; in postParse() local
1210 if (sec == &InputSection::discarded) { in postParse()
1224 cast<Defined>(sym).section = sec; in postParse()
1231 ctx.duplicates.push_back({&sym, this, sec, eSym.st_value}); in postParse()
1313 parseVerdefs(const uint8_t *base, const typename ELFT::Shdr *sec) { in parseVerdefs() argument
1314 if (!sec) in parseVerdefs()
1320 const uint8_t *verdef = base + sec->sh_offset; in parseVerdefs()
1321 for (unsigned i = 0, e = sec->sh_info; i != e; ++i) { in parseVerdefs()
1338 const typename ELFT::Shdr *sec) { in parseVerneed() argument
1339 if (!sec) in parseVerneed()
1342 ArrayRef<uint8_t> data = CHECK(obj.getSectionContents(*sec), this); in parseVerneed()
1344 for (unsigned i = 0; i != sec->sh_info; ++i) { in parseVerneed()
1412 for (const Elf_Shdr &sec : sections) { in parse() local
1413 switch (sec.sh_type) { in parse()
1418 CHECK(obj.template getSectionContentsAsArray<Elf_Dyn>(sec), this); in parse()
1421 versymSec = &sec; in parse()
1424 verdefSec = &sec; in parse()
1427 verneedSec = &sec; in parse()