Lines Matching defs:CBA

228   bool initImplicitHeader(ContiguousBlobAccumulator &CBA, Elf_Shdr &Header,
231 ContiguousBlobAccumulator &CBA);
233 ContiguousBlobAccumulator &CBA,
237 ContiguousBlobAccumulator &CBA,
240 ContiguousBlobAccumulator &CBA,
253 ContiguousBlobAccumulator &CBA);
256 ContiguousBlobAccumulator &CBA);
259 ContiguousBlobAccumulator &CBA);
262 ContiguousBlobAccumulator &CBA);
265 ContiguousBlobAccumulator &CBA);
268 ContiguousBlobAccumulator &CBA);
271 ContiguousBlobAccumulator &CBA);
274 ContiguousBlobAccumulator &CBA);
277 ContiguousBlobAccumulator &CBA);
280 ContiguousBlobAccumulator &CBA);
283 ContiguousBlobAccumulator &CBA);
286 ContiguousBlobAccumulator &CBA);
289 ContiguousBlobAccumulator &CBA);
292 ContiguousBlobAccumulator &CBA);
295 ContiguousBlobAccumulator &CBA);
298 ContiguousBlobAccumulator &CBA);
301 ContiguousBlobAccumulator &CBA);
304 ContiguousBlobAccumulator &CBA);
307 ContiguousBlobAccumulator &CBA);
310 ContiguousBlobAccumulator &CBA);
313 ContiguousBlobAccumulator &CBA);
315 void writeFill(ELFYAML::Fill &Fill, ContiguousBlobAccumulator &CBA);
324 uint64_t alignToOffset(ContiguousBlobAccumulator &CBA, uint64_t Align,
659 bool ELFState<ELFT>::initImplicitHeader(ContiguousBlobAccumulator &CBA,
667 initStrtabSectionHeader(Header, SecName, DotStrtab, CBA, YAMLSec);
669 initStrtabSectionHeader(Header, SecName, DotDynstr, CBA, YAMLSec);
671 initStrtabSectionHeader(Header, SecName, *ShStrtabStrings, CBA, YAMLSec);
673 initSymtabSectionHeader(Header, SymtabType::Static, CBA, YAMLSec);
675 initSymtabSectionHeader(Header, SymtabType::Dynamic, CBA, YAMLSec);
681 initDWARFSectionHeader(Header, SecName, CBA, YAMLSec);
725 static uint64_t writeContent(ContiguousBlobAccumulator &CBA,
730 CBA.writeAsBinary(*Content);
737 CBA.writeZeros(*Size - ContentSize);
766 ContiguousBlobAccumulator &CBA) {
773 S->Offset = alignToOffset(CBA, /*Align=*/1, S->Offset);
774 writeFill(*S, CBA);
785 S->Offset = alignToOffset(CBA, sizeof(typename ELFT::uint),
788 S->Offset = alignToOffset(CBA, /*Align=*/1, S->Offset);
793 CBA.writeZeros(Size);
824 if (initImplicitHeader(CBA, SHeader, Sec->Name,
841 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign, Sec->Offset);
860 SHeader.sh_size = writeContent(CBA, Sec->Content, Sec->Size);
863 writeSectionContent(SHeader, *S, CBA);
865 writeSectionContent(SHeader, *S, CBA);
867 writeSectionContent(SHeader, *S, CBA);
869 writeSectionContent(SHeader, *S, CBA);
871 writeSectionContent(SHeader, *S, CBA);
873 writeSectionContent(SHeader, *S, CBA);
875 writeSectionContent(SHeader, *S, CBA);
877 writeSectionContent(SHeader, *S, CBA);
879 writeSectionContent(SHeader, *S, CBA);
881 writeSectionContent(SHeader, *S, CBA);
883 writeSectionContent(SHeader, *S, CBA);
885 writeSectionContent(SHeader, *S, CBA);
887 writeSectionContent(SHeader, *S, CBA);
889 writeSectionContent(SHeader, *S, CBA);
891 writeSectionContent(SHeader, *S, CBA);
893 writeSectionContent(SHeader, *S, CBA);
895 writeSectionContent(SHeader, *S, CBA);
897 writeSectionContent(SHeader, *S, CBA);
899 writeSectionContent(SHeader, *S, CBA);
901 writeSectionContent(SHeader, *S, CBA);
903 writeSectionContent(SHeader, *S, CBA);
979 ContiguousBlobAccumulator &CBA,
1026 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign,
1031 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size);
1038 CBA.write((const char *)Syms.data(), SHeader.sh_size);
1044 ContiguousBlobAccumulator &CBA,
1053 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign,
1057 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size);
1059 if (raw_ostream *OS = CBA.getRawOS(STB.getSize()))
1083 ContiguousBlobAccumulator &CBA) {
1085 // bytes. This should always return us an output stream unless CBA is already
1087 raw_ostream *OS = CBA.getRawOS(0);
1091 uint64_t BeginOffset = CBA.tell();
1097 return CBA.tell() - BeginOffset;
1102 ContiguousBlobAccumulator &CBA,
1107 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign,
1119 emitDWARF<ELFT>(SHeader, Name, *Doc.DWARF, CBA))
1125 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size);
1246 ContiguousBlobAccumulator &CBA) {
1256 CBA.writeZeros(*S.Size);
1262 ContiguousBlobAccumulator &CBA) {
1276 ContiguousBlobAccumulator &CBA) {
1292 uint64_t CurrentOffset = CBA.getOffset();
1298 CBA.writeULEB128(Section.Relocations->size() * 8 + ELF::CREL_HDR_ADDEND +
1315 CBA.write(B);
1317 CBA.write(B | 0x80);
1318 CBA.writeULEB128(DeltaOffset >> 4);
1322 CBA.writeSLEB128(
1327 CBA.writeSLEB128(static_cast<int32_t>(Rel.Type - Type));
1331 CBA.writeSLEB128(
1341 CBA.write((const char *)&REntry, sizeof(REntry));
1347 CBA.write((const char *)&REntry, sizeof(REntry));
1351 SHeader.sh_size = CBA.getOffset() - CurrentOffset;
1357 ContiguousBlobAccumulator &CBA) {
1365 CBA.write<uintX_t>(E, ELFT::Endianness);
1374 ContiguousBlobAccumulator &CBA) {
1376 SHeader.sh_size = writeContent(CBA, Shndx.Content, Shndx.Size);
1384 CBA.write<uint32_t>(E, ELFT::Endianness);
1391 ContiguousBlobAccumulator &CBA) {
1408 CBA.write<uint32_t>(SectionIndex, ELFT::Endianness);
1416 ContiguousBlobAccumulator &CBA) {
1421 CBA.write<uint16_t>(Version, ELFT::Endianness);
1428 ContiguousBlobAccumulator &CBA) {
1433 CBA.write<uintX_t>(E.Address, ELFT::Endianness);
1434 SHeader.sh_size += sizeof(uintX_t) + CBA.writeULEB128(E.Size);
1441 ContiguousBlobAccumulator &CBA) {
1466 CBA.write(E.Version);
1467 CBA.write(E.Feature);
1488 SHeader.sh_size += CBA.writeULEB128(NumBBRanges);
1495 CBA.write<uintX_t>(BBR.BaseAddress, ELFT::Endianness);
1501 SHeader.sh_size += sizeof(uintX_t) + CBA.writeULEB128(NumBlocks);
1508 SHeader.sh_size += CBA.writeULEB128(BBE.ID);
1509 SHeader.sh_size += CBA.writeULEB128(BBE.AddressOffset);
1510 SHeader.sh_size += CBA.writeULEB128(BBE.Size);
1511 SHeader.sh_size += CBA.writeULEB128(BBE.Metadata);
1519 SHeader.sh_size += CBA.writeULEB128(*PGOEntry.FuncEntryCount);
1535 SHeader.sh_size += CBA.writeULEB128(*PGOBBE.BBFreq);
1537 SHeader.sh_size += CBA.writeULEB128(PGOBBE.Successors->size());
1539 SHeader.sh_size += CBA.writeULEB128(ID);
1540 SHeader.sh_size += CBA.writeULEB128(BrProb);
1550 ContiguousBlobAccumulator &CBA) {
1555 CBA.write(LO.Key.data(), LO.Key.size());
1556 CBA.write('\0');
1557 CBA.write(LO.Value.data(), LO.Value.size());
1558 CBA.write('\0');
1566 ContiguousBlobAccumulator &CBA) {
1571 CBA.write(Lib.data(), Lib.size());
1572 CBA.write('\0');
1579 ELFState<ELFT>::alignToOffset(ContiguousBlobAccumulator &CBA, uint64_t Align,
1581 uint64_t CurrentOffset = CBA.getOffset();
1597 CBA.writeZeros(AlignedOffset - CurrentOffset);
1604 ContiguousBlobAccumulator &CBA) {
1609 CBA.write<uint64_t>(E.Weight, ELFT::Endianness);
1617 ContiguousBlobAccumulator &CBA) {
1621 CBA.write<uint32_t>(
1624 CBA.write<uint32_t>(
1629 CBA.write<uint32_t>(Val, ELFT::Endianness);
1631 CBA.write<uint32_t>(Val, ELFT::Endianness);
1639 ContiguousBlobAccumulator &CBA) {
1665 CBA.write((const char *)&VerDef, sizeof(Elf_Verdef));
1674 CBA.write((const char *)&VernAux, sizeof(Elf_Verdaux));
1685 ContiguousBlobAccumulator &CBA) {
1708 CBA.write((const char *)&VerNeed, sizeof(Elf_Verneed));
1722 CBA.write((const char *)&VernAux, sizeof(Elf_Vernaux));
1733 ContiguousBlobAccumulator &CBA) {
1738 CBA.write<uint32_t>(E.Offset, ELFT::Endianness);
1739 CBA.write<uint32_t>(E.Value, ELFT::Endianness);
1747 ContiguousBlobAccumulator &CBA) {
1766 CBA.write((const char *)&Flags, sizeof(Flags));
1772 ContiguousBlobAccumulator &CBA) {
1780 CBA.write<uintX_t>(DE.Tag, ELFT::Endianness);
1781 CBA.write<uintX_t>(DE.Val, ELFT::Endianness);
1789 ContiguousBlobAccumulator &CBA) {
1795 CBA.writeULEB128(toSymbolIndex(Sym, Section.Name, /*IsDynamic=*/false));
1801 ContiguousBlobAccumulator &CBA) {
1805 uint64_t Offset = CBA.tell();
1809 CBA.write<uint32_t>(0, ELFT::Endianness);
1811 CBA.write<uint32_t>(NE.Name.size() + 1, ELFT::Endianness);
1815 CBA.write<uint32_t>(0, ELFT::Endianness);
1817 CBA.write<uint32_t>(NE.Desc.binary_size(), ELFT::Endianness);
1820 CBA.write<uint32_t>(NE.Type, ELFT::Endianness);
1824 CBA.write(NE.Name.data(), NE.Name.size());
1825 CBA.write('\0');
1826 CBA.padToAlignment(4);
1831 CBA.writeAsBinary(NE.Desc);
1832 CBA.padToAlignment(4);
1836 SHeader.sh_size = CBA.tell() - Offset;
1842 ContiguousBlobAccumulator &CBA) {
1854 CBA.write<uint32_t>(*Section.Header->NBuckets, ELFT::Endianness);
1856 CBA.write<uint32_t>(Section.HashBuckets->size(), ELFT::Endianness);
1860 CBA.write<uint32_t>(Section.Header->SymNdx, ELFT::Endianness);
1865 CBA.write<uint32_t>(*Section.Header->MaskWords, ELFT::Endianness);
1867 CBA.write<uint32_t>(Section.BloomFilter->size(), ELFT::Endianness);
1870 CBA.write<uint32_t>(Section.Header->Shift2, ELFT::Endianness);
1874 CBA.write<uintX_t>(Val, ELFT::Endianness);
1878 CBA.write<uint32_t>(Val, ELFT::Endianness);
1882 CBA.write<uint32_t>(Val, ELFT::Endianness);
1892 ContiguousBlobAccumulator &CBA) {
1895 CBA.writeZeros(Fill.Size);
1902 CBA.writeAsBinary(*Fill.Pattern);
1903 CBA.writeAsBinary(*Fill.Pattern, Fill.Size - Written);
2069 ContiguousBlobAccumulator CBA(SectionContentBeginOffset, MaxSize);
2072 State.initSectionHeaders(SHeaders, CBA);
2077 bool ReachedLimit = CBA.getOffset() > MaxSize;
2078 if (Error E = CBA.takeLimitError()) {
2097 CBA.updateDataAt(*SHT.Offset, SHeaders.data(),
2100 CBA.writeBlobToStream(OS);