llvm-objcopy-10.patch 1.0 KB

1234567891011121314151617181920212223242526272829
  1. From 1284ee3c47bab17ec081b5169633aea4f8abfd30 Mon Sep 17 00:00:00 2001
  2. From: Martin Storsjo <martin@martin.st>
  3. Date: Wed, 23 Jan 2019 09:12:53 +0000
  4. Subject: [PATCH] [llvm-objcopy] [COFF] Clear the unwritten tail of
  5. coff_section::Header::Name
  6. This should fix the add-gnu-debuglink test on all buildbots.
  7. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351934 91177308-0d34-0410-b5e6-96231b3b80d8
  8. ---
  9. tools/llvm-objcopy/COFF/Writer.cpp | 1 +
  10. 1 file changed, 1 insertion(+)
  11. diff --git a/llvm/tools/llvm-objcopy/COFF/Writer.cpp b/llvm/tools/llvm-objcopy/COFF/Writer.cpp
  12. index 05e46291c39..db897e2ff33 100644
  13. --- a/llvm/tools/llvm-objcopy/COFF/Writer.cpp
  14. +++ b/llvm/tools/llvm-objcopy/COFF/Writer.cpp
  15. @@ -121,6 +121,7 @@ size_t COFFWriter::finalizeStringTable() {
  16. for (auto &S : Obj.getMutableSections()) {
  17. if (S.Name.size() > COFF::NameSize) {
  18. + memset(S.Header.Name, 0, sizeof(S.Header.Name));
  19. snprintf(S.Header.Name, sizeof(S.Header.Name), "/%d",
  20. (int)StrTabBuilder.getOffset(S.Name));
  21. } else {
  22. --
  23. 2.17.1