[PATCH] D57051: [llvm-objdump] - Implement the --adjust-vma option.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 22 05:59:57 PST 2019


grimar created this revision.
grimar added reviewers: jhenderson, davide, rupprecht, khemant, jakehehrlich, sidneym.

GNU objdump's help says: "--adjust-vma: Add OFFSET to all displayed section addresses"
In real life what it does is a bit more complicated
(and IMO not always reasonable. For example, GNU objdump prints not only VMA, but also LMA
for sections. And with --adjust-vma it adjusts LMA, but only when a section has relocations.
llvm-objsump does not seem to support printing LMAs yet, but GNU's logic anyways does not
make sense for me here).

This patch tries to adjust VMA. I tried to implement a reasonable approach.
I am adjusting sections that are not allocatable. As, for example, adjusting debug sections
VA's and rel[a] sections VA's should not make sense. This behavior seems to be GNU compatible.


https://reviews.llvm.org/D57051

Files:
  test/tools/llvm-objdump/X86/adjust-vma.test
  tools/llvm-objdump/llvm-objdump.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57051.182895.patch
Type: text/x-patch
Size: 9014 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190122/14d9590c/attachment.bin>


More information about the llvm-commits mailing list