[PATCH] D67125: [PowerPC][AIX] Adds support for writing the data section in object files

Xing Xue via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 9 14:14:27 PDT 2019


xingxue marked 8 inline comments as done.
xingxue added inline comments.


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:480
+    for (const auto Sym : CSection.Syms) {
+      writeSymbolTableEntryForSymbol(Sym, CSection, Data,
+                                     Layout.getSymbolOffset(*(Sym.MCSym)));
----------------
DiggerLin wrote:
> ditto
Will follow up when changes in D66969 is updated.


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:539
+           "Improperly aligned address for section.");
+    uint32_t StartAddress = Address;
+    for (auto &Csect : DataCsects) {
----------------
DiggerLin wrote:
> jasonliu wrote:
> > We assigned Index and Size to Data section. But we haven't assign Address to it. By default, the address would be 0. It's correct if you do not have a Text section. But once you have text section, the Data's address as 0 would wrong. 
> The Address value will been changed in the  if (!ProgramCodeCsects.empty()) { }
> if there is Text Section.
Good catch, fixed.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D67125





More information about the llvm-commits mailing list