[PATCH] D62179: [llvm-readelf] - Allow dumping of the .dynamic section even if there is no PT_DYNAMIC header.

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 28 13:06:45 PDT 2019


rupprecht accepted this revision.
rupprecht added a comment.
This revision is now accepted and ready to land.

Thanks for following up with this! Just one optional suggestion:



================
Comment at: tools/llvm-readobj/ELFDumper.cpp:1486
       HashTable =
-          reinterpret_cast<const Elf_Hash *>(toMappedAddr(Dyn.getPtr()));
+          reinterpret_cast<const Elf_Hash *>(toMappedAddr("DT_HASH", Dyn.getPtr()));
       break;
----------------
Instead of constants like `"DT_HASH"` for all these changes, can you pass in `Dyn.d_tag` instead and use `getTypeString()` within `toMappedAddr` to print the string? (Passing `Obj->getHeader()->e_machine` by lambda capture). That will keep all these calls identical.


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

https://reviews.llvm.org/D62179





More information about the llvm-commits mailing list