[PATCH] D109016: [llvm-objdump] Fix 'llvm-objdump -dr' for executables with relocations

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 31 18:44:17 PDT 2021


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

It would be good to wait for @jhenderson as well.



================
Comment at: llvm/test/tools/llvm-objdump/ELF/exec-relocations.test:65
+    Binding:         STB_GLOBAL
+  - Name:            main
+    Type:            STT_FUNC
----------------
remove unused `main`


================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1290
     uint64_t Index;
+    uint64_t RelAdjustment = Obj->isRelocatableObject() ? 0 : SectionAddr;
     bool PrintedSection = false;
----------------
// In executable and shared objects, r_offset holds a virtual address. Subtract SectionAddr from the r_offset field of a relocation to get the section offset.


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

https://reviews.llvm.org/D109016



More information about the llvm-commits mailing list