Lines Matching refs:sec
323 InputSectionBase &sec, uint64_t offset) { in getSrcMsgAux() argument
326 if (std::optional<DILineInfo> info = file.getDILineInfo(&sec, offset)) in getSrcMsgAux()
338 std::string InputFile::getSrcMsg(const Symbol &sym, InputSectionBase &sec, in getSrcMsg() argument
346 return getSrcMsgAux(cast<ObjFile<ELF32LE>>(*this), sym, sec, offset); in getSrcMsg()
348 return getSrcMsgAux(cast<ObjFile<ELF32BE>>(*this), sym, sec, offset); in getSrcMsg()
350 return getSrcMsgAux(cast<ObjFile<ELF64LE>>(*this), sym, sec, offset); in getSrcMsg()
352 return getSrcMsgAux(cast<ObjFile<ELF64BE>>(*this), sym, sec, offset); in getSrcMsg()
471 for (const Elf_Shdr &sec : sections) in findSection() local
472 if (sec.sh_type == type) in findSection()
473 return &sec; in findSection()
552 const Elf_Shdr &sec = objSections[i]; in parse() local
553 if (sec.sh_type == SHT_LLVM_DEPENDENT_LIBRARIES && !config->relocatable) { in parse()
554 StringRef name = check(obj.getSectionName(sec, shstrtab)); in parse()
556 this->getObj().template getSectionContentsAsArray<char>(sec), this); in parse()
573 if (sec.sh_type == SHT_ARM_ATTRIBUTES && config->emachine == EM_ARM) { in parse()
576 check(this->getObj().getSectionContents(sec)); in parse()
577 StringRef name = check(obj.getSectionName(sec, shstrtab)); in parse()
582 InputSection isec(*this, sec, name); in parse()
593 in.attributes = std::make_unique<InputSection>(*this, sec, name); in parse()
599 if (sec.sh_type != SHT_GROUP) in parse()
601 StringRef signature = getShtGroupSignature(objSections, sec); in parse()
603 CHECK(obj.template getSectionContentsAsArray<Elf_Word>(sec), this); in parse()
618 i, sec, check(obj.getSectionName(sec, shstrtab))); in parse()
640 const Elf_Shdr &sec) { in getShtGroupSignature() argument
642 if (sec.sh_info >= symbols.size()) in getShtGroupSignature()
644 const typename ELFT::Sym &sym = symbols[sec.sh_info]; in getShtGroupSignature()
649 bool ObjFile<ELFT>::shouldMerge(const Elf_Shdr &sec, StringRef name) { in shouldMerge() argument
669 if (sec.sh_size == 0) in shouldMerge()
677 uint64_t entSize = sec.sh_entsize; in shouldMerge()
680 if (sec.sh_size % entSize) in shouldMerge()
682 Twine(sec.sh_size) + ") must be a multiple of sh_entsize (" + in shouldMerge()
685 if (sec.sh_flags & SHF_WRITE) in shouldMerge()
715 const Elf_Shdr &sec = objSections[i]; in initializeSections() local
720 if ((sec.sh_flags & SHF_EXCLUDE) && !config->relocatable) { in initializeSections()
721 if (sec.sh_type == SHT_LLVM_CALL_GRAPH_PROFILE) in initializeSections()
723 if (sec.sh_type == SHT_LLVM_ADDRSIG) { in initializeSections()
728 if (sec.sh_link != 0) in initializeSections()
729 this->addrsigSec = &sec; in initializeSections()
742 switch (sec.sh_type) { in initializeSections()
747 cantFail(this->getELFSyms<ELFT>()[sec.sh_info].getName(stringTable)); in initializeSections()
749 cantFail(obj.template getSectionContentsAsArray<Elf_Word>(sec)); in initializeSections()
757 shndxTable = CHECK(obj.getSHNDXTable(sec, objSections), this); in initializeSections()
766 this->sections[i] = createInputSection(i, sec, check(obj.getSectionName(sec, shstrtab))); in initializeSections()
767 StringRef name = check(obj.getSectionName(sec, shstrtab)); in initializeSections()
769 CHECK(obj.template getSectionContentsAsArray<char>(sec), this); in initializeSections()
770 parseGNUWarning(name, data, sec.sh_size); in initializeSections()
778 createInputSection(i, sec, check(obj.getSectionName(sec, shstrtab))); in initializeSections()
792 const Elf_Shdr &sec = objSections[i]; in initializeSections() local
794 if (sec.sh_type == SHT_REL || sec.sh_type == SHT_RELA) { in initializeSections()
800 const uint32_t info = sec.sh_info; in initializeSections()
801 InputSectionBase *s = getRelocTarget(i, sec, info); in initializeSections()
829 *this, sec, check(obj.getSectionName(sec, shstrtab))); in initializeSections()
840 if (!sec.sh_link || !(sec.sh_flags & SHF_LINK_ORDER)) in initializeSections()
844 if (sec.sh_link < size) in initializeSections()
845 linkSec = this->sections[sec.sh_link]; in initializeSections()
847 fatal(toString(this) + ": invalid sh_link index: " + Twine(sec.sh_link)); in initializeSections()
875 template <class ELFT> static uint32_t readAndFeatures(const InputSection &sec) { in readAndFeatures() argument
880 ArrayRef<uint8_t> data = sec.content(); in readAndFeatures()
882 fatal(toString(sec.file) + ":(" + sec.name + "+0x" + in readAndFeatures()
883 Twine::utohexstr(place - sec.content().data()) + "): " + msg); in readAndFeatures()
935 const Elf_Shdr &sec, in getRelocTarget() argument
959 const Elf_Shdr &sec, in createInputSection() argument
987 this->andFeatures = readAndFeatures<ELFT>(InputSection(*this, sec, name)); in createInputSection()
1026 return makeThreadLocal<EhInputSection>(*this, sec, name); in createInputSection()
1028 if ((sec.sh_flags & SHF_MERGE) && shouldMerge(sec, name)) in createInputSection()
1029 return makeThreadLocal<MergeInputSection>(*this, sec, name); in createInputSection()
1030 return makeThreadLocal<InputSection>(*this, sec, name); in createInputSection()
1121 InputSectionBase *sec = sections[secIdx]; in initSectionsAndLocalSyms() local
1130 if (eSym.st_shndx == SHN_UNDEF || sec == &InputSection::discarded) in initSectionsAndLocalSyms()
1135 eSym.st_value, eSym.st_size, sec); in initSectionsAndLocalSyms()
1177 InputSectionBase *sec = sections[secIdx]; in postParse() local
1178 if (sec == &InputSection::discarded) { in postParse()
1192 cast<Defined>(sym).section = sec; in postParse()
1199 ctx.duplicates.push_back({&sym, this, sec, eSym.st_value}); in postParse()
1281 parseVerdefs(const uint8_t *base, const typename ELFT::Shdr *sec) { in parseVerdefs() argument
1282 if (!sec) in parseVerdefs()
1288 const uint8_t *verdef = base + sec->sh_offset; in parseVerdefs()
1289 for (unsigned i = 0, e = sec->sh_info; i != e; ++i) { in parseVerdefs()
1306 const typename ELFT::Shdr *sec) { in parseVerneed() argument
1307 if (!sec) in parseVerneed()
1310 ArrayRef<uint8_t> data = CHECK(obj.getSectionContents(*sec), this); in parseVerneed()
1312 for (unsigned i = 0; i != sec->sh_info; ++i) { in parseVerneed()
1383 for (const Elf_Shdr &sec : sections) { in parse() local
1384 switch (sec.sh_type) { in parse()
1389 CHECK(obj.template getSectionContentsAsArray<Elf_Dyn>(sec), this); in parse()
1392 versymSec = &sec; in parse()
1395 verdefSec = &sec; in parse()
1398 verneedSec = &sec; in parse()
1401 StringRef name = CHECK(obj.getSectionName(sec, sectionStringTable), this); in parse()
1403 CHECK(obj.template getSectionContentsAsArray<char>(sec), this); in parse()
1404 parseGNUWarning(name, data, sec.sh_size); in parse()