aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/llvm12/tools/llvm-objcopy/MachO/MachOLayoutBuilder.cpp
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:39 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:39 +0300
commite9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch)
tree64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/libs/llvm12/tools/llvm-objcopy/MachO/MachOLayoutBuilder.cpp
parent2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff)
downloadydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 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.cpp24
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 849a1e4ea4..8e2bf36238 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;