Lines Matching refs:COFF
10 // This file contains an implementation of a Win32 COFF object file writer.
32 #include "llvm/Support/COFF.h"
43 typedef llvm::SmallString<COFF::NameSize> name;
55 COFF::Auxiliary Aux;
63 COFF::symbol Data;
83 // This class contains staging data for a COFF relocation entry.
85 COFF::relocation Data;
89 static size_t size() { return COFF::RelocationSize; }
96 COFF::section Header;
108 // This class holds the COFF string table.
134 COFF::header Header;
166 void WriteFileHeader(const COFF::header &Header);
169 void WriteSectionHeader(const COFF::section &S);
170 void WriteRelocation(const COFF::relocation &R);
219 return COFF::SymbolSize + (Data.NumberOfAuxSymbols * COFF::SymbolSize);
269 return COFF::SectionSize;
365 /// and creates the associated COFF section staging object.
368 && "Got non COFF section in the COFF backend!");
378 coff_symbol->Data.StorageClass = COFF::IMAGE_SYM_CLASS_STATIC;
390 case 1: Characteristics |= COFF::IMAGE_SCN_ALIGN_1BYTES; break;
391 case 2: Characteristics |= COFF::IMAGE_SCN_ALIGN_2BYTES; break;
392 case 4: Characteristics |= COFF::IMAGE_SCN_ALIGN_4BYTES; break;
393 case 8: Characteristics |= COFF::IMAGE_SCN_ALIGN_8BYTES; break;
394 case 16: Characteristics |= COFF::IMAGE_SCN_ALIGN_16BYTES; break;
395 case 32: Characteristics |= COFF::IMAGE_SCN_ALIGN_32BYTES; break;
396 case 64: Characteristics |= COFF::IMAGE_SCN_ALIGN_64BYTES; break;
397 case 128: Characteristics |= COFF::IMAGE_SCN_ALIGN_128BYTES; break;
398 case 256: Characteristics |= COFF::IMAGE_SCN_ALIGN_256BYTES; break;
399 case 512: Characteristics |= COFF::IMAGE_SCN_ALIGN_512BYTES; break;
400 case 1024: Characteristics |= COFF::IMAGE_SCN_ALIGN_1024BYTES; break;
401 case 2048: Characteristics |= COFF::IMAGE_SCN_ALIGN_2048BYTES; break;
402 case 4096: Characteristics |= COFF::IMAGE_SCN_ALIGN_4096BYTES; break;
403 case 8192: Characteristics |= COFF::IMAGE_SCN_ALIGN_8192BYTES; break;
408 // Bind internal COFF section to MC section.
414 /// and creates the associated COFF symbol staging object.
422 if (SymbolData.getFlags() & COFF::SF_WeakExternal) {
423 coff_symbol->Data.StorageClass = COFF::IMAGE_SYM_CLASS_WEAK_EXTERNAL;
426 coff_symbol->Data.StorageClass = COFF::IMAGE_SYM_CLASS_WEAK_EXTERNAL;
441 WeakDefault->Data.SectionNumber = COFF::IMAGE_SYM_ABSOLUTE;
442 WeakDefault->Data.StorageClass = COFF::IMAGE_SYM_CLASS_EXTERNAL;
454 COFF::IMAGE_WEAK_EXTERN_SEARCH_LIBRARY;
462 external ? COFF::IMAGE_SYM_CLASS_EXTERNAL : COFF::IMAGE_SYM_CLASS_STATIC;
469 // Bind internal COFF symbol to MC symbol.
477 if (S.Name.size() > COFF::NameSize) {
487 report_fatal_error("COFF string table is greater than 999999 bytes.");
499 if (S.Name.size() > COFF::NameSize) {
526 & COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA) == 0;
532 void WinCOFFObjectWriter::WriteFileHeader(const COFF::header &Header) {
543 WriteBytes(StringRef(S->Data.Name, COFF::NameSize));
593 void WinCOFFObjectWriter::WriteSectionHeader(const COFF::section &S) {
594 WriteBytes(StringRef(S.Name, COFF::NameSize));
607 void WinCOFFObjectWriter::WriteRelocation(const COFF::relocation &R) {
703 if (Reloc.Data.Type == COFF::IMAGE_REL_AMD64_REL32 ||
704 Reloc.Data.Type == COFF::IMAGE_REL_I386_REL32)
762 // Assign file offsets to COFF object file structures.
766 offset += COFF::HeaderSize;
767 offset += COFF::SectionSize * Header.NumberOfSections;
799 offset += COFF::RelocationSize;
802 offset += COFF::RelocationSize * Sec->Relocations.size();
838 (*i)->Header.Characteristics |= COFF::IMAGE_SCN_LNK_NRELOC_OVFL;
864 COFF::relocation r;