[PATCH] D67008: implement parsing relocation information for 32-bit xcoff objectfile

Digger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 7 07:20:04 PDT 2019


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


================
Comment at: llvm/lib/Object/XCOFFObjectFile.cpp:560
+// to the discussion of overflow headers in "Sections and Section Headers".
+uint32_t XCOFFObjectFile::getLogicalNumberOfRelocationEntries(
+    const XCOFFSectionHeader32 &Sec, uint16_t SectionIndex) const {
----------------
sfertile wrote:
> hubert.reinterpretcast wrote:
> > @sfertile, suggested that this be a separate patch. Could we land that first (with an update to how `STYP_OVRFLO` section headers are printed)?
> Yes Please.
I have created a new patch for it. https://reviews.llvm.org/D68575 . implement parsing overflow section header.


================
Comment at: llvm/test/tools/llvm-readobj/reloc_overflow.ll:1
+# RUN: llvm-readobj --sections %p/Inputs/xcoff-reloc-overflow.o | \
+# RUN: FileCheck --check-prefix=SECOVERFLOW %s
----------------
sfertile wrote:
> The `.ll` suffix implies the test is written in LLVM IR. Use `.test` instead. 
I will change the name


================
Comment at: llvm/tools/llvm-readobj/XCOFFDumper.cpp:140
+    // Only the .text, .data, .tdata, and STYP_DWARF sections have relocation.
+    if (Sec.Flags != XCOFF::STYP_TEXT && Sec.Flags != XCOFF::STYP_DATA &&
+        Sec.Flags != XCOFF::STYP_TDATA && Sec.Flags != XCOFF::STYP_DWARF)
----------------
sfertile wrote:
> Is this specified in the docs? I wasn't able to find it specified anywhere. What about the exception section?  I don't know anything about the exception implementation on AIX so I could be wrong, but I suspect it might contain relocations. 
> 
> I did find the specification of the special relocations in the loader table, and that they are a different format from the 'normal' relocations implemented in this patch. Does the loader section use the relocation pointer and relocation count in the section header table for these different relocations, or do we find them through fields defined in the loader section  itself?
from the xcoff document.
s_relptr	Recognized for the .text, .data, .tdata, and STYP_DWARF sections only.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D67008





More information about the llvm-commits mailing list