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

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 3 10:08:07 PDT 2019


sfertile 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 {
----------------
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.


================
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
----------------
The `.ll` suffix implies the test is written in LLVM IR. Use `.test` instead. 


================
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)
----------------
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?


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