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

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 21:09:04 PDT 2019


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:456
+uint8_t getEncodedType(const MCSectionXCOFF *Sec) {
+  unsigned Align = Sec->getAlignment();
+  assert(isPowerOf2_32(Align) && "Alignment must be a power of 2.");
----------------
sfertile wrote:
> hubert.reinterpretcast wrote:
> > I'm not sure where we should address this, but it seems both XLC and GCC generate at least 4-byte alignment by default.
> I believe @xingxue  looked into this and may have an answer to where/how we intend to address this.
@xingxue, can you chime in on this?


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:257
+    // entry, add it to the string table.
+    const Symbol& WrapperSym = WrapperMap[ContainingCSect]->Syms.back();
+    if (WrapperSym.nameInStringTable()) {
----------------
For consistency, space before the `&` and not after.


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:430
+
+    // Pad out Address to default alignment. This is to match how the system
+    // assembler handles the .bss section. Its size is always a multiple of 4.
----------------
Add "the" before "default".


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