[PATCH] D47493: [llvm-objdump] Add -R option

Eric Christopher via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 6 01:39:33 PDT 2018


echristo added inline comments.


================
Comment at: include/llvm/Object/ELFObjectFile.h:795
 uint64_t ELFObjectFile<ELFT>::getRelocationOffset(DataRefImpl Rel) const {
-  assert(EF.getHeader()->e_type == ELF::ET_REL &&
-         "Only relocatable object files have relocation offsets");
----------------
paulsemel wrote:
> I guess this assert was not here for no reason. But I didn't understand why we were forbidding this function for ELF files other than ET_REL.. Can someone explain me those lines ?
I think it's that it was looking for a relocatable file and perhaps needs additional checks for any kind of relocatable rather than just relocatable object files.


================
Comment at: tools/llvm-objdump/llvm-objdump.cpp:441
   int64_t addend = 0;
+  bool undef = false;
   switch (Sec->sh_type) {
----------------
Can you add some explanatory comments here, it's not necessarily obvious what "undef" means in this context as it can be an overloaded term.


Repository:
  rL LLVM

https://reviews.llvm.org/D47493





More information about the llvm-commits mailing list