From d3faeaf8a292a566603fcbab803fe16f802bcf12 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 9 Feb 2017 15:47:58 +0000 Subject: Object: add a comment explaining a divergence Add a note about the reason for the divergence from the specification for ld64. Addresses post-commit review comments from Davide. NFC. llvm-svn: 294594 --- llvm/lib/Object/ArchiveWriter.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/Object/ArchiveWriter.cpp') diff --git a/llvm/lib/Object/ArchiveWriter.cpp b/llvm/lib/Object/ArchiveWriter.cpp index ed4ef6a8df4..45047240c3b 100644 --- a/llvm/lib/Object/ArchiveWriter.cpp +++ b/llvm/lib/Object/ArchiveWriter.cpp @@ -316,6 +316,8 @@ writeSymbolTable(raw_fd_ostream &Out, object::Archive::Kind Kind, if (HeaderStartOffset == 0) return 0; + // ld64 prefers the cctools type archive which pads its string table to a + // boundary of sizeof(int32_t). if (Kind == object::Archive::K_BSD) for (unsigned P = OffsetToAlignment(NameOS.tell(), sizeof(int32_t)); P--;) NameOS << '\0'; -- cgit v1.2.3