[PATCH] D75131: [XCOFF][AIX] Enable -r option for llvm-objdump

Jason Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 28 13:24:16 PST 2020


jasonliu marked 4 inline comments as done.
jasonliu added inline comments.


================
Comment at: llvm/lib/Object/XCOFFObjectFile.cpp:322
 relocation_iterator XCOFFObjectFile::section_rel_begin(DataRefImpl Sec) const {
-  llvm_unreachable("Not yet implemented!");
-  return relocation_iterator(RelocationRef());
+  assert(!is64Bit() && "64-bit support not implemented yet.");
+  const XCOFFSectionHeader32* SectionEntPtr = toSection32(Sec);
----------------
jhenderson wrote:
> Does other code further up the stack check to make sure the file is not 64 bits? If not, this isn't a valid assertion, since the program could reach this point. What would happen then if assertions are disabled?
> 
> Same comment goes for all the other instances of this.
I agree. I will make them all report_fatal_error instead of assertion. 


================
Comment at: llvm/lib/Object/XCOFFObjectFile.cpp:362
+  }
+  llvm_unreachable("Cannot find the containing section for this relocation.");
 }
----------------
davidb wrote:
> jhenderson wrote:
> > Is this really unreachable? Could you get to here with an object with some invalid relocation or section property?
> Agree. I think a relocation with an invalid r_vaddr could fall through this.
I see. I could make them report_fatal_error instead. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75131





More information about the llvm-commits mailing list