Lines Matching defs:sections

442 static void handleSectionGroup(ArrayRef<InputSectionBase *> sections,
446 if (index >= sections.size())
448 if (InputSectionBase *s = sections[index])
464 InputSectionBase *s = sections[index];
505 ArrayRef<InputSectionBase *> sections = s->file->getSections();
506 for (uint64_t curIndex = 0; curIndex < sections.size(); ++curIndex) {
507 if (s == sections[curIndex]) {
522 static const Elf_Shdr *findSection(ArrayRef<Elf_Shdr> sections, uint32_t type) {
523 for (const Elf_Shdr &sec : sections)
558 ArrayRef<Elf_Shdr> sections = CHECK(obj.sections(), this);
559 elfShdrs = sections.data();
560 numELFShdrs = sections.size();
564 findSection(sections, k == SharedKind ? SHT_DYNSYM : SHT_SYMTAB);
578 stringTable = CHECK(obj.getStringTableForSymtab(*symtabSec, sections), this);
602 sections.resize(size);
621 this->sections[i] = &InputSection::discarded;
630 this->sections[i] = &InputSection::discarded;
643 // sections.
646 this->sections[i] = in.attributes.get();
652 // remove all SHT_AARCH64_MEMTAG_GLOBALS_STATIC sections as they're unused
657 this->sections[i] = &InputSection::discarded;
679 this->sections[i] = createInputSection(
689 this->sections[secIndex] = &InputSection::discarded;
701 StringRef ObjFile<ELFT>::getShtGroupSignature(ArrayRef<Elf_Shdr> sections,
712 // On a regular link we don't merge sections if -O0 (default is -O1). This
716 // Doing the same for -r would create a problem as it would combine sections
719 // usable SHF_MERGE sections, tools like (llvm-)?dwarfdump get confused when
721 // SHF_MERGE sections based both on their name and sh_entsize, but that seems
764 sections.resize(numELFShdrs);
784 if (this->sections[i] == &InputSection::discarded)
789 // SHF_EXCLUDE'ed sections are discarded by the linker. However,
790 // if -r is given, we'll let the final link discard such sections.
810 this->sections[i] = &InputSection::discarded;
817 sections[i] = &InputSection::discarded;
844 this->sections[i] =
853 sections[i] = &InputSection::discarded;
858 this->sections[i] =
864 errorOrWarn(toString(this->sections[i]) + ": unknown section type 0x" +
871 // 1) handle SHF_LINK_ORDER sections.
872 // 2) create relocation sections. In some cases the section header index of a
876 // relocation sections until now.
878 if (this->sections[i] == &InputSection::discarded)
887 // sections.
893 // ELF spec allows mergeable sections with relocations, but they are rare,
894 // and it is in practice hard to merge such sections by contents, because
896 // simply handle such sections as non-mergeable ones. Degrading like this
902 sections[info] = s;
908 ": multiple relocation sections to one section are not supported");
911 // Relocation sections are usually removed from the output, so return
919 // --gc-sections), the relocation section should be discarded as well.
921 sections[i] = isec;
933 linkSec = this->sections[sec.sh_link];
939 InputSection *isec = cast<InputSection>(this->sections[i]);
948 handleSectionGroup<ELFT>(this->sections, entries);
1027 if (info < this->sections.size()) {
1028 InputSectionBase *target = this->sections[info];
1064 // .note.GNU-stack sections are simply ignored.
1103 // Strip existing .note.gnu.build-id sections so that the output won't have
1105 // object files normally don't have .build-id sections, but you can create
1172 // sections) can trigger recursive extract. Process defined symbols first so
1205 if (LLVM_UNLIKELY(secIdx >= sections.size()))
1211 InputSectionBase *sec = sections[secIdx];
1265 if (LLVM_UNLIKELY(secIdx >= sections.size()))
1267 InputSectionBase *sec = sections[secIdx];
1429 static uint64_t getAlignment(ArrayRef<typename ELFT::Shdr> sections,
1434 if (0 < sym.st_shndx && sym.st_shndx < sections.size())
1435 ret = std::min<uint64_t>(ret, sections[sym.st_shndx].sh_addralign);
1463 ArrayRef<Elf_Shdr> sections = getELFShdrs<ELFT>();
1470 for (const Elf_Shdr &sec : sections) {
1602 uint32_t alignment = getAlignment<ELFT>(sections, sym);
1826 sections.push_back(section);