Lines Matching refs:CBA
213 bool initImplicitHeader(ContiguousBlobAccumulator &CBA, Elf_Shdr &Header,
216 ContiguousBlobAccumulator &CBA);
218 ContiguousBlobAccumulator &CBA,
222 ContiguousBlobAccumulator &CBA,
225 ContiguousBlobAccumulator &CBA,
238 ContiguousBlobAccumulator &CBA);
241 ContiguousBlobAccumulator &CBA);
244 ContiguousBlobAccumulator &CBA);
247 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);
300 void writeFill(ELFYAML::Fill &Fill, ContiguousBlobAccumulator &CBA);
309 uint64_t alignToOffset(ContiguousBlobAccumulator &CBA, uint64_t Align,
584 bool ELFState<ELFT>::initImplicitHeader(ContiguousBlobAccumulator &CBA, in initImplicitHeader() argument
592 initSymtabSectionHeader(Header, SymtabType::Static, CBA, YAMLSec); in initImplicitHeader()
594 initStrtabSectionHeader(Header, SecName, DotStrtab, CBA, YAMLSec); in initImplicitHeader()
596 initStrtabSectionHeader(Header, SecName, DotShStrtab, CBA, YAMLSec); in initImplicitHeader()
598 initSymtabSectionHeader(Header, SymtabType::Dynamic, CBA, YAMLSec); in initImplicitHeader()
600 initStrtabSectionHeader(Header, SecName, DotDynstr, CBA, YAMLSec); in initImplicitHeader()
606 initDWARFSectionHeader(Header, SecName, CBA, YAMLSec); in initImplicitHeader()
650 static uint64_t writeContent(ContiguousBlobAccumulator &CBA, in writeContent() argument
655 CBA.writeAsBinary(*Content); in writeContent()
662 CBA.writeZeros(*Size - ContentSize); in writeContent()
668 ContiguousBlobAccumulator &CBA) { in initSectionHeaders() argument
675 S->Offset = alignToOffset(CBA, /*Align=*/1, S->Offset); in initSectionHeaders()
676 writeFill(*S, CBA); in initSectionHeaders()
691 if (initImplicitHeader(CBA, SHeader, Sec->Name, in initSectionHeaders()
708 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign, Sec->Offset); 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()
851 ContiguousBlobAccumulator &CBA, in initSymtabSectionHeader() argument
923 alignToOffset(CBA, SHeader.sh_addralign, RawSec ? RawSec->Offset : None); in initSymtabSectionHeader()
927 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size); in initSymtabSectionHeader()
934 CBA.write((const char *)Syms.data(), SHeader.sh_size); in initSymtabSectionHeader()
940 ContiguousBlobAccumulator &CBA, in initStrtabSectionHeader() argument
950 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign, in initStrtabSectionHeader()
954 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size); in initStrtabSectionHeader()
956 if (raw_ostream *OS = CBA.getRawOS(STB.getSize())) in initStrtabSectionHeader()
983 ContiguousBlobAccumulator &CBA) { in emitDWARF() argument
987 raw_ostream *OS = CBA.getRawOS(0); in emitDWARF()
991 uint64_t BeginOffset = CBA.tell(); in emitDWARF()
997 return CBA.tell() - BeginOffset; in emitDWARF()
1002 ContiguousBlobAccumulator &CBA, in initDWARFSectionHeader() argument
1008 SHeader.sh_offset = alignToOffset(CBA, SHeader.sh_addralign, in initDWARFSectionHeader()
1020 emitDWARF<ELFT>(SHeader, Name, *Doc.DWARF, CBA)) in initDWARFSectionHeader()
1026 SHeader.sh_size = writeContent(CBA, RawSec->Content, RawSec->Size); in initDWARFSectionHeader()
1155 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1165 CBA.writeZeros(*S.Size); in writeSectionContent()
1171 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1188 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1221 CBA.write((const char *)&REntry, sizeof(REntry)); in writeSectionContent()
1227 CBA.write((const char *)&REntry, sizeof(REntry)); in writeSectionContent()
1238 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1249 CBA.write<uintX_t>(E, ELFT::TargetEndianness); in writeSectionContent()
1258 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1262 SHeader.sh_size = writeContent(CBA, Shndx.Content, Shndx.Size); in writeSectionContent()
1270 CBA.write<uint32_t>(E, ELFT::TargetEndianness); in writeSectionContent()
1277 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1301 CBA.write<uint32_t>(SectionIndex, ELFT::TargetEndianness); in writeSectionContent()
1309 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1316 CBA.write<uint16_t>(Version, ELFT::TargetEndianness); in writeSectionContent()
1323 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1331 CBA.write<uintX_t>(E.Address, ELFT::TargetEndianness); in writeSectionContent()
1332 SHeader.sh_size += sizeof(uintX_t) + CBA.writeULEB128(E.Size); in writeSectionContent()
1339 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1345 CBA.write<uintX_t>(E.Address, ELFT::TargetEndianness); in writeSectionContent()
1348 SHeader.sh_size += sizeof(uintX_t) + CBA.writeULEB128(NumBlocks); in writeSectionContent()
1353 SHeader.sh_size += CBA.writeULEB128(BBE.AddressOffset) + in writeSectionContent()
1354 CBA.writeULEB128(BBE.Size) + in writeSectionContent()
1355 CBA.writeULEB128(BBE.Metadata); in writeSectionContent()
1362 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1367 CBA.write(LO.Key.data(), LO.Key.size()); in writeSectionContent()
1368 CBA.write('\0'); in writeSectionContent()
1369 CBA.write(LO.Value.data(), LO.Value.size()); in writeSectionContent()
1370 CBA.write('\0'); in writeSectionContent()
1378 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1383 CBA.write(Lib.data(), Lib.size()); in writeSectionContent()
1384 CBA.write('\0'); in writeSectionContent()
1391 ELFState<ELFT>::alignToOffset(ContiguousBlobAccumulator &CBA, uint64_t Align, in alignToOffset() argument
1393 uint64_t CurrentOffset = CBA.getOffset(); in alignToOffset()
1409 CBA.writeZeros(AlignedOffset - CurrentOffset); in alignToOffset()
1416 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1434 CBA.write<uint32_t>(From, ELFT::TargetEndianness); in writeSectionContent()
1435 CBA.write<uint32_t>(To, ELFT::TargetEndianness); in writeSectionContent()
1436 CBA.write<uint64_t>(E.Weight, ELFT::TargetEndianness); in writeSectionContent()
1444 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1461 CBA.write<uint32_t>( in writeSectionContent()
1464 CBA.write<uint32_t>( in writeSectionContent()
1469 CBA.write<uint32_t>(Val, ELFT::TargetEndianness); in writeSectionContent()
1471 CBA.write<uint32_t>(Val, ELFT::TargetEndianness); in writeSectionContent()
1479 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1504 CBA.write((const char *)&VerDef, sizeof(Elf_Verdef)); in writeSectionContent()
1513 CBA.write((const char *)&VernAux, sizeof(Elf_Verdaux)); in writeSectionContent()
1524 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1547 CBA.write((const char *)&VerNeed, sizeof(Elf_Verneed)); in writeSectionContent()
1561 CBA.write((const char *)&VernAux, sizeof(Elf_Vernaux)); in writeSectionContent()
1572 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1577 CBA.write<uint32_t>(E.Offset, ELFT::TargetEndianness); in writeSectionContent()
1578 CBA.write<uint32_t>(E.Value, ELFT::TargetEndianness); in writeSectionContent()
1586 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1606 CBA.write((const char *)&Flags, sizeof(Flags)); in writeSectionContent()
1612 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1625 CBA.write<uintX_t>(DE.Tag, ELFT::TargetEndianness); in writeSectionContent()
1626 CBA.write<uintX_t>(DE.Val, ELFT::TargetEndianness); in writeSectionContent()
1634 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1648 CBA.writeULEB128(toSymbolIndex(Sym, Section.Name, /*IsDynamic=*/false)); in writeSectionContent()
1654 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1658 uint64_t Offset = CBA.tell(); in writeSectionContent()
1662 CBA.write<uint32_t>(0, ELFT::TargetEndianness); in writeSectionContent()
1664 CBA.write<uint32_t>(NE.Name.size() + 1, ELFT::TargetEndianness); in writeSectionContent()
1668 CBA.write<uint32_t>(0, ELFT::TargetEndianness); in writeSectionContent()
1670 CBA.write<uint32_t>(NE.Desc.binary_size(), ELFT::TargetEndianness); in writeSectionContent()
1673 CBA.write<uint32_t>(NE.Type, ELFT::TargetEndianness); in writeSectionContent()
1677 CBA.write(NE.Name.data(), NE.Name.size()); in writeSectionContent()
1678 CBA.write('\0'); in writeSectionContent()
1679 CBA.padToAlignment(4); in writeSectionContent()
1684 CBA.writeAsBinary(NE.Desc); in writeSectionContent()
1685 CBA.padToAlignment(4); in writeSectionContent()
1689 SHeader.sh_size = CBA.tell() - Offset; in writeSectionContent()
1695 ContiguousBlobAccumulator &CBA) { in writeSectionContent() argument
1712 CBA.write<uint32_t>(*Section.Header->NBuckets, ELFT::TargetEndianness); in writeSectionContent()
1714 CBA.write<uint32_t>(Section.HashBuckets->size(), ELFT::TargetEndianness); in writeSectionContent()
1718 CBA.write<uint32_t>(Section.Header->SymNdx, ELFT::TargetEndianness); in writeSectionContent()
1723 CBA.write<uint32_t>(*Section.Header->MaskWords, ELFT::TargetEndianness); in writeSectionContent()
1725 CBA.write<uint32_t>(Section.BloomFilter->size(), ELFT::TargetEndianness); in writeSectionContent()
1728 CBA.write<uint32_t>(Section.Header->Shift2, ELFT::TargetEndianness); in writeSectionContent()
1732 CBA.write<uintX_t>(Val, ELFT::TargetEndianness); in writeSectionContent()
1736 CBA.write<uint32_t>(Val, ELFT::TargetEndianness); in writeSectionContent()
1740 CBA.write<uint32_t>(Val, ELFT::TargetEndianness); in writeSectionContent()
1750 ContiguousBlobAccumulator &CBA) { in writeFill() argument
1753 CBA.writeZeros(Fill.Size); in writeFill()
1760 CBA.writeAsBinary(*Fill.Pattern); in writeFill()
1761 CBA.writeAsBinary(*Fill.Pattern, Fill.Size - Written); in writeFill()
1919 ContiguousBlobAccumulator CBA(SectionContentBeginOffset, MaxSize); in writeELF() local
1922 State.initSectionHeaders(SHeaders, CBA); in writeELF()
1933 SHOff = State.alignToOffset(CBA, sizeof(typename ELFT::uint), in writeELF()
1935 bool ReachedLimit = SHOff.getValueOr(CBA.getOffset()) + in writeELF()
1938 if (Error E = CBA.takeLimitError()) { in writeELF()
1954 CBA.writeBlobToStream(OS); in writeELF()