Lines Matching refs:COFF

59 using name = SmallString<COFF::NameSize>;
65 COFF::Auxiliary Aux;
72 COFF::symbol Data = {};
98 COFF::relocation Data;
103 static size_t size() { return COFF::RelocationSize; } in size()
110 COFF::section Header = {};
137 COFF::header Header = {};
184 void WriteFileHeader(const COFF::header &Header);
188 void WriteRelocation(const COFF::relocation &R);
238 UseOffsetLabels = COFF::isAnyArm64(Header.Machine); in WinCOFFWriter()
261 return COFF::IMAGE_SCN_ALIGN_1BYTES; in getAlignment()
263 return COFF::IMAGE_SCN_ALIGN_2BYTES; in getAlignment()
265 return COFF::IMAGE_SCN_ALIGN_4BYTES; in getAlignment()
267 return COFF::IMAGE_SCN_ALIGN_8BYTES; in getAlignment()
269 return COFF::IMAGE_SCN_ALIGN_16BYTES; in getAlignment()
271 return COFF::IMAGE_SCN_ALIGN_32BYTES; in getAlignment()
273 return COFF::IMAGE_SCN_ALIGN_64BYTES; in getAlignment()
275 return COFF::IMAGE_SCN_ALIGN_128BYTES; in getAlignment()
277 return COFF::IMAGE_SCN_ALIGN_256BYTES; in getAlignment()
279 return COFF::IMAGE_SCN_ALIGN_512BYTES; in getAlignment()
281 return COFF::IMAGE_SCN_ALIGN_1024BYTES; in getAlignment()
283 return COFF::IMAGE_SCN_ALIGN_2048BYTES; in getAlignment()
285 return COFF::IMAGE_SCN_ALIGN_4096BYTES; in getAlignment()
287 return COFF::IMAGE_SCN_ALIGN_8192BYTES; in getAlignment()
301 Symbol->Data.StorageClass = COFF::IMAGE_SYM_CLASS_STATIC; in defineSection()
304 if (MCSec.getSelection() != COFF::IMAGE_COMDAT_SELECT_ASSOCIATIVE) { in defineSection()
335 Label->Data.StorageClass = COFF::IMAGE_SYM_CLASS_LABEL; in defineSection()
387 Sym->Data.StorageClass = COFF::IMAGE_SYM_CLASS_WEAK_EXTERNAL; in defineSymbol()
395 WeakDefault->Data.SectionNumber = COFF::IMAGE_SYM_ABSOLUTE; in defineSymbol()
413 Sym->Data.SectionNumber = COFF::IMAGE_SYM_ABSOLUTE; in defineSymbol()
427 if (Local->Data.StorageClass == COFF::IMAGE_SYM_CLASS_NULL) { in defineSymbol()
431 Local->Data.StorageClass = IsExternal ? COFF::IMAGE_SYM_CLASS_EXTERNAL in defineSymbol()
432 : COFF::IMAGE_SYM_CLASS_STATIC; in defineSymbol()
440 if (S.Name.size() <= COFF::NameSize) { in SetSectionName()
446 if (!COFF::encodeSectionName(S.Header.Name, StringTableEntry)) in SetSectionName()
451 if (S.Name.size() > COFF::NameSize) in SetSymbolName()
458 return (S->Header.Characteristics & COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA) == in IsPhysicalSection()
465 void WinCOFFWriter::WriteFileHeader(const COFF::header &Header) { in WriteFileHeader()
467 W.write<uint16_t>(COFF::IMAGE_FILE_MACHINE_UNKNOWN); in WriteFileHeader()
469 W.write<uint16_t>(COFF::BigObjHeader::MinBigObjectVersion); in WriteFileHeader()
472 W.OS.write(COFF::BigObjMagic, sizeof(COFF::BigObjMagic)); in WriteFileHeader()
492 W.OS.write(S.Data.Name, COFF::NameSize); in WriteSymbol()
513 W.OS.write_zeros(COFF::Symbol32Size - COFF::Symbol16Size); in WriteAuxiliarySymbols()
517 UseBigObj ? COFF::Symbol32Size : COFF::Symbol16Size); in WriteAuxiliarySymbols()
530 W.OS.write_zeros(COFF::Symbol32Size - COFF::Symbol16Size); in WriteAuxiliarySymbols()
552 COFF::section &S = Section->Header; in writeSectionHeaders()
554 S.Characteristics |= COFF::IMAGE_SCN_LNK_NRELOC_OVFL; in writeSectionHeaders()
555 W.OS.write(S.Name, COFF::NameSize); in writeSectionHeaders()
568 void WinCOFFWriter::WriteRelocation(const COFF::relocation &R) { in WriteRelocation()
626 COFF::relocation R; in writeSection()
642 unsigned SymbolSize = UseBigObj ? COFF::Symbol32Size : COFF::Symbol16Size; in createFileSymbols()
646 File->Data.SectionNumber = COFF::IMAGE_SYM_DEBUG; in createFileSymbols()
647 File->Data.StorageClass = COFF::IMAGE_SYM_CLASS_FILE; in createFileSymbols()
687 if (Sym->Data.StorageClass != COFF::IMAGE_SYM_CLASS_EXTERNAL) in setWeakDefaultNames()
690 if (!Sym->Section && Sym->Data.SectionNumber != COFF::IMAGE_SYM_ABSOLUTE) in setWeakDefaultNames()
693 Sym->Section->Header.Characteristics & COFF::IMAGE_SCN_LNK_COMDAT) in setWeakDefaultNames()
712 COFF::IMAGE_COMDAT_SELECT_ASSOCIATIVE; in isAssociative()
739 Offset += UseBigObj ? COFF::Header32Size : COFF::Header16Size; in assignFileOffsets()
740 Offset += COFF::SectionSize * Header.NumberOfSections; in assignFileOffsets()
769 Offset += COFF::RelocationSize; in assignFileOffsets()
772 Offset += COFF::RelocationSize * Sec->Relocations.size(); in assignFileOffsets()
820 cast<MCSymbolCOFF>(Symbol).getClass() == COFF::IMAGE_SYM_CLASS_STATIC) in executePostLayoutBinding()
918 if ((Header.Machine == COFF::IMAGE_FILE_MACHINE_AMD64 && in recordRelocation()
919 Reloc.Data.Type == COFF::IMAGE_REL_AMD64_REL32) || in recordRelocation()
920 (Header.Machine == COFF::IMAGE_FILE_MACHINE_I386 && in recordRelocation()
921 Reloc.Data.Type == COFF::IMAGE_REL_I386_REL32) || in recordRelocation()
922 (Header.Machine == COFF::IMAGE_FILE_MACHINE_ARMNT && in recordRelocation()
923 Reloc.Data.Type == COFF::IMAGE_REL_ARM_REL32) || in recordRelocation()
924 (COFF::isAnyArm64(Header.Machine) && in recordRelocation()
925 Reloc.Data.Type == COFF::IMAGE_REL_ARM64_REL32)) in recordRelocation()
928 if (Header.Machine == COFF::IMAGE_FILE_MACHINE_ARMNT) { in recordRelocation()
930 case COFF::IMAGE_REL_ARM_ABSOLUTE: in recordRelocation()
931 case COFF::IMAGE_REL_ARM_ADDR32: in recordRelocation()
932 case COFF::IMAGE_REL_ARM_ADDR32NB: in recordRelocation()
933 case COFF::IMAGE_REL_ARM_TOKEN: in recordRelocation()
934 case COFF::IMAGE_REL_ARM_SECTION: in recordRelocation()
935 case COFF::IMAGE_REL_ARM_SECREL: in recordRelocation()
937 case COFF::IMAGE_REL_ARM_BRANCH11: in recordRelocation()
938 case COFF::IMAGE_REL_ARM_BLX11: in recordRelocation()
942 case COFF::IMAGE_REL_ARM_BRANCH24: in recordRelocation()
943 case COFF::IMAGE_REL_ARM_BLX24: in recordRelocation()
944 case COFF::IMAGE_REL_ARM_MOV32A: in recordRelocation()
952 case COFF::IMAGE_REL_ARM_MOV32T: in recordRelocation()
954 case COFF::IMAGE_REL_ARM_BRANCH20T: in recordRelocation()
955 case COFF::IMAGE_REL_ARM_BRANCH24T: in recordRelocation()
956 case COFF::IMAGE_REL_ARM_BLX23T: in recordRelocation()
988 UseBigObj = Sections.size() > COFF::MaxNumberOfSections16; in writeObject()
1009 if (S->Name.size() > COFF::NameSize) in writeObject()
1012 if (S->Name.size() > COFF::NameSize) in writeObject()
1036 COFF::IMAGE_COMDAT_SELECT_ASSOCIATIVE) in writeObject()
1067 ".llvm_addrsig", COFF::IMAGE_SCN_LNK_REMOVE); in writeObject()
1089 ".llvm.call-graph-profile", COFF::IMAGE_SCN_LNK_REMOVE); in writeObject()
1171 if ((Type >> COFF::SCT_COMPLEX_TYPE_SHIFT) == COFF::IMAGE_SYM_DTYPE_FUNCTION) in isSymbolRefDifferenceFullyResolvedImpl()