summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/ArchiveWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object/ArchiveWriter.cpp')
-rw-r--r--llvm/lib/Object/ArchiveWriter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Object/ArchiveWriter.cpp b/llvm/lib/Object/ArchiveWriter.cpp
index 015c24836fa..ce83cb1245f 100644
--- a/llvm/lib/Object/ArchiveWriter.cpp
+++ b/llvm/lib/Object/ArchiveWriter.cpp
@@ -351,7 +351,8 @@ writeSymbolTable(raw_fd_ostream &Out, object::Archive::Kind Kind,
// ld64 requires the next member header to start at an offset that is
// 4 bytes aligned.
- unsigned Pad = OffsetToAlignment(Out.tell(), 4);
+ unsigned Alignment = isBSDLike(Kind) ? 4 : 2;
+ unsigned Pad = OffsetToAlignment(Out.tell(), Alignment);
while (Pad--)
Out.write(uint8_t(0));
OpenPOWER on IntegriCloud