[llvm] r351934 - [llvm-objcopy] [COFF] Clear the unwritten tail of coff_section::Header::Name
Martin Storsjo via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 23 01:12:53 PST 2019
Author: mstorsjo
Date: Wed Jan 23 01:12:53 2019
New Revision: 351934
URL: http://llvm.org/viewvc/llvm-project?rev=351934&view=rev
Log:
[llvm-objcopy] [COFF] Clear the unwritten tail of coff_section::Header::Name
This should fix the add-gnu-debuglink test on all buildbots.
Modified:
llvm/trunk/tools/llvm-objcopy/COFF/Writer.cpp
Modified: llvm/trunk/tools/llvm-objcopy/COFF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objcopy/COFF/Writer.cpp?rev=351934&r1=351933&r2=351934&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objcopy/COFF/Writer.cpp (original)
+++ llvm/trunk/tools/llvm-objcopy/COFF/Writer.cpp Wed Jan 23 01:12:53 2019
@@ -121,6 +121,7 @@ size_t COFFWriter::finalizeStringTable()
for (auto &S : Obj.getMutableSections()) {
if (S.Name.size() > COFF::NameSize) {
+ memset(S.Header.Name, 0, sizeof(S.Header.Name));
snprintf(S.Header.Name, sizeof(S.Header.Name), "/%d",
(int)StrTabBuilder.getOffset(S.Name));
} else {
More information about the llvm-commits
mailing list