[PATCH] D136787: [XCOFF] Decode the relocation entries of loader section of xcoff for llvm-readobj

Digger Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 9 07:43:10 PST 2022


DiggerLin marked 5 inline comments as done.
DiggerLin added a comment.

In D136787#3977618 <https://reviews.llvm.org/D136787#3977618>, @Esme wrote:

> Btw. Do you have any plans to implement an option like "--loader-section" to embrace all this loader section related information?





================
Comment at: llvm/include/llvm/Object/XCOFFObjectFile.h:243
+  support::big32_t SymbolIndex;
+};
+
----------------
Esme wrote:
> I noticed an extra field of `l_value` for Loader Section Relocation Table Entry Structure specified by the doc, is it also a doc error?
yes, this is doc error. I have mention it in  comment which I response to James.


================
Comment at: llvm/tools/llvm-readobj/XCOFFDumper.cpp:315-317
+    W.startLine() << center_justify("Vaddr", Obj.is64Bit() ? 18 : 10)
+                  << center_justify("Type", 8) << center_justify(" RelSect", 8)
+                  << center_justify("SymbolName(Index)", 20) << "\n";
----------------
Esme wrote:
> Prefer to move the code (lines 315~317) into the `else` code block below (line 353).
if move the lines into   "else code block below (line 353)." , it is in the loop , it will cause the "Vaddr Type SecNum  SymbolName(Index)" be printed multi time.  (this is only head line.)


================
Comment at: llvm/tools/llvm-readobj/XCOFFDumper.cpp:316
+    W.startLine() << center_justify("Vaddr", Obj.is64Bit() ? 18 : 10)
+                  << center_justify("Type", 8) << center_justify(" RelSect", 8)
+                  << center_justify("SymbolName(Index)", 20) << "\n";
----------------
Esme wrote:
> We seem to be more accustomed to abbreviating Section as Sec, is it more meaningful to change `RelSect` to `SecNum`?
thanks


================
Comment at: llvm/tools/llvm-readobj/XCOFFDumper.cpp:316
+    W.startLine() << center_justify("Vaddr", Obj.is64Bit() ? 18 : 10)
+                  << center_justify("Type", 8) << center_justify(" RelSect", 8)
+                  << center_justify("SymbolName(Index)", 20) << "\n";
----------------
jhenderson wrote:
> DiggerLin wrote:
> > Esme wrote:
> > > We seem to be more accustomed to abbreviating Section as Sec, is it more meaningful to change `RelSect` to `SecNum`?
> > thanks
> I would actually here print "Section" or "SectionIndex". Ultimately though, do the same as we do for ELF, I recommend.
in AIX doc , it always use SectionNumber, and all implement of llvm tools, it always use SectionNumber. not Section Index.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136787



More information about the llvm-commits mailing list