llvm-ar: Don't add an unnecessary alignment in gnu mode.

This is mostly for getting stricter testing in preparation for future
changes.

llvm-svn: 314000
diff --git a/llvm/lib/Object/ArchiveWriter.cpp b/llvm/lib/Object/ArchiveWriter.cpp
index 015c248..ce83cb1 100644
--- a/llvm/lib/Object/ArchiveWriter.cpp
+++ b/llvm/lib/Object/ArchiveWriter.cpp
@@ -351,7 +351,8 @@
 
   // 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));