[PATCH] D153027: [llvm-objdump] --adjust-vma adjust symbol table

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 21 00:41:35 PDT 2023


MaskRay added inline comments.


================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:2403
                                    ArchitectureName);
+  Address += AdjustVMA;
   if ((Address < StartAddress) || (Address > StopAddress))
----------------
jhenderson wrote:
> mysterymath wrote:
> > This needs a `shouldAdjustVA(Section)` guard like other places where the adjustment is added, to avoid adjusting e.g. non-alloc sections.
> We need a test case that shows that this `shouldAdjustVA` function has been called. I don't believe any of the symbols in the test you've added are impacted by this? You can add a symbol to the YAML in the test file that is in the .debug_str section, to achieve this, I believe.
I think this should be `if (SecI != O.section_end() && shouldAdjustVA(*SecI))` to protect a dereference of `O.section_end()`.

D153401 will add another interesting test about a `SHN_ABS` symbol.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153027



More information about the llvm-commits mailing list