Lines Matching refs:SHeader
224 void initSymtabSectionHeader(Elf_Shdr &SHeader, SymtabType STType,
227 void initStrtabSectionHeader(Elf_Shdr &SHeader, StringRef Name,
231 void initDWARFSectionHeader(Elf_Shdr &SHeader, StringRef Name,
243 void writeSectionContent(Elf_Shdr &SHeader,
246 void writeSectionContent(Elf_Shdr &SHeader,
249 void writeSectionContent(Elf_Shdr &SHeader,
252 void writeSectionContent(Elf_Shdr &SHeader,
255 void writeSectionContent(Elf_Shdr &SHeader,
258 void writeSectionContent(Elf_Shdr &SHeader,
261 void writeSectionContent(Elf_Shdr &SHeader,
264 void writeSectionContent(Elf_Shdr &SHeader,
267 void writeSectionContent(Elf_Shdr &SHeader,
270 void writeSectionContent(Elf_Shdr &SHeader,
273 void writeSectionContent(Elf_Shdr &SHeader,
276 void writeSectionContent(Elf_Shdr &SHeader,
279 void writeSectionContent(Elf_Shdr &SHeader,
282 void writeSectionContent(Elf_Shdr &SHeader,
285 void writeSectionContent(Elf_Shdr &SHeader,
288 void writeSectionContent(Elf_Shdr &SHeader,
291 void writeSectionContent(Elf_Shdr &SHeader,
294 void writeSectionContent(Elf_Shdr &SHeader,
297 void writeSectionContent(Elf_Shdr &SHeader,
300 void writeSectionContent(Elf_Shdr &SHeader,
303 void writeSectionContent(Elf_Shdr &SHeader,
311 void assignSectionAddress(Elf_Shdr &SHeader, ELFYAML::Section *YAMLSec);
795 Elf_Shdr &SHeader = SHeaders[SN2I.get(Sec->Name)]; in initSectionHeaders() local
797 SHeader.sh_link = toSectionIndex(*Sec->Link, Sec->Name); in initSectionHeaders()
803 SHeader.sh_link = Link; in initSectionHeaders()
807 SHeader.sh_entsize = *Sec->EntSize; in initSectionHeaders()
809 SHeader.sh_entsize = ELFYAML::getDefaultShEntSize<ELFT>( in initSectionHeaders()
816 if (initImplicitHeader(CBA, SHeader, Sec->Name, in initSectionHeaders()
823 SHeader.sh_name = in initSectionHeaders()
825 SHeader.sh_type = Sec->Type; in initSectionHeaders()
827 SHeader.sh_flags = *Sec->Flags; in initSectionHeaders()
828 SHeader.sh_addralign = Sec->AddressAlign; in initSectionHeaders()
833 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign, Sec->Offset); in initSectionHeaders()
835 assignSectionAddress(SHeader, Sec); in initSectionHeaders()
841 SHeader.sh_size = *RawSec->Size; in initSectionHeaders()
843 SHeader.sh_info = *RawSec->Info; in initSectionHeaders()
846 LocationCounter += SHeader.sh_size; in initSectionHeaders()
847 overrideFields<ELFT>(Sec, SHeader); in initSectionHeaders()
852 SHeader.sh_size = writeContent(CBA, Sec->Content, Sec->Size); in initSectionHeaders()
855 writeSectionContent(SHeader, *S, CBA); 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()
900 LocationCounter += SHeader.sh_size; in initSectionHeaders()
903 overrideFields<ELFT>(Sec, SHeader); in initSectionHeaders()
908 void ELFState<ELFT>::assignSectionAddress(Elf_Shdr &SHeader, in assignSectionAddress() argument
911 SHeader.sh_addr = *YAMLSec->Address; in assignSectionAddress()
920 !(SHeader.sh_flags & ELF::SHF_ALLOC)) in assignSectionAddress()
924 alignTo(LocationCounter, SHeader.sh_addralign ? SHeader.sh_addralign : 1); in assignSectionAddress()
925 SHeader.sh_addr = LocationCounter; in assignSectionAddress()
969 void ELFState<ELFT>::initSymtabSectionHeader(Elf_Shdr &SHeader, in initSymtabSectionHeader() argument
998 SHeader.sh_name = getSectionNameOffset(IsStatic ? ".symtab" : ".dynsym"); in initSymtabSectionHeader()
1001 SHeader.sh_type = YAMLSec->Type; in initSymtabSectionHeader()
1003 SHeader.sh_type = IsStatic ? ELF::SHT_SYMTAB : ELF::SHT_DYNSYM; in initSymtabSectionHeader()
1006 SHeader.sh_flags = *YAMLSec->Flags; in initSymtabSectionHeader()
1008 SHeader.sh_flags = ELF::SHF_ALLOC; in initSymtabSectionHeader()
1012 SHeader.sh_info = (RawSec && RawSec->Info) ? (unsigned)(*RawSec->Info) in initSymtabSectionHeader()
1014 SHeader.sh_addralign = YAMLSec ? (uint64_t)YAMLSec->AddressAlign : 8; in initSymtabSectionHeader()
1016 assignSectionAddress(SHeader, YAMLSec); in initSymtabSectionHeader()
1018 SHeader.sh_offset = in initSymtabSectionHeader()
1019 alignToOffset(CBA, SHeader.sh_addralign, RawSec ? RawSec->Offset : None); in initSymtabSectionHeader()
1023 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size); in initSymtabSectionHeader()
1029 SHeader.sh_size = Syms.size() * sizeof(Elf_Sym); in initSymtabSectionHeader()
1030 CBA.write((const char *)Syms.data(), SHeader.sh_size); in initSymtabSectionHeader()
1034 void ELFState<ELFT>::initStrtabSectionHeader(Elf_Shdr &SHeader, StringRef Name, in initStrtabSectionHeader() argument
1038 SHeader.sh_name = getSectionNameOffset(ELFYAML::dropUniqueSuffix(Name)); in initStrtabSectionHeader()
1039 SHeader.sh_type = YAMLSec ? YAMLSec->Type : ELF::SHT_STRTAB; in initStrtabSectionHeader()
1040 SHeader.sh_addralign = YAMLSec ? (uint64_t)YAMLSec->AddressAlign : 1; in initStrtabSectionHeader()
1045 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign, in initStrtabSectionHeader()
1049 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size); in initStrtabSectionHeader()
1053 SHeader.sh_size = STB.getSize(); in initStrtabSectionHeader()
1057 SHeader.sh_info = *RawSec->Info; in initStrtabSectionHeader()
1060 SHeader.sh_flags = *YAMLSec->Flags; in initStrtabSectionHeader()
1062 SHeader.sh_flags = ELF::SHF_ALLOC; in initStrtabSectionHeader()
1064 assignSectionAddress(SHeader, YAMLSec); in initStrtabSectionHeader()
1073 Expected<uint64_t> emitDWARF(typename ELFT::Shdr &SHeader, StringRef Name, in emitDWARF() argument
1093 void ELFState<ELFT>::initDWARFSectionHeader(Elf_Shdr &SHeader, StringRef Name, in initDWARFSectionHeader() argument
1096 SHeader.sh_name = getSectionNameOffset(ELFYAML::dropUniqueSuffix(Name)); in initDWARFSectionHeader()
1097 SHeader.sh_type = YAMLSec ? YAMLSec->Type : ELF::SHT_PROGBITS; in initDWARFSectionHeader()
1098 SHeader.sh_addralign = YAMLSec ? (uint64_t)YAMLSec->AddressAlign : 1; in initDWARFSectionHeader()
1099 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign, in initDWARFSectionHeader()
1111 emitDWARF<ELFT>(SHeader, Name, *Doc.DWARF, CBA)) in initDWARFSectionHeader()
1112 SHeader.sh_size = *ShSizeOrErr; in initDWARFSectionHeader()
1117 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size); in initDWARFSectionHeader()
1123 SHeader.sh_info = *RawSec->Info; in initDWARFSectionHeader()
1126 SHeader.sh_flags = *YAMLSec->Flags; in initDWARFSectionHeader()
1128 SHeader.sh_flags = ELF::SHF_MERGE | ELF::SHF_STRINGS; in initDWARFSectionHeader()
1130 assignSectionAddress(SHeader, YAMLSec); in initDWARFSectionHeader()
1236 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1242 SHeader.sh_size = *S.Size; in writeSectionContent()
1253 Elf_Shdr &SHeader, const ELFYAML::RawContentSection &Section, in writeSectionContent() argument
1256 SHeader.sh_info = *Section.Info; in writeSectionContent()
1267 Elf_Shdr &SHeader, const ELFYAML::RelocationSection &Section, in writeSectionContent() argument
1274 SHeader.sh_info = toSectionIndex(Section.RelocatableSec, Section.Name); in writeSectionContent()
1300 SHeader.sh_size = (IsRela ? sizeof(Elf_Rela) : sizeof(Elf_Rel)) * in writeSectionContent()
1305 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1318 SHeader.sh_size = sizeof(uintX_t) * Section.Entries->size(); in writeSectionContent()
1323 Elf_Shdr &SHeader, const ELFYAML::SymtabShndxSection &Shndx, in writeSectionContent() argument
1326 SHeader.sh_size = writeContent(CBA, Shndx.Content, Shndx.Size); in writeSectionContent()
1335 SHeader.sh_size = Shndx.Entries->size() * SHeader.sh_entsize; in writeSectionContent()
1339 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1346 SHeader.sh_info = in writeSectionContent()
1360 SHeader.sh_size = SHeader.sh_entsize * Section.Members->size(); in writeSectionContent()
1364 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1372 SHeader.sh_size = Section.Entries->size() * SHeader.sh_entsize; in writeSectionContent()
1377 Elf_Shdr &SHeader, const ELFYAML::StackSizesSection &Section, in writeSectionContent() argument
1384 SHeader.sh_size += sizeof(uintX_t) + CBA.writeULEB128(E.Size); in writeSectionContent()
1390 Elf_Shdr &SHeader, const ELFYAML::BBAddrMapSection &Section, in writeSectionContent() argument
1404 SHeader.sh_size += 2; in writeSectionContent()
1412 SHeader.sh_size += sizeof(uintX_t) + CBA.writeULEB128(NumBlocks); in writeSectionContent()
1417 SHeader.sh_size += CBA.writeULEB128(BBE.AddressOffset) + in writeSectionContent()
1425 Elf_Shdr &SHeader, const ELFYAML::LinkerOptionsSection &Section, in writeSectionContent() argument
1435 SHeader.sh_size += (LO.Key.size() + LO.Value.size() + 2); in writeSectionContent()
1441 Elf_Shdr &SHeader, const ELFYAML::DependentLibrariesSection &Section, in writeSectionContent() argument
1449 SHeader.sh_size += Lib.size() + 1; in writeSectionContent()
1479 Elf_Shdr &SHeader, const ELFYAML::CallGraphProfileSection &Section, in writeSectionContent() argument
1486 SHeader.sh_size += sizeof(object::Elf_CGProfile_Impl<ELFT>); in writeSectionContent()
1491 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1509 SHeader.sh_size = (2 + Section.Bucket->size() + Section.Chain->size()) * 4; in writeSectionContent()
1513 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1518 SHeader.sh_info = *Section.Info; in writeSectionContent()
1520 SHeader.sh_info = Section.Entries->size(); in writeSectionContent()
1554 SHeader.sh_size = Section.Entries->size() * sizeof(Elf_Verdef) + in writeSectionContent()
1559 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1563 SHeader.sh_info = *Section.Info; in writeSectionContent()
1565 SHeader.sh_info = Section.VerneedV->size(); in writeSectionContent()
1602 SHeader.sh_size = Section.VerneedV->size() * sizeof(Elf_Verneed) + in writeSectionContent()
1608 Elf_Shdr &SHeader, const ELFYAML::ARMIndexTableSection &Section, in writeSectionContent() argument
1617 SHeader.sh_size = Section.Entries->size() * 8; in writeSectionContent()
1621 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1629 SHeader.sh_size = SHeader.sh_entsize; in writeSectionContent()
1646 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1659 SHeader.sh_size = 2 * sizeof(uintX_t) * Section.Entries->size(); in writeSectionContent()
1663 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1670 SHeader.sh_size += in writeSectionContent()
1675 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1712 SHeader.sh_size = CBA.tell() - Offset; in writeSectionContent()
1716 void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader, in writeSectionContent() argument
1760 SHeader.sh_size = 16 /*Header size*/ + in writeSectionContent()