30constexpr unsigned DefaultSectionAlign = 4;
31constexpr int16_t MaxSectionIndex = INT16_MAX;
32constexpr uint32_t MaxRawDataSize = UINT32_MAX;
45 const Twine &fieldName);
46 bool nameShouldBeInStringTable(
StringRef SymbolName);
47 bool initFileHeader(
uint64_t CurrentOffset);
48 void initAuxFileHeader();
49 bool initSectionHeaders(
uint64_t &CurrentOffset);
51 bool initStringTable();
52 bool assignAddressesAndIndices();
54 void writeFileHeader();
55 void writeAuxFileHeader();
56 void writeSectionHeaders();
57 bool writeSectionData();
58 bool writeRelocations();
69 bool writeAuxSymbol(
const std::unique_ptr<XCOFFYAML::AuxSymbolEnt> &AuxSym);
84 std::vector<XCOFFYAML::Section> InitSections = Obj.
Sections;
96void XCOFFWriter::reportOverwrite(
uint64_t CurrentOffset,
98 const Twine &fieldName) {
99 ErrHandler(
"current file offset (" +
Twine(CurrentOffset) +
100 ") is bigger than the specified " + fieldName +
" (" +
101 Twine(specifiedOffset) +
") ");
104bool XCOFFWriter::nameShouldBeInStringTable(
StringRef SymbolName) {
109bool XCOFFWriter::initRelocations(
uint64_t &CurrentOffset) {
111 if (!InitSection.Relocations.empty()) {
114 uint64_t UsedSize = RelSize * InitSection.Relocations.size();
118 if (!InitSection.NumberOfRelocations)
119 InitSection.NumberOfRelocations = InitSection.Relocations.size();
122 if (InitSection.FileOffsetToRelocations) {
123 if (CurrentOffset > InitSection.FileOffsetToRelocations) {
124 reportOverwrite(CurrentOffset, InitSection.FileOffsetToRelocations,
125 "FileOffsetToRelocations for the " +
126 InitSection.SectionName +
" section");
129 CurrentOffset = InitSection.FileOffsetToRelocations;
131 InitSection.FileOffsetToRelocations = CurrentOffset;
132 CurrentOffset += UsedSize;
133 if (CurrentOffset > MaxRawDataSize) {
134 ErrHandler(
"maximum object size (" +
Twine(MaxRawDataSize) +
135 ") exceeded when writing relocation data for section " +
136 Twine(InitSection.SectionName));
144bool XCOFFWriter::initSectionHeaders(
uint64_t &CurrentOffset) {
147 for (
uint16_t I = 0, E = InitSections.size();
I < E; ++
I) {
150 !SectionIndexMap[InitSections[
I].SectionName]) {
152 SectionIndexMap[InitSections[
I].SectionName] =
I + 1;
153 if ((
I + 1) > MaxSectionIndex) {
154 ErrHandler(
"exceeded the maximum permitted section index of " +
155 Twine(MaxSectionIndex));
160 if (!InitSections[
I].
Size)
161 InitSections[
I].Size = InitSections[
I].SectionData.binary_size();
174 switch (InitSections[
I].Flags) {
176 CurrentEndDataAddr = InitSections[
I].Address + InitSections[
I].Size;
179 if (!InitSections[
I].Address)
180 InitSections[
I].Address = CurrentEndDataAddr;
183 CurrentEndTDataAddr = InitSections[
I].Address + InitSections[
I].Size;
186 if (!InitSections[
I].Address)
187 InitSections[
I].Address = CurrentEndTDataAddr;
191 if (InitSections[
I].SectionData.binary_size()) {
192 if (InitSections[
I].FileOffsetToData) {
194 if (CurrentOffset > InitSections[
I].FileOffsetToData) {
195 reportOverwrite(CurrentOffset, InitSections[
I].FileOffsetToData,
196 "FileOffsetToData for the " +
200 CurrentOffset = InitSections[
I].FileOffsetToData;
202 CurrentOffset =
alignTo(CurrentOffset, DefaultSectionAlign);
203 InitSections[
I].FileOffsetToData = CurrentOffset;
205 CurrentOffset += InitSections[
I].SectionData.binary_size();
206 if (CurrentOffset > MaxRawDataSize) {
207 ErrHandler(
"maximum object size (" +
Twine(MaxRawDataSize) +
208 ") exceeded when writing data for section " +
Twine(
I + 1) +
213 if (InitSections[
I].SectionSubtype) {
215 static_cast<uint32_t>(*InitSections[
I].SectionSubtype);
217 ErrHandler(
"a DWARFSectionSubtype is only allowed for a DWARF section");
220 unsigned Mask = Is64Bit ? XCOFFSectionHeader64::SectionFlagsTypeMask
221 : XCOFFSectionHeader32::SectionFlagsTypeMask;
222 if (DWARFSubtype & Mask) {
223 ErrHandler(
"the low-order bits of DWARFSectionSubtype must be 0");
226 InitSections[
I].Flags |= DWARFSubtype;
232bool XCOFFWriter::initStringTable() {
233 if (Obj.StrTbl.RawContent) {
234 size_t RawSize = Obj.StrTbl.RawContent->binary_size();
235 if (Obj.StrTbl.Strings || Obj.StrTbl.Length) {
237 "can't specify Strings or Length when RawContent is specified");
240 if (Obj.StrTbl.ContentSize && *Obj.StrTbl.ContentSize < RawSize) {
241 ErrHandler(
"specified ContentSize (" +
Twine(*Obj.StrTbl.ContentSize) +
242 ") is less than the RawContent data size (" +
Twine(RawSize) +
248 if (Obj.StrTbl.ContentSize && *Obj.StrTbl.ContentSize <= 3) {
249 ErrHandler(
"ContentSize shouldn't be less than 4 without RawContent");
254 StrTblBuilder.clear();
256 if (Obj.StrTbl.Strings) {
258 for (
StringRef StringEnt : *Obj.StrTbl.Strings)
259 StrTblBuilder.add(StringEnt);
261 size_t StrTblIdx = 0;
262 size_t NumOfStrings = Obj.StrTbl.Strings->size();
264 if (nameShouldBeInStringTable(YamlSym.
SymbolName)) {
265 if (StrTblIdx < NumOfStrings) {
267 YamlSym.
SymbolName = (*Obj.StrTbl.Strings)[StrTblIdx];
277 if (nameShouldBeInStringTable(YamlSym.
SymbolName))
285 for (
const std::unique_ptr<XCOFFYAML::AuxSymbolEnt> &AuxSym :
287 if (
auto AS = dyn_cast<XCOFFYAML::FileAuxEnt>(AuxSym.get()))
288 if (nameShouldBeInStringTable(AS->FileNameOrString.value_or(
"")))
289 StrTblBuilder.add(AS->FileNameOrString.value_or(
""));
293 StrTblBuilder.finalize();
295 size_t StrTblSize = StrTblBuilder.getSize();
296 if (Obj.StrTbl.ContentSize && *Obj.StrTbl.ContentSize < StrTblSize) {
297 ErrHandler(
"specified ContentSize (" +
Twine(*Obj.StrTbl.ContentSize) +
298 ") is less than the size of the data that would otherwise be "
300 Twine(StrTblSize) +
")");
307bool XCOFFWriter::initFileHeader(
uint64_t CurrentOffset) {
310 InitFileHdr.NumberOfSections = Obj.Sections.size();
311 InitFileHdr.NumberOfSymTableEntries = Obj.Symbols.size();
316 ErrHandler(
"specified NumberOfAuxEntries " +
318 " is less than the actual number "
319 "of auxiliary entries " +
329 if (InitFileHdr.NumberOfSymTableEntries) {
330 if (Obj.Header.SymbolTableOffset) {
331 if (CurrentOffset > Obj.Header.SymbolTableOffset) {
332 reportOverwrite(CurrentOffset, Obj.Header.SymbolTableOffset,
333 "SymbolTableOffset");
336 CurrentOffset = Obj.Header.SymbolTableOffset;
338 InitFileHdr.SymbolTableOffset = CurrentOffset;
341 if (CurrentOffset > MaxRawDataSize) {
342 ErrHandler(
"maximum object size of " +
Twine(MaxRawDataSize) +
343 " exceeded when writing symbols");
351void XCOFFWriter::initAuxFileHeader() {
353 InitAuxFileHdr = *Obj.AuxHeader;
362 for (
uint16_t I = 0, E = InitSections.size();
I < E; ++
I) {
363 switch (InitSections[
I].Flags) {
365 if (!InitAuxFileHdr.TextSize)
366 InitAuxFileHdr.TextSize = InitSections[
I].Size;
367 if (!InitAuxFileHdr.TextStartAddr)
368 InitAuxFileHdr.TextStartAddr = InitSections[
I].Address;
369 if (!InitAuxFileHdr.SecNumOfText)
370 InitAuxFileHdr.SecNumOfText =
I + 1;
373 if (!InitAuxFileHdr.InitDataSize)
374 InitAuxFileHdr.InitDataSize = InitSections[
I].Size;
375 if (!InitAuxFileHdr.DataStartAddr)
376 InitAuxFileHdr.DataStartAddr = InitSections[
I].Address;
377 if (!InitAuxFileHdr.SecNumOfData)
378 InitAuxFileHdr.SecNumOfData =
I + 1;
381 if (!InitAuxFileHdr.BssDataSize)
382 InitAuxFileHdr.BssDataSize = InitSections[
I].Size;
383 if (!InitAuxFileHdr.SecNumOfBSS)
384 InitAuxFileHdr.SecNumOfBSS =
I + 1;
387 if (!InitAuxFileHdr.SecNumOfTData)
388 InitAuxFileHdr.SecNumOfTData =
I + 1;
391 if (!InitAuxFileHdr.SecNumOfTBSS)
392 InitAuxFileHdr.SecNumOfTBSS =
I + 1;
395 if (!InitAuxFileHdr.SecNumOfLoader)
396 InitAuxFileHdr.SecNumOfLoader =
I + 1;
404bool XCOFFWriter::assignAddressesAndIndices() {
412 if (Obj.Header.AuxHeaderSize)
413 AuxFileHdrSize = Obj.Header.AuxHeaderSize;
414 else if (Obj.AuxHeader)
420 FileHdrSize + AuxFileHdrSize + InitSections.size() * SecHdrSize;
423 if (!initSectionHeaders(CurrentOffset))
427 if (!initFileHeader(CurrentOffset))
429 InitFileHdr.AuxHeaderSize = AuxFileHdrSize;
436 return initStringTable();
439void XCOFFWriter::writeFileHeader() {
440 W.write<
uint16_t>(Obj.Header.Magic ? Obj.Header.Magic : InitFileHdr.Magic);
441 W.write<
uint16_t>(Obj.Header.NumberOfSections ? Obj.Header.NumberOfSections
442 : InitFileHdr.NumberOfSections);
443 W.write<int32_t>(Obj.Header.TimeStamp);
445 W.write<
uint64_t>(InitFileHdr.SymbolTableOffset);
446 W.write<
uint16_t>(InitFileHdr.AuxHeaderSize);
448 W.write<int32_t>(Obj.Header.NumberOfSymTableEntries
449 ? Obj.Header.NumberOfSymTableEntries
450 : InitFileHdr.NumberOfSymTableEntries);
452 W.write<
uint32_t>(InitFileHdr.SymbolTableOffset);
453 W.write<int32_t>(Obj.Header.NumberOfSymTableEntries
454 ? Obj.Header.NumberOfSymTableEntries
455 : InitFileHdr.NumberOfSymTableEntries);
456 W.write<
uint16_t>(InitFileHdr.AuxHeaderSize);
461void XCOFFWriter::writeAuxFileHeader() {
462 W.write<
uint16_t>(InitAuxFileHdr.Magic.value_or(yaml::Hex16(1)));
463 W.write<
uint16_t>(InitAuxFileHdr.Version.value_or(yaml::Hex16(1)));
466 W.write<
uint64_t>(InitAuxFileHdr.TextStartAddr.value_or(yaml::Hex64(0)));
467 W.write<
uint64_t>(InitAuxFileHdr.DataStartAddr.value_or(yaml::Hex64(0)));
468 W.write<
uint64_t>(InitAuxFileHdr.TOCAnchorAddr.value_or(yaml::Hex64(0)));
470 W.write<
uint32_t>(InitAuxFileHdr.TextSize.value_or(yaml::Hex64(0)));
471 W.write<
uint32_t>(InitAuxFileHdr.InitDataSize.value_or(yaml::Hex64(0)));
472 W.write<
uint32_t>(InitAuxFileHdr.BssDataSize.value_or(yaml::Hex64(0)));
473 W.write<
uint32_t>(InitAuxFileHdr.EntryPointAddr.value_or(yaml::Hex64(0)));
474 W.write<
uint32_t>(InitAuxFileHdr.TextStartAddr.value_or(yaml::Hex64(0)));
475 W.write<
uint32_t>(InitAuxFileHdr.DataStartAddr.value_or(yaml::Hex64(0)));
479 W.write<
uint32_t>(InitAuxFileHdr.TOCAnchorAddr.value_or(yaml::Hex64(0)));
481 W.write<
uint16_t>(InitAuxFileHdr.SecNumOfEntryPoint.value_or(0));
482 W.write<
uint16_t>(InitAuxFileHdr.SecNumOfText.value_or(0));
483 W.write<
uint16_t>(InitAuxFileHdr.SecNumOfData.value_or(0));
484 W.write<
uint16_t>(InitAuxFileHdr.SecNumOfTOC.value_or(0));
485 W.write<
uint16_t>(InitAuxFileHdr.SecNumOfLoader.value_or(0));
486 W.write<
uint16_t>(InitAuxFileHdr.SecNumOfBSS.value_or(0));
487 W.write<
uint16_t>(InitAuxFileHdr.MaxAlignOfText.value_or(yaml::Hex16(0)));
488 W.write<
uint16_t>(InitAuxFileHdr.MaxAlignOfData.value_or(yaml::Hex16(0)));
489 W.write<
uint16_t>(InitAuxFileHdr.ModuleType.value_or(yaml::Hex16(0)));
490 W.write<uint8_t>(InitAuxFileHdr.CpuFlag.value_or(yaml::Hex8(0)));
493 W.write<uint8_t>(InitAuxFileHdr.TextPageSize.value_or(yaml::Hex8(0)));
494 W.write<uint8_t>(InitAuxFileHdr.DataPageSize.value_or(yaml::Hex8(0)));
495 W.write<uint8_t>(InitAuxFileHdr.StackPageSize.value_or(yaml::Hex8(0)));
497 InitAuxFileHdr.FlagAndTDataAlignment.value_or(yaml::Hex8(0x80)));
498 W.write<
uint64_t>(InitAuxFileHdr.TextSize.value_or(yaml::Hex64(0)));
499 W.write<
uint64_t>(InitAuxFileHdr.InitDataSize.value_or(yaml::Hex64(0)));
500 W.write<
uint64_t>(InitAuxFileHdr.BssDataSize.value_or(yaml::Hex64(0)));
501 W.write<
uint64_t>(InitAuxFileHdr.EntryPointAddr.value_or(yaml::Hex64(0)));
502 W.write<
uint64_t>(InitAuxFileHdr.MaxStackSize.value_or(yaml::Hex64(0)));
503 W.write<
uint64_t>(InitAuxFileHdr.MaxDataSize.value_or(yaml::Hex64(0)));
505 W.write<
uint32_t>(InitAuxFileHdr.MaxStackSize.value_or(yaml::Hex64(0)));
506 W.write<
uint32_t>(InitAuxFileHdr.MaxDataSize.value_or(yaml::Hex64(0)));
508 W.write<uint8_t>(InitAuxFileHdr.TextPageSize.value_or(yaml::Hex8(0)));
509 W.write<uint8_t>(InitAuxFileHdr.DataPageSize.value_or(yaml::Hex8(0)));
510 W.write<uint8_t>(InitAuxFileHdr.StackPageSize.value_or(yaml::Hex8(0)));
512 InitAuxFileHdr.FlagAndTDataAlignment.value_or(yaml::Hex8(0)));
514 W.write<
uint16_t>(InitAuxFileHdr.SecNumOfTData.value_or(0));
515 W.write<
uint16_t>(InitAuxFileHdr.SecNumOfTBSS.value_or(0));
527void XCOFFWriter::writeSectionHeaders() {
528 for (
uint16_t I = 0, E = Obj.Sections.size();
I < E; ++
I) {
541 W.write<int32_t>(DerivedSec.
Flags);
553 W.write<int32_t>(DerivedSec.
Flags);
558bool XCOFFWriter::writeSectionData() {
559 for (
uint16_t I = 0, E = Obj.Sections.size();
I < E; ++
I) {
563 int64_t PaddingSize = (
uint64_t)InitSections[
I].FileOffsetToData -
564 (
W.OS.tell() - StartOffset);
565 if (PaddingSize < 0) {
566 ErrHandler(
"redundant data was written before section data");
569 W.OS.write_zeros(PaddingSize);
576bool XCOFFWriter::writeRelocations() {
577 for (
uint16_t I = 0, E = Obj.Sections.size();
I < E; ++
I) {
580 int64_t PaddingSize =
582 if (PaddingSize < 0) {
583 ErrHandler(
"redundant data was written before relocations");
586 W.OS.write_zeros(PaddingSize);
593 W.write<uint8_t>(YamlRel.
Info);
594 W.write<uint8_t>(YamlRel.
Type);
602 uint8_t SymAlignAndType = 0;
605 ErrHandler(
"cannot specify SymbolType or SymbolAlignment if "
606 "SymbolAlignmentAndType is specified");
614 ErrHandler(
"symbol type must be less than " +
621 const uint8_t ShiftedSymbolAlignmentMask =
626 ErrHandler(
"symbol alignment must be less than " +
627 Twine(1 + ShiftedSymbolAlignmentMask));
638 W.write<uint8_t>(SymAlignAndType);
647 W.write<uint8_t>(SymAlignAndType);
656 assert(Is64Bit &&
"can't write the exception auxiliary symbol for XCOFF32");
684 if (nameShouldBeInStringTable(FileName)) {
686 W.write<
uint32_t>(StrTblBuilder.getOffset(FileName));
688 writeName(FileName, W);
704 W.OS.write_zeros(13);
710 W.OS.write_zeros(12);
731 assert(!Is64Bit &&
"can't write the stat auxiliary symbol for XCOFF64");
735 W.OS.write_zeros(10);
739bool XCOFFWriter::writeAuxSymbol(
740 const std::unique_ptr<XCOFFYAML::AuxSymbolEnt> &AuxSym) {
741 if (
auto AS = dyn_cast<XCOFFYAML::CsectAuxEnt>(AuxSym.get()))
742 return writeAuxSymbol(*AS);
743 else if (
auto AS = dyn_cast<XCOFFYAML::FunctionAuxEnt>(AuxSym.get()))
744 return writeAuxSymbol(*AS);
745 else if (
auto AS = dyn_cast<XCOFFYAML::ExcpetionAuxEnt>(AuxSym.get()))
746 return writeAuxSymbol(*AS);
747 else if (
auto AS = dyn_cast<XCOFFYAML::FileAuxEnt>(AuxSym.get()))
748 return writeAuxSymbol(*AS);
749 else if (
auto AS = dyn_cast<XCOFFYAML::BlockAuxEnt>(AuxSym.get()))
750 return writeAuxSymbol(*AS);
751 else if (
auto AS = dyn_cast<XCOFFYAML::SectAuxEntForDWARF>(AuxSym.get()))
752 return writeAuxSymbol(*AS);
753 else if (
auto AS = dyn_cast<XCOFFYAML::SectAuxEntForStat>(AuxSym.get()))
754 return writeAuxSymbol(*AS);
759bool XCOFFWriter::writeSymbols() {
760 int64_t PaddingSize =
761 InitFileHdr.SymbolTableOffset - (
W.OS.tell() - StartOffset);
762 if (PaddingSize < 0) {
763 ErrHandler(
"redundant data was written before symbols");
766 W.OS.write_zeros(PaddingSize);
772 if (nameShouldBeInStringTable(YamlSym.
SymbolName)) {
783 if (!SectionIndexMap.count(*YamlSym.
SectionName)) {
784 ErrHandler(
"the SectionName " + *YamlSym.
SectionName +
785 " specified in the symbol does not exist");
790 ErrHandler(
"the SectionName " + *YamlSym.
SectionName +
792 ") refer to different sections");
795 W.write<int16_t>(SectionIndexMap[*YamlSym.
SectionName]);
803 W.write<uint8_t>(NumOfAuxSym);
805 if (!NumOfAuxSym && !YamlSym.
AuxEntries.size())
812 for (
const std::unique_ptr<XCOFFYAML::AuxSymbolEnt> &AuxSym :
814 if (!writeAuxSymbol(AuxSym))
826void XCOFFWriter::writeStringTable() {
827 if (Obj.StrTbl.RawContent) {
828 Obj.StrTbl.RawContent->writeAsBinary(
W.OS);
829 if (Obj.StrTbl.ContentSize) {
830 assert(*Obj.StrTbl.ContentSize >= Obj.StrTbl.RawContent->binary_size() &&
831 "Specified ContentSize is less than the RawContent size.");
832 W.OS.write_zeros(*Obj.StrTbl.ContentSize -
833 Obj.StrTbl.RawContent->binary_size());
838 size_t StrTblBuilderSize = StrTblBuilder.getSize();
841 if (!Obj.StrTbl.Length && !Obj.StrTbl.ContentSize) {
842 if (StrTblBuilderSize <= 4)
844 StrTblBuilder.write(
W.OS);
849 std::unique_ptr<WritableMemoryBuffer> Buf =
851 uint8_t *
Ptr =
reinterpret_cast<uint8_t *
>(Buf->getBufferStart());
852 StrTblBuilder.write(
Ptr);
857 : *Obj.StrTbl.ContentSize);
859 W.OS.write(Buf->getBufferStart(), Buf->getBufferSize());
861 if (Obj.StrTbl.ContentSize) {
862 assert(*Obj.StrTbl.ContentSize >= StrTblBuilderSize &&
863 "Specified ContentSize is less than the StringTableBuilder size.");
864 W.OS.write_zeros(*Obj.StrTbl.ContentSize - StrTblBuilderSize);
868bool XCOFFWriter::writeXCOFF() {
869 if (!assignAddressesAndIndices())
871 StartOffset =
W.OS.tell();
873 if (InitFileHdr.AuxHeaderSize)
874 writeAuxFileHeader();
875 if (!Obj.Sections.empty()) {
876 writeSectionHeaders();
877 if (!writeSectionData())
879 if (!writeRelocations())
882 if (!Obj.Symbols.empty() && !writeSymbols())
894 XCOFFWriter Writer(Doc, Out, EH);
895 return Writer.writeXCOFF();
This file defines the DenseMap class.
static Error initRelocations(RelocationSection *Relocs, T RelRange)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
StringRef - Represent a constant reference to a string, i.e.
constexpr size_t size() const
size - Get the string size.
constexpr const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Utility for building string tables with deduplicated suffixes.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static std::unique_ptr< WritableMemoryBuffer > getNewMemBuffer(size_t Size, const Twine &BufferName="")
Allocate a new zero-initialized MemoryBuffer of the specified size.
An efficient, type-erasing, non-owning reference to a callable.
static constexpr uint8_t SymbolTypeMask
static constexpr size_t SymbolAlignmentBitOffset
static constexpr uint8_t SymbolAlignmentMask
This class implements an extremely fast bulk output stream that can only output to a stream.
ArrayRef< uint8_t >::size_type binary_size() const
The number of bytes that are represented by this BinaryRef.
void writeAsBinary(raw_ostream &OS, uint64_t N=UINT64_MAX) const
Write the contents (regardless of whether it is binary or a hex string) as binary to the given raw_os...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char SymbolName[]
Key for Kernel::Metadata::mSymbolName.
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
@ SHR_SYMTAB
At exec time, create shared symbol table for program (main program only).
constexpr size_t RelocationSerializationSize32
constexpr size_t RelocationSerializationSize64
constexpr size_t FileHeaderSize64
constexpr size_t AuxFileHeaderSize64
constexpr size_t SectionHeaderSize64
@ AUX_SECT
Identifies a SECT auxiliary entry.
@ AUX_FILE
Identifies a file auxiliary entry.
@ AUX_EXCEPT
Identifies an exception auxiliary entry.
@ AUX_FCN
Identifies a function auxiliary entry.
@ AUX_SYM
Identifies a symbol auxiliary entry.
@ AUX_CSECT
Identifies a csect auxiliary entry.
constexpr size_t NameSize
constexpr size_t AuxFileHeaderSizeShort
constexpr size_t AuxFileHeaderSize32
@ XFT_FN
Specifies the source-file name.
constexpr size_t FileHeaderSize32
constexpr size_t SectionHeaderSize32
constexpr size_t SymbolTableEntrySize
constexpr size_t FileNamePadSize
static void writeStringTable(std::vector< uint8_t > &B, ArrayRef< const std::string_view > Strings)
void write32be(void *P, uint32_t V)
bool yaml2xcoff(XCOFFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH)
This is an optimization pass for GlobalISel generic memory operations.
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
std::optional< uint32_t > LineNum
std::optional< uint16_t > LineNumHi
std::optional< uint16_t > LineNumLo
std::optional< uint16_t > TypeChkSectNum
std::optional< uint32_t > ParameterHashIndex
std::optional< uint32_t > SectionOrLength
std::optional< uint32_t > SectionOrLengthHi
std::optional< uint8_t > SymbolAlignmentAndType
std::optional< uint32_t > SectionOrLengthLo
std::optional< uint8_t > SymbolAlignment
std::optional< uint16_t > StabSectNum
std::optional< XCOFF::StorageMappingClass > StorageMappingClass
std::optional< uint32_t > StabInfoIndex
std::optional< XCOFF::SymbolType > SymbolType
std::optional< int32_t > SymIdxOfNextBeyond
std::optional< uint32_t > SizeOfFunction
std::optional< uint64_t > OffsetToExceptionTbl
std::optional< XCOFF::CFileStringType > FileStringType
std::optional< StringRef > FileNameOrString
std::optional< int32_t > SymIdxOfNextBeyond
std::optional< uint32_t > OffsetToExceptionTbl
std::optional< uint64_t > PtrToLineNum
std::optional< uint32_t > SizeOfFunction
std::vector< Section > Sections
llvm::yaml::Hex64 SymbolIndex
llvm::yaml::Hex64 VirtualAddress
std::optional< uint32_t > NumberOfRelocEnt
std::optional< uint32_t > LengthOfSectionPortion
std::optional< uint16_t > NumberOfRelocEnt
std::optional< uint16_t > NumberOfLineNum
std::optional< uint32_t > SectionLength
llvm::yaml::Hex64 FileOffsetToRelocations
llvm::yaml::Hex64 Address
llvm::yaml::Hex64 FileOffsetToData
yaml::BinaryRef SectionData
std::vector< Relocation > Relocations
llvm::yaml::Hex16 NumberOfLineNumbers
llvm::yaml::Hex16 NumberOfRelocations
llvm::yaml::Hex64 FileOffsetToLineNumbers
std::vector< std::unique_ptr< AuxSymbolEnt > > AuxEntries
std::optional< uint16_t > SectionIndex
std::optional< uint8_t > NumberOfAuxEntries
XCOFF::StorageClass StorageClass
std::optional< StringRef > SectionName
Adapter to write values to a stream in a particular byte order.
Common declarations for yaml2obj.