Lines Matching refs:SHeader
217 void initSymtabSectionHeader(Elf_Shdr &SHeader, SymtabType STType,
220 void initStrtabSectionHeader(Elf_Shdr &SHeader, StringRef Name,
224 void initDWARFSectionHeader(Elf_Shdr &SHeader, StringRef Name,
236 void writeSectionContent(Elf_Shdr &SHeader,
239 void writeSectionContent(Elf_Shdr &SHeader,
242 void writeSectionContent(Elf_Shdr &SHeader,
245 void writeSectionContent(Elf_Shdr &SHeader,
248 void writeSectionContent(Elf_Shdr &SHeader,
251 void writeSectionContent(Elf_Shdr &SHeader,
254 void writeSectionContent(Elf_Shdr &SHeader,
257 void writeSectionContent(Elf_Shdr &SHeader,
260 void writeSectionContent(Elf_Shdr &SHeader,
263 void writeSectionContent(Elf_Shdr &SHeader,
266 void writeSectionContent(Elf_Shdr &SHeader,
269 void writeSectionContent(Elf_Shdr &SHeader,
272 void writeSectionContent(Elf_Shdr &SHeader,
275 void writeSectionContent(Elf_Shdr &SHeader,
278 void writeSectionContent(Elf_Shdr &SHeader,
281 void writeSectionContent(Elf_Shdr &SHeader,
284 void writeSectionContent(Elf_Shdr &SHeader,
287 void writeSectionContent(Elf_Shdr &SHeader,
290 void writeSectionContent(Elf_Shdr &SHeader,
293 void writeSectionContent(Elf_Shdr &SHeader,
296 void writeSectionContent(Elf_Shdr &SHeader,
304 void assignSectionAddress(Elf_Shdr &SHeader, ELFYAML::Section *YAMLSec);
690 Elf_Shdr &SHeader = SHeaders[SN2I.get(Sec->Name)]; in initSectionHeaders() local
691 if (initImplicitHeader(CBA, SHeader, Sec->Name, in initSectionHeaders()
698 SHeader.sh_name = in initSectionHeaders()
700 SHeader.sh_type = Sec->Type; in initSectionHeaders()
702 SHeader.sh_flags = *Sec->Flags; in initSectionHeaders()
703 SHeader.sh_addralign = Sec->AddressAlign; in initSectionHeaders()
708 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign, Sec->Offset); in initSectionHeaders()
710 assignSectionAddress(SHeader, Sec); in initSectionHeaders()
713 SHeader.sh_link = toSectionIndex(*Sec->Link, Sec->Name); in initSectionHeaders()
719 SHeader.sh_size = *RawSec->Size; in initSectionHeaders()
721 SHeader.sh_info = *RawSec->Info; in initSectionHeaders()
724 SHeader.sh_entsize = *Sec->EntSize; in initSectionHeaders()
726 LocationCounter += SHeader.sh_size; in initSectionHeaders()
727 overrideFields<ELFT>(Sec, SHeader); in initSectionHeaders()
732 SHeader.sh_size = writeContent(CBA, Sec->Content, Sec->Size); in initSectionHeaders()
735 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
737 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
739 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
741 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
743 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
745 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
747 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
749 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
751 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
753 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
755 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
757 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
759 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
761 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
763 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
765 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
767 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
769 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
771 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
773 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
775 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
780 LocationCounter += SHeader.sh_size; in initSectionHeaders()
783 overrideFields<ELFT>(Sec, SHeader); in initSectionHeaders()
788 void ELFState<ELFT>::assignSectionAddress(Elf_Shdr &SHeader, in assignSectionAddress() argument
791 SHeader.sh_addr = *YAMLSec->Address; in assignSectionAddress()
800 !(SHeader.sh_flags & ELF::SHF_ALLOC)) in assignSectionAddress()
804 alignTo(LocationCounter, SHeader.sh_addralign ? SHeader.sh_addralign : 1); in assignSectionAddress()
805 SHeader.sh_addr = LocationCounter; in assignSectionAddress()
849 void ELFState<ELFT>::initSymtabSectionHeader(Elf_Shdr &SHeader, in initSymtabSectionHeader() argument
878 zero(SHeader); in initSymtabSectionHeader()
879 SHeader.sh_name = getSectionNameOffset(IsStatic ? ".symtab" : ".dynsym"); in initSymtabSectionHeader()
882 SHeader.sh_type = YAMLSec->Type; in initSymtabSectionHeader()
884 SHeader.sh_type = IsStatic ? ELF::SHT_SYMTAB : ELF::SHT_DYNSYM; in initSymtabSectionHeader()
889 SHeader.sh_link = toSectionIndex(*RawSec->Link, RawSec->Name); in initSymtabSectionHeader()
903 SHeader.sh_link = Link; in initSymtabSectionHeader()
907 SHeader.sh_flags = *YAMLSec->Flags; in initSymtabSectionHeader()
909 SHeader.sh_flags = ELF::SHF_ALLOC; in initSymtabSectionHeader()
913 SHeader.sh_info = (RawSec && RawSec->Info) ? (unsigned)(*RawSec->Info) in initSymtabSectionHeader()
915 SHeader.sh_entsize = (YAMLSec && YAMLSec->EntSize) in initSymtabSectionHeader()
918 SHeader.sh_addralign = YAMLSec ? (uint64_t)YAMLSec->AddressAlign : 8; in initSymtabSectionHeader()
920 assignSectionAddress(SHeader, YAMLSec); in initSymtabSectionHeader()
922 SHeader.sh_offset = in initSymtabSectionHeader()
923 alignToOffset(CBA, SHeader.sh_addralign, RawSec ? RawSec->Offset : None); in initSymtabSectionHeader()
927 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size); in initSymtabSectionHeader()
933 SHeader.sh_size = Syms.size() * sizeof(Elf_Sym); in initSymtabSectionHeader()
934 CBA.write((const char *)Syms.data(), SHeader.sh_size); in initSymtabSectionHeader()
938 void ELFState<ELFT>::initStrtabSectionHeader(Elf_Shdr &SHeader, StringRef Name, in initStrtabSectionHeader() argument
942 zero(SHeader); in initStrtabSectionHeader()
943 SHeader.sh_name = getSectionNameOffset(Name); in initStrtabSectionHeader()
944 SHeader.sh_type = YAMLSec ? YAMLSec->Type : ELF::SHT_STRTAB; in initStrtabSectionHeader()
945 SHeader.sh_addralign = YAMLSec ? (uint64_t)YAMLSec->AddressAlign : 1; in initStrtabSectionHeader()
950 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign, in initStrtabSectionHeader()
954 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size); in initStrtabSectionHeader()
958 SHeader.sh_size = STB.getSize(); in initStrtabSectionHeader()
962 SHeader.sh_entsize = *YAMLSec->EntSize; in initStrtabSectionHeader()
965 SHeader.sh_info = *RawSec->Info; in initStrtabSectionHeader()
968 SHeader.sh_flags = *YAMLSec->Flags; in initStrtabSectionHeader()
970 SHeader.sh_flags = ELF::SHF_ALLOC; in initStrtabSectionHeader()
972 assignSectionAddress(SHeader, YAMLSec); in initStrtabSectionHeader()
981 Expected<uint64_t> emitDWARF(typename ELFT::Shdr &SHeader, StringRef Name, in emitDWARF() argument
1001 void ELFState<ELFT>::initDWARFSectionHeader(Elf_Shdr &SHeader, StringRef Name, in initDWARFSectionHeader() argument
1004 zero(SHeader); in initDWARFSectionHeader()
1005 SHeader.sh_name = getSectionNameOffset(ELFYAML::dropUniqueSuffix(Name)); in initDWARFSectionHeader()
1006 SHeader.sh_type = YAMLSec ? YAMLSec->Type : ELF::SHT_PROGBITS; in initDWARFSectionHeader()
1007 SHeader.sh_addralign = YAMLSec ? (uint64_t)YAMLSec->AddressAlign : 1; in initDWARFSectionHeader()
1008 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign, in initDWARFSectionHeader()
1020 emitDWARF<ELFT>(SHeader, Name, *Doc.DWARF, CBA)) in initDWARFSectionHeader()
1021 SHeader.sh_size = *ShSizeOrErr; in initDWARFSectionHeader()
1026 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size); in initDWARFSectionHeader()
1032 SHeader.sh_entsize = *YAMLSec->EntSize; in initDWARFSectionHeader()
1034 SHeader.sh_entsize = 1; in initDWARFSectionHeader()
1037 SHeader.sh_info = *RawSec->Info; in initDWARFSectionHeader()
1040 SHeader.sh_flags = *YAMLSec->Flags; in initDWARFSectionHeader()
1042 SHeader.sh_flags = ELF::SHF_MERGE | ELF::SHF_STRINGS; in initDWARFSectionHeader()
1045 SHeader.sh_link = toSectionIndex(*YAMLSec->Link, Name); in initDWARFSectionHeader()
1047 assignSectionAddress(SHeader, YAMLSec); in initDWARFSectionHeader()
1153 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1159 SHeader.sh_size = *S.Size; in writeSectionContent()
1170 Elf_Shdr &SHeader, const ELFYAML::RawContentSection &Section, in writeSectionContent() argument
1173 SHeader.sh_entsize = *Section.EntSize; in writeSectionContent()
1176 SHeader.sh_info = *Section.Info; in writeSectionContent()
1187 Elf_Shdr &SHeader, const ELFYAML::RelocationSection &Section, in writeSectionContent() argument
1195 SHeader.sh_entsize = *Section.EntSize; in writeSectionContent()
1197 SHeader.sh_entsize = IsRela ? sizeof(Elf_Rela) : sizeof(Elf_Rel); in writeSectionContent()
1203 SHeader.sh_link = Link; in writeSectionContent()
1206 SHeader.sh_info = toSectionIndex(Section.RelocatableSec, Section.Name); in writeSectionContent()
1231 SHeader.sh_size = (IsRela ? sizeof(Elf_Rela) : sizeof(Elf_Rel)) * in writeSectionContent()
1236 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1239 SHeader.sh_entsize = in writeSectionContent()
1252 SHeader.sh_size = sizeof(uintX_t) * Section.Entries->size(); in writeSectionContent()
1257 Elf_Shdr &SHeader, const ELFYAML::SymtabShndxSection &Shndx, in writeSectionContent() argument
1259 SHeader.sh_entsize = Shndx.EntSize ? (uint64_t)*Shndx.EntSize : 4; in writeSectionContent()
1262 SHeader.sh_size = writeContent(CBA, Shndx.Content, Shndx.Size); in writeSectionContent()
1271 SHeader.sh_size = Shndx.Entries->size() * SHeader.sh_entsize; in writeSectionContent()
1275 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1284 SHeader.sh_link = Link; in writeSectionContent()
1286 SHeader.sh_entsize = 4; in writeSectionContent()
1289 SHeader.sh_info = in writeSectionContent()
1303 SHeader.sh_size = SHeader.sh_entsize * Section.Members->size(); in writeSectionContent()
1307 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1310 SHeader.sh_entsize = Section.EntSize ? (uint64_t)*Section.EntSize : 2; in writeSectionContent()
1317 SHeader.sh_size = Section.Entries->size() * SHeader.sh_entsize; in writeSectionContent()
1322 Elf_Shdr &SHeader, const ELFYAML::StackSizesSection &Section, in writeSectionContent() argument
1332 SHeader.sh_size += sizeof(uintX_t) + CBA.writeULEB128(E.Size); in writeSectionContent()
1338 Elf_Shdr &SHeader, const ELFYAML::BBAddrMapSection &Section, in writeSectionContent() argument
1348 SHeader.sh_size += sizeof(uintX_t) + CBA.writeULEB128(NumBlocks); in writeSectionContent()
1353 SHeader.sh_size += CBA.writeULEB128(BBE.AddressOffset) + in writeSectionContent()
1361 Elf_Shdr &SHeader, const ELFYAML::LinkerOptionsSection &Section, in writeSectionContent() argument
1371 SHeader.sh_size += (LO.Key.size() + LO.Value.size() + 2); in writeSectionContent()
1377 Elf_Shdr &SHeader, const ELFYAML::DependentLibrariesSection &Section, in writeSectionContent() argument
1385 SHeader.sh_size += Lib.size() + 1; in writeSectionContent()
1415 Elf_Shdr &SHeader, const ELFYAML::CallGraphProfileSection &Section, in writeSectionContent() argument
1418 SHeader.sh_entsize = *Section.EntSize; in writeSectionContent()
1420 SHeader.sh_entsize = 16; in writeSectionContent()
1425 SHeader.sh_link = Link; in writeSectionContent()
1437 SHeader.sh_size += 16; in writeSectionContent()
1442 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1448 SHeader.sh_link = Link; in writeSectionContent()
1451 SHeader.sh_entsize = *Section.EntSize; in writeSectionContent()
1453 SHeader.sh_entsize = sizeof(typename ELFT::Word); in writeSectionContent()
1473 SHeader.sh_size = (2 + Section.Bucket->size() + Section.Chain->size()) * 4; in writeSectionContent()
1477 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1483 SHeader.sh_info = Section.Info; in writeSectionContent()
1517 SHeader.sh_size = Section.Entries->size() * sizeof(Elf_Verdef) + in writeSectionContent()
1522 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1528 SHeader.sh_info = Section.Info; in writeSectionContent()
1565 SHeader.sh_size = Section.VerneedV->size() * sizeof(Elf_Verneed) + in writeSectionContent()
1571 Elf_Shdr &SHeader, const ELFYAML::ARMIndexTableSection &Section, in writeSectionContent() argument
1580 SHeader.sh_size = Section.Entries->size() * 8; in writeSectionContent()
1584 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1592 SHeader.sh_entsize = sizeof(Flags); in writeSectionContent()
1593 SHeader.sh_size = SHeader.sh_entsize; in writeSectionContent()
1610 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1617 SHeader.sh_entsize = *Section.EntSize; in writeSectionContent()
1619 SHeader.sh_entsize = 2 * sizeof(uintX_t); in writeSectionContent()
1628 SHeader.sh_size = 2 * sizeof(uintX_t) * Section.Entries->size(); in writeSectionContent()
1632 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1638 SHeader.sh_link = Link; in writeSectionContent()
1647 SHeader.sh_size += in writeSectionContent()
1652 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1689 SHeader.sh_size = CBA.tell() - Offset; in writeSectionContent()
1693 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1699 SHeader.sh_link = Link; in writeSectionContent()
1742 SHeader.sh_size = 16 /*Header size*/ + in writeSectionContent()