Lines Matching refs:SHeader
226 void initSymtabSectionHeader(Elf_Shdr &SHeader, SymtabType STType,
229 void initStrtabSectionHeader(Elf_Shdr &SHeader, StringRef Name,
233 void initDWARFSectionHeader(Elf_Shdr &SHeader, StringRef Name,
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,
299 void writeSectionContent(Elf_Shdr &SHeader,
302 void writeSectionContent(Elf_Shdr &SHeader,
305 void writeSectionContent(Elf_Shdr &SHeader,
313 void assignSectionAddress(Elf_Shdr &SHeader, ELFYAML::Section *YAMLSec);
797 Elf_Shdr &SHeader = SHeaders[SN2I.get(Sec->Name)]; in initSectionHeaders() local
799 SHeader.sh_link = toSectionIndex(*Sec->Link, Sec->Name); in initSectionHeaders()
805 SHeader.sh_link = Link; in initSectionHeaders()
809 SHeader.sh_entsize = *Sec->EntSize; in initSectionHeaders()
811 SHeader.sh_entsize = ELFYAML::getDefaultShEntSize<ELFT>( in initSectionHeaders()
818 if (initImplicitHeader(CBA, SHeader, Sec->Name, in initSectionHeaders()
825 SHeader.sh_name = in initSectionHeaders()
827 SHeader.sh_type = Sec->Type; in initSectionHeaders()
829 SHeader.sh_flags = *Sec->Flags; in initSectionHeaders()
830 SHeader.sh_addralign = Sec->AddressAlign; in initSectionHeaders()
835 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign, Sec->Offset); in initSectionHeaders()
837 assignSectionAddress(SHeader, Sec); in initSectionHeaders()
843 SHeader.sh_size = *RawSec->Size; in initSectionHeaders()
845 SHeader.sh_info = *RawSec->Info; in initSectionHeaders()
848 LocationCounter += SHeader.sh_size; in initSectionHeaders()
849 overrideFields<ELFT>(Sec, SHeader); in initSectionHeaders()
854 SHeader.sh_size = writeContent(CBA, Sec->Content, Sec->Size); in initSectionHeaders()
857 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
859 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
861 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
863 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
865 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
867 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
869 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
871 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
873 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
875 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
877 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
879 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
881 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
883 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
885 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
887 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
889 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
891 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
893 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
895 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
897 writeSectionContent(SHeader, *S, CBA); in initSectionHeaders()
902 LocationCounter += SHeader.sh_size; in initSectionHeaders()
905 overrideFields<ELFT>(Sec, SHeader); in initSectionHeaders()
910 void ELFState<ELFT>::assignSectionAddress(Elf_Shdr &SHeader, in assignSectionAddress() argument
913 SHeader.sh_addr = *YAMLSec->Address; in assignSectionAddress()
922 !(SHeader.sh_flags & ELF::SHF_ALLOC)) in assignSectionAddress()
926 alignTo(LocationCounter, SHeader.sh_addralign ? SHeader.sh_addralign : 1); in assignSectionAddress()
927 SHeader.sh_addr = LocationCounter; in assignSectionAddress()
971 void ELFState<ELFT>::initSymtabSectionHeader(Elf_Shdr &SHeader, in initSymtabSectionHeader() argument
1000 SHeader.sh_name = getSectionNameOffset(IsStatic ? ".symtab" : ".dynsym"); in initSymtabSectionHeader()
1003 SHeader.sh_type = YAMLSec->Type; in initSymtabSectionHeader()
1005 SHeader.sh_type = IsStatic ? ELF::SHT_SYMTAB : ELF::SHT_DYNSYM; in initSymtabSectionHeader()
1008 SHeader.sh_flags = *YAMLSec->Flags; in initSymtabSectionHeader()
1010 SHeader.sh_flags = ELF::SHF_ALLOC; in initSymtabSectionHeader()
1014 SHeader.sh_info = (RawSec && RawSec->Info) ? (unsigned)(*RawSec->Info) in initSymtabSectionHeader()
1016 SHeader.sh_addralign = YAMLSec ? (uint64_t)YAMLSec->AddressAlign : 8; in initSymtabSectionHeader()
1018 assignSectionAddress(SHeader, YAMLSec); in initSymtabSectionHeader()
1020 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign, in initSymtabSectionHeader()
1025 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size); in initSymtabSectionHeader()
1031 SHeader.sh_size = Syms.size() * sizeof(Elf_Sym); in initSymtabSectionHeader()
1032 CBA.write((const char *)Syms.data(), SHeader.sh_size); in initSymtabSectionHeader()
1036 void ELFState<ELFT>::initStrtabSectionHeader(Elf_Shdr &SHeader, StringRef Name, in initStrtabSectionHeader() argument
1040 SHeader.sh_name = getSectionNameOffset(ELFYAML::dropUniqueSuffix(Name)); in initStrtabSectionHeader()
1041 SHeader.sh_type = YAMLSec ? YAMLSec->Type : ELF::SHT_STRTAB; in initStrtabSectionHeader()
1042 SHeader.sh_addralign = YAMLSec ? (uint64_t)YAMLSec->AddressAlign : 1; in initStrtabSectionHeader()
1047 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign, in initStrtabSectionHeader()
1051 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size); in initStrtabSectionHeader()
1055 SHeader.sh_size = STB.getSize(); in initStrtabSectionHeader()
1059 SHeader.sh_info = *RawSec->Info; in initStrtabSectionHeader()
1062 SHeader.sh_flags = *YAMLSec->Flags; in initStrtabSectionHeader()
1064 SHeader.sh_flags = ELF::SHF_ALLOC; in initStrtabSectionHeader()
1066 assignSectionAddress(SHeader, YAMLSec); in initStrtabSectionHeader()
1075 Expected<uint64_t> emitDWARF(typename ELFT::Shdr &SHeader, StringRef Name, in emitDWARF() argument
1095 void ELFState<ELFT>::initDWARFSectionHeader(Elf_Shdr &SHeader, StringRef Name, in initDWARFSectionHeader() argument
1098 SHeader.sh_name = getSectionNameOffset(ELFYAML::dropUniqueSuffix(Name)); in initDWARFSectionHeader()
1099 SHeader.sh_type = YAMLSec ? YAMLSec->Type : ELF::SHT_PROGBITS; in initDWARFSectionHeader()
1100 SHeader.sh_addralign = YAMLSec ? (uint64_t)YAMLSec->AddressAlign : 1; in initDWARFSectionHeader()
1101 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign, in initDWARFSectionHeader()
1113 emitDWARF<ELFT>(SHeader, Name, *Doc.DWARF, CBA)) in initDWARFSectionHeader()
1114 SHeader.sh_size = *ShSizeOrErr; in initDWARFSectionHeader()
1119 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size); in initDWARFSectionHeader()
1125 SHeader.sh_info = *RawSec->Info; in initDWARFSectionHeader()
1128 SHeader.sh_flags = *YAMLSec->Flags; in initDWARFSectionHeader()
1130 SHeader.sh_flags = ELF::SHF_MERGE | ELF::SHF_STRINGS; in initDWARFSectionHeader()
1132 assignSectionAddress(SHeader, YAMLSec); in initDWARFSectionHeader()
1238 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1244 SHeader.sh_size = *S.Size; in writeSectionContent()
1255 Elf_Shdr &SHeader, const ELFYAML::RawContentSection &Section, in writeSectionContent() argument
1258 SHeader.sh_info = *Section.Info; in writeSectionContent()
1269 Elf_Shdr &SHeader, const ELFYAML::RelocationSection &Section, in writeSectionContent() argument
1276 SHeader.sh_info = toSectionIndex(Section.RelocatableSec, Section.Name); in writeSectionContent()
1302 SHeader.sh_size = (IsRela ? sizeof(Elf_Rela) : sizeof(Elf_Rel)) * in writeSectionContent()
1307 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1320 SHeader.sh_size = sizeof(uintX_t) * Section.Entries->size(); in writeSectionContent()
1325 Elf_Shdr &SHeader, const ELFYAML::SymtabShndxSection &Shndx, in writeSectionContent() argument
1328 SHeader.sh_size = writeContent(CBA, Shndx.Content, Shndx.Size); in writeSectionContent()
1337 SHeader.sh_size = Shndx.Entries->size() * SHeader.sh_entsize; in writeSectionContent()
1341 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1348 SHeader.sh_info = in writeSectionContent()
1362 SHeader.sh_size = SHeader.sh_entsize * Section.Members->size(); in writeSectionContent()
1366 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1374 SHeader.sh_size = Section.Entries->size() * SHeader.sh_entsize; in writeSectionContent()
1379 Elf_Shdr &SHeader, const ELFYAML::StackSizesSection &Section, in writeSectionContent() argument
1386 SHeader.sh_size += sizeof(uintX_t) + CBA.writeULEB128(E.Size); in writeSectionContent()
1392 Elf_Shdr &SHeader, const ELFYAML::BBAddrMapSection &Section, in writeSectionContent() argument
1420 SHeader.sh_size += 2; in writeSectionContent()
1436 SHeader.sh_size += sizeof(uintX_t) + CBA.writeULEB128(NumBlocks); in writeSectionContent()
1441 SHeader.sh_size += CBA.writeULEB128(BBE.ID); in writeSectionContent()
1442 SHeader.sh_size += CBA.writeULEB128(BBE.AddressOffset) + in writeSectionContent()
1453 SHeader.sh_size += CBA.writeULEB128(*PGOEntry.FuncEntryCount); in writeSectionContent()
1469 SHeader.sh_size += CBA.writeULEB128(*PGOBBE.BBFreq); in writeSectionContent()
1471 SHeader.sh_size += CBA.writeULEB128(PGOBBE.Successors->size()); in writeSectionContent()
1473 SHeader.sh_size += CBA.writeULEB128(ID) + CBA.writeULEB128(BrProb); in writeSectionContent()
1481 Elf_Shdr &SHeader, const ELFYAML::LinkerOptionsSection &Section, in writeSectionContent() argument
1491 SHeader.sh_size += (LO.Key.size() + LO.Value.size() + 2); in writeSectionContent()
1497 Elf_Shdr &SHeader, const ELFYAML::DependentLibrariesSection &Section, in writeSectionContent() argument
1505 SHeader.sh_size += Lib.size() + 1; in writeSectionContent()
1535 Elf_Shdr &SHeader, const ELFYAML::CallGraphProfileSection &Section, in writeSectionContent() argument
1542 SHeader.sh_size += sizeof(object::Elf_CGProfile_Impl<ELFT>); in writeSectionContent()
1547 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1565 SHeader.sh_size = (2 + Section.Bucket->size() + Section.Chain->size()) * 4; in writeSectionContent()
1569 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1574 SHeader.sh_info = *Section.Info; in writeSectionContent()
1576 SHeader.sh_info = Section.Entries->size(); in writeSectionContent()
1610 SHeader.sh_size = Section.Entries->size() * sizeof(Elf_Verdef) + in writeSectionContent()
1615 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1619 SHeader.sh_info = *Section.Info; in writeSectionContent()
1621 SHeader.sh_info = Section.VerneedV->size(); in writeSectionContent()
1658 SHeader.sh_size = Section.VerneedV->size() * sizeof(Elf_Verneed) + in writeSectionContent()
1664 Elf_Shdr &SHeader, const ELFYAML::ARMIndexTableSection &Section, in writeSectionContent() argument
1673 SHeader.sh_size = Section.Entries->size() * 8; in writeSectionContent()
1677 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1685 SHeader.sh_size = SHeader.sh_entsize; in writeSectionContent()
1702 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1715 SHeader.sh_size = 2 * sizeof(uintX_t) * Section.Entries->size(); in writeSectionContent()
1719 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1726 SHeader.sh_size += in writeSectionContent()
1731 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1768 SHeader.sh_size = CBA.tell() - Offset; in writeSectionContent()
1772 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1816 SHeader.sh_size = 16 /*Header size*/ + in writeSectionContent()