[PATCH] D65040: [llvm-objcopy] Add support for --add-section for COFF

Sergey Dmitriev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 24 09:43:59 PDT 2019


sdmitriev marked 2 inline comments as done.
sdmitriev added inline comments.


================
Comment at: llvm/tools/llvm-objcopy/COFF/COFFObjcopy.cpp:189
+
+    if (SecName.empty() || FileName.empty())
+      return createStringError(llvm::errc::invalid_argument,
----------------
jhenderson wrote:
> Does COFF allow for empty section names? If it does, you need to distinguish the case where there is no '=' at all in the parameter from it producing an empty string, i.e. "--add-sections==foo.txt" might be allowable if COFF allows empty section names (but not "--add-section=foo.txt".
I do not see anything in the COFF spec that would disallow sections with empty names. But, as it turned out, such sections were not handled correctly by the COFF/Writer, so I had to make a small change there to fix the problem. I have also added an additional test to the lit test that tests adding a section with empty name.


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

https://reviews.llvm.org/D65040





More information about the llvm-commits mailing list