[PATCH] D106420: [yaml2obj] Do not write the string table if there is no string entry.

Esme Yi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 25 19:38:44 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2eb7e5f0eda7: [yaml2obj] Do not write the string table if there is no string entry. (authored by Esme).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106420/new/

https://reviews.llvm.org/D106420

Files:
  llvm/lib/ObjectYAML/XCOFFEmitter.cpp


Index: llvm/lib/ObjectYAML/XCOFFEmitter.cpp
===================================================================
--- llvm/lib/ObjectYAML/XCOFFEmitter.cpp
+++ llvm/lib/ObjectYAML/XCOFFEmitter.cpp
@@ -317,12 +317,11 @@
     if (!writeRelocations())
       return false;
   }
-  if (!Obj.Symbols.empty()) {
-    if (!writeSymbols())
-      return false;
-    // Write the string table.
+  if (!Obj.Symbols.empty() && !writeSymbols())
+    return false;
+  // Write the string table.
+  if (Strings.getSize() > 4)
     Strings.write(W.OS);
-  }
   return true;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106420.361570.patch
Type: text/x-patch
Size: 561 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210726/0bc9fb39/attachment.bin>


More information about the llvm-commits mailing list