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/tools/llvm-objcopy/MachO/MachOLayoutBuilder.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/tools/llvm-objcopy/MachO/MachOLayoutBuilder.cpp')
-rw-r--r-- | contrib/libs/llvm12/tools/llvm-objcopy/MachO/MachOLayoutBuilder.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/contrib/libs/llvm12/tools/llvm-objcopy/MachO/MachOLayoutBuilder.cpp b/contrib/libs/llvm12/tools/llvm-objcopy/MachO/MachOLayoutBuilder.cpp index 8e2bf36238..849a1e4ea4 100644 --- a/contrib/libs/llvm12/tools/llvm-objcopy/MachO/MachOLayoutBuilder.cpp +++ b/contrib/libs/llvm12/tools/llvm-objcopy/MachO/MachOLayoutBuilder.cpp @@ -15,14 +15,14 @@ namespace llvm { namespace objcopy { namespace macho { -StringTableBuilder::Kind -MachOLayoutBuilder::getStringTableBuilderKind(const Object &O, bool Is64Bit) { - if (O.Header.FileType == MachO::HeaderFileType::MH_OBJECT) - return Is64Bit ? StringTableBuilder::MachO64 : StringTableBuilder::MachO; - return Is64Bit ? StringTableBuilder::MachO64Linked - : StringTableBuilder::MachOLinked; -} - +StringTableBuilder::Kind +MachOLayoutBuilder::getStringTableBuilderKind(const Object &O, bool Is64Bit) { + if (O.Header.FileType == MachO::HeaderFileType::MH_OBJECT) + return Is64Bit ? StringTableBuilder::MachO64 : StringTableBuilder::MachO; + return Is64Bit ? StringTableBuilder::MachO64Linked + : StringTableBuilder::MachOLinked; +} + uint32_t MachOLayoutBuilder::computeSizeOfCmds() const { uint32_t Size = 0; for (const LoadCommand &LC : O.LoadCommands) { @@ -156,7 +156,7 @@ uint64_t MachOLayoutBuilder::layoutSegments() { "Section's address cannot be smaller than Segment's one"); uint32_t SectOffset = Sec->Addr - SegmentVmAddr; if (IsObjectFile) { - if (!Sec->hasValidOffset()) { + if (!Sec->hasValidOffset()) { Sec->Offset = 0; } else { uint64_t PaddingSize = @@ -166,7 +166,7 @@ uint64_t MachOLayoutBuilder::layoutSegments() { SegFileSize += PaddingSize + Sec->Size; } } else { - if (!Sec->hasValidOffset()) { + if (!Sec->hasValidOffset()) { Sec->Offset = 0; } else { Sec->Offset = SegOffset + SectOffset; @@ -260,8 +260,8 @@ Error MachOLayoutBuilder::layoutTail(uint64_t Offset) { sizeof(uint32_t) * O.IndirectSymTable.Symbols.size(); uint64_t StartOfCodeSignature = StartOfSymbolStrings + StrTableBuilder.getSize(); - if (O.CodeSignatureCommandIndex) - StartOfCodeSignature = alignTo(StartOfCodeSignature, 16); + if (O.CodeSignatureCommandIndex) + StartOfCodeSignature = alignTo(StartOfCodeSignature, 16); uint64_t LinkEditSize = (StartOfCodeSignature + O.CodeSignature.Data.size()) - StartOfLinkEdit; |