[PATCH] D65159: [PowerPC][XCOFF] Adds support for writing the .bss section for object files.

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 08:37:39 PDT 2019


sfertile marked an inline comment as done.
sfertile added inline comments.


================
Comment at: llvm/include/llvm/MC/StringTableBuilder.h:25
 public:
-  enum Kind { ELF, WinCOFF, MachO, RAW, DWARF };
+  enum Kind { ELF, WinCOFF, MachO, RAW, DWARF, XCOFF};
 
----------------
xingxue wrote:
> Nit: add a space after `XCOFF`.
Thanks. I've updated this locally but don't plan to update the diff unless there are any other changes requested before I commit.


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:118
+        Index(-1), IsVirtual(IsVirtual) {
+    strncpy(Name, N, XCOFF::NameSize);
+  }
----------------
DiggerLin wrote:
> Do we need to add assert here for the strlen(N) <= XCOFF::NameSize ?
I had considered this, since passing a name longer then that would definitely be an error. The reason I didn't add it was because I figured whenever we add support for a new section, we will have accompanying lit testing, which would (hopefully) catch that we added the section with the wrong name.  

* I have an implicit assumption here that we will be using the 'conventional' name for each of the section types we add support for.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65159





More information about the llvm-commits mailing list