diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/libs/llvm12/lib/MC/XCOFFObjectWriter.cpp | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/llvm12/lib/MC/XCOFFObjectWriter.cpp')
-rw-r--r-- | contrib/libs/llvm12/lib/MC/XCOFFObjectWriter.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/contrib/libs/llvm12/lib/MC/XCOFFObjectWriter.cpp b/contrib/libs/llvm12/lib/MC/XCOFFObjectWriter.cpp index 031eceaadf..bec0d1d8da 100644 --- a/contrib/libs/llvm12/lib/MC/XCOFFObjectWriter.cpp +++ b/contrib/libs/llvm12/lib/MC/XCOFFObjectWriter.cpp @@ -138,13 +138,13 @@ struct Section { Group->clear(); } - Section(StringRef N, XCOFF::SectionTypeFlags Flags, bool IsVirtual, + Section(StringRef N, XCOFF::SectionTypeFlags Flags, bool IsVirtual, CsectGroups Groups) - : Name(), Address(0), Size(0), FileOffsetToData(0), - FileOffsetToRelocations(0), RelocationCount(0), Flags(Flags), - Index(UninitializedIndex), IsVirtual(IsVirtual), Groups(Groups) { - assert(N.size() <= XCOFF::NameSize && "section name too long"); - memcpy(Name, N.data(), N.size()); + : Name(), Address(0), Size(0), FileOffsetToData(0), + FileOffsetToRelocations(0), RelocationCount(0), Flags(Flags), + Index(UninitializedIndex), IsVirtual(IsVirtual), Groups(Groups) { + assert(N.size() <= XCOFF::NameSize && "section name too long"); + memcpy(Name, N.data(), N.size()); } }; @@ -305,7 +305,7 @@ CsectGroup &XCOFFObjectWriter::getCsectGroup(const MCSectionXCOFF *MCSec) { "in this CsectGroup."); return TOCCsects; case XCOFF::XMC_TC: - case XCOFF::XMC_TE: + case XCOFF::XMC_TE: assert(XCOFF::XTY_SD == MCSec->getCSectType() && "Only an initialized csect can contain TC entry."); assert(!TOCCsects.empty() && @@ -429,19 +429,19 @@ void XCOFFObjectWriter::recordRelocation(MCAssembler &Asm, // The FixedValue should be symbol's virtual address in this object file // plus any constant value that we might get. FixedValue = getVirtualAddress(SymA, SymASec) + Target.getConstant(); - else if (Type == XCOFF::RelocationType::R_TOC || - Type == XCOFF::RelocationType::R_TOCL) { - // The FixedValue should be the TOC entry offset from the TOC-base plus any - // constant offset value. - const int64_t TOCEntryOffset = SectionMap[SymASec]->Address - - TOCCsects.front().Address + - Target.getConstant(); - if (Type == XCOFF::RelocationType::R_TOC && !isInt<16>(TOCEntryOffset)) - report_fatal_error("TOCEntryOffset overflows in small code model mode"); - - FixedValue = TOCEntryOffset; - } - + else if (Type == XCOFF::RelocationType::R_TOC || + Type == XCOFF::RelocationType::R_TOCL) { + // The FixedValue should be the TOC entry offset from the TOC-base plus any + // constant offset value. + const int64_t TOCEntryOffset = SectionMap[SymASec]->Address - + TOCCsects.front().Address + + Target.getConstant(); + if (Type == XCOFF::RelocationType::R_TOC && !isInt<16>(TOCEntryOffset)) + report_fatal_error("TOCEntryOffset overflows in small code model mode"); + + FixedValue = TOCEntryOffset; + } + assert( (TargetObjectWriter->is64Bit() || Fixup.getOffset() <= UINT32_MAX - Layout.getFragmentOffset(Fragment)) && |