Lines Matching defs:CBA
225 bool initImplicitHeader(ContiguousBlobAccumulator &CBA, Elf_Shdr &Header,
228 ContiguousBlobAccumulator &CBA);
230 ContiguousBlobAccumulator &CBA,
234 ContiguousBlobAccumulator &CBA,
237 ContiguousBlobAccumulator &CBA,
250 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);
312 void writeFill(ELFYAML::Fill &Fill, ContiguousBlobAccumulator &CBA);
321 uint64_t alignToOffset(ContiguousBlobAccumulator &CBA, uint64_t Align,
652 bool ELFState<ELFT>::initImplicitHeader(ContiguousBlobAccumulator &CBA,
660 initStrtabSectionHeader(Header, SecName, DotStrtab, CBA, YAMLSec);
662 initStrtabSectionHeader(Header, SecName, DotDynstr, CBA, YAMLSec);
664 initStrtabSectionHeader(Header, SecName, *ShStrtabStrings, CBA, YAMLSec);
666 initSymtabSectionHeader(Header, SymtabType::Static, CBA, YAMLSec);
668 initSymtabSectionHeader(Header, SymtabType::Dynamic, CBA, YAMLSec);
674 initDWARFSectionHeader(Header, SecName, CBA, YAMLSec);
718 static uint64_t writeContent(ContiguousBlobAccumulator &CBA,
723 CBA.writeAsBinary(*Content);
730 CBA.writeZeros(*Size - ContentSize);
759 ContiguousBlobAccumulator &CBA) {
766 S->Offset = alignToOffset(CBA, /*Align=*/1, S->Offset);
767 writeFill(*S, CBA);
778 S->Offset = alignToOffset(CBA, sizeof(typename ELFT::uint),
781 S->Offset = alignToOffset(CBA, /*Align=*/1, S->Offset);
786 CBA.writeZeros(Size);
817 if (initImplicitHeader(CBA, SHeader, Sec->Name,
834 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign, Sec->Offset);
853 SHeader.sh_size = writeContent(CBA, Sec->Content, Sec->Size);
856 writeSectionContent(SHeader, *S, CBA);
858 writeSectionContent(SHeader, *S, CBA);
860 writeSectionContent(SHeader, *S, CBA);
862 writeSectionContent(SHeader, *S, CBA);
864 writeSectionContent(SHeader, *S, CBA);
866 writeSectionContent(SHeader, *S, CBA);
868 writeSectionContent(SHeader, *S, CBA);
870 writeSectionContent(SHeader, *S, CBA);
872 writeSectionContent(SHeader, *S, CBA);
874 writeSectionContent(SHeader, *S, CBA);
876 writeSectionContent(SHeader, *S, CBA);
878 writeSectionContent(SHeader, *S, CBA);
880 writeSectionContent(SHeader, *S, CBA);
882 writeSectionContent(SHeader, *S, CBA);
884 writeSectionContent(SHeader, *S, CBA);
886 writeSectionContent(SHeader, *S, CBA);
888 writeSectionContent(SHeader, *S, CBA);
890 writeSectionContent(SHeader, *S, CBA);
892 writeSectionContent(SHeader, *S, CBA);
894 writeSectionContent(SHeader, *S, CBA);
896 writeSectionContent(SHeader, *S, CBA);
972 ContiguousBlobAccumulator &CBA,
1019 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign,
1024 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size);
1031 CBA.write((const char *)Syms.data(), SHeader.sh_size);
1037 ContiguousBlobAccumulator &CBA,
1046 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign,
1050 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size);
1052 if (raw_ostream *OS = CBA.getRawOS(STB.getSize()))
1076 ContiguousBlobAccumulator &CBA) {
1078 // bytes. This should always return us an output stream unless CBA is already
1080 raw_ostream *OS = CBA.getRawOS(0);
1084 uint64_t BeginOffset = CBA.tell();
1090 return CBA.tell() - BeginOffset;
1095 ContiguousBlobAccumulator &CBA,
1100 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign,
1112 emitDWARF<ELFT>(SHeader, Name, *Doc.DWARF, CBA))
1118 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size);
1239 ContiguousBlobAccumulator &CBA) {
1249 CBA.writeZeros(*S.Size);
1255 ContiguousBlobAccumulator &CBA) {
1269 ContiguousBlobAccumulator &CBA) {
1285 uint64_t CurrentOffset = CBA.getOffset();
1291 CBA.writeULEB128(Section.Relocations->size() * 8 + ELF::CREL_HDR_ADDEND +
1308 CBA.write(B);
1310 CBA.write(B | 0x80);
1311 CBA.writeULEB128(DeltaOffset >> 4);
1315 CBA.writeSLEB128(
1320 CBA.writeSLEB128(static_cast<int32_t>(Rel.Type - Type));
1324 CBA.writeSLEB128(
1334 CBA.write((const char *)&REntry, sizeof(REntry));
1340 CBA.write((const char *)&REntry, sizeof(REntry));
1344 SHeader.sh_size = CBA.getOffset() - CurrentOffset;
1350 ContiguousBlobAccumulator &CBA) {
1358 CBA.write<uintX_t>(E, ELFT::Endianness);
1367 ContiguousBlobAccumulator &CBA) {
1369 SHeader.sh_size = writeContent(CBA, Shndx.Content, Shndx.Size);
1377 CBA.write<uint32_t>(E, ELFT::Endianness);
1384 ContiguousBlobAccumulator &CBA) {
1401 CBA.write<uint32_t>(SectionIndex, ELFT::Endianness);
1409 ContiguousBlobAccumulator &CBA) {
1414 CBA.write<uint16_t>(Version, ELFT::Endianness);
1421 ContiguousBlobAccumulator &CBA) {
1426 CBA.write<uintX_t>(E.Address, ELFT::Endianness);
1427 SHeader.sh_size += sizeof(uintX_t) + CBA.writeULEB128(E.Size);
1434 ContiguousBlobAccumulator &CBA) {
1459 CBA.write(E.Version);
1460 CBA.write(E.Feature);
1481 SHeader.sh_size += CBA.writeULEB128(NumBBRanges);
1488 CBA.write<uintX_t>(BBR.BaseAddress, ELFT::Endianness);
1494 SHeader.sh_size += sizeof(uintX_t) + CBA.writeULEB128(NumBlocks);
1501 SHeader.sh_size += CBA.writeULEB128(BBE.ID);
1502 SHeader.sh_size += CBA.writeULEB128(BBE.AddressOffset);
1503 SHeader.sh_size += CBA.writeULEB128(BBE.Size);
1504 SHeader.sh_size += CBA.writeULEB128(BBE.Metadata);
1512 SHeader.sh_size += CBA.writeULEB128(*PGOEntry.FuncEntryCount);
1528 SHeader.sh_size += CBA.writeULEB128(*PGOBBE.BBFreq);
1530 SHeader.sh_size += CBA.writeULEB128(PGOBBE.Successors->size());
1532 SHeader.sh_size += CBA.writeULEB128(ID);
1533 SHeader.sh_size += CBA.writeULEB128(BrProb);
1543 ContiguousBlobAccumulator &CBA) {
1548 CBA.write(LO.Key.data(), LO.Key.size());
1549 CBA.write('\0');
1550 CBA.write(LO.Value.data(), LO.Value.size());
1551 CBA.write('\0');
1559 ContiguousBlobAccumulator &CBA) {
1564 CBA.write(Lib.data(), Lib.size());
1565 CBA.write('\0');
1572 ELFState<ELFT>::alignToOffset(ContiguousBlobAccumulator &CBA, uint64_t Align,
1574 uint64_t CurrentOffset = CBA.getOffset();
1590 CBA.writeZeros(AlignedOffset - CurrentOffset);
1597 ContiguousBlobAccumulator &CBA) {
1602 CBA.write<uint64_t>(E.Weight, ELFT::Endianness);
1610 ContiguousBlobAccumulator &CBA) {
1614 CBA.write<uint32_t>(
1617 CBA.write<uint32_t>(
1622 CBA.write<uint32_t>(Val, ELFT::Endianness);
1624 CBA.write<uint32_t>(Val, ELFT::Endianness);
1632 ContiguousBlobAccumulator &CBA) {
1658 CBA.write((const char *)&VerDef, sizeof(Elf_Verdef));
1667 CBA.write((const char *)&VerdAux, sizeof(Elf_Verdaux));
1678 ContiguousBlobAccumulator &CBA) {
1701 CBA.write((const char *)&VerNeed, sizeof(Elf_Verneed));
1715 CBA.write((const char *)&VernAux, sizeof(Elf_Vernaux));
1726 ContiguousBlobAccumulator &CBA) {
1731 CBA.write<uint32_t>(E.Offset, ELFT::Endianness);
1732 CBA.write<uint32_t>(E.Value, ELFT::Endianness);
1740 ContiguousBlobAccumulator &CBA) {
1759 CBA.write((const char *)&Flags, sizeof(Flags));
1765 ContiguousBlobAccumulator &CBA) {
1773 CBA.write<uintX_t>(DE.Tag, ELFT::Endianness);
1774 CBA.write<uintX_t>(DE.Val, ELFT::Endianness);
1782 ContiguousBlobAccumulator &CBA) {
1788 CBA.writeULEB128(toSymbolIndex(Sym, Section.Name, /*IsDynamic=*/false));
1794 ContiguousBlobAccumulator &CBA) {
1813 if (CBA.getOffset() != alignTo(CBA.getOffset(), Align)) {
1815 Twine::utohexstr(CBA.getOffset()) + ", should be aligned to " +
1820 uint64_t Offset = CBA.tell();
1824 CBA.write<uint32_t>(0, ELFT::Endianness);
1826 CBA.write<uint32_t>(NE.Name.size() + 1, ELFT::Endianness);
1830 CBA.write<uint32_t>(0, ELFT::Endianness);
1832 CBA.write<uint32_t>(NE.Desc.binary_size(), ELFT::Endianness);
1835 CBA.write<uint32_t>(NE.Type, ELFT::Endianness);
1839 CBA.write(NE.Name.data(), NE.Name.size());
1840 CBA.write('\0');
1845 CBA.padToAlignment(Align);
1846 CBA.writeAsBinary(NE.Desc);
1849 CBA.padToAlignment(Align);
1852 SHeader.sh_size = CBA.tell() - Offset;
1858 ContiguousBlobAccumulator &CBA) {
1870 CBA.write<uint32_t>(*Section.Header->NBuckets, ELFT::Endianness);
1872 CBA.write<uint32_t>(Section.HashBuckets->size(), ELFT::Endianness);
1876 CBA.write<uint32_t>(Section.Header->SymNdx, ELFT::Endianness);
1881 CBA.write<uint32_t>(*Section.Header->MaskWords, ELFT::Endianness);
1883 CBA.write<uint32_t>(Section.BloomFilter->size(), ELFT::Endianness);
1886 CBA.write<uint32_t>(Section.Header->Shift2, ELFT::Endianness);
1890 CBA.write<uintX_t>(Val, ELFT::Endianness);
1894 CBA.write<uint32_t>(Val, ELFT::Endianness);
1898 CBA.write<uint32_t>(Val, ELFT::Endianness);
1908 ContiguousBlobAccumulator &CBA) {
1911 CBA.writeZeros(Fill.Size);
1918 CBA.writeAsBinary(*Fill.Pattern);
1919 CBA.writeAsBinary(*Fill.Pattern, Fill.Size - Written);
2085 ContiguousBlobAccumulator CBA(SectionContentBeginOffset, MaxSize);
2088 State.initSectionHeaders(SHeaders, CBA);
2093 bool ReachedLimit = CBA.getOffset() > MaxSize;
2094 if (Error E = CBA.takeLimitError()) {
2113 CBA.updateDataAt(*SHT.Offset, SHeaders.data(),
2116 CBA.writeBlobToStream(OS);