[PATCH] D57146: [llvm-objdump] - Print LMAs when dumping section headers.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 24 04:14:20 PST 2019


grimar added a comment.

In D57146#1369140 <https://reviews.llvm.org/D57146#1369140>, @jhenderson wrote:

> The code change looks basically fine, but I'm wondering if we really want this? For many (most?) use cases, the LMA is the same as the VMA, so the extra column is just useless noise. I know we want to broadly be consistent with GNU tools, but I wonder if that's the case when it doesn't make that much sense?


We had the same concern for-Map option in LLD. It did not print LMA initially but there were requests from embedded developers about adding it.
(https://reviews.llvm.org/D44899#1049497)

I also think it might be useful for writing some test cases. For example, I see that LLD's `at.s` test does not explicitly
shows/tests the sections LMAs: https://github.com/llvm-mirror/lld/blob/master/test/ELF/linkerscript/at.s
We probably might parse the -`Map` option output to improve it, but seems that having `llvm-objdump` output would be a more natural way to go probably.

I'll add Peter to this thread to see if he has any opinion on that too.

> What do you think about the following approach:
> 
> 1. If there are any segments with different p_vaddr and p_paddr, go with your suggestion.
> 2. If a user specifies a switch, e.g. --show-lma, also go with your suggestion.
> 3. Otherwise, only print the VMA.
> 
>   The issue with this is that it might break parsers which are written against GNU objdump's behaviour. I'm not sure if this is an issue or not? The switch is designed to mitigate that problem.
> 
>   It's probably worth getting some others to give their opinion on this.

Generally, your suggestion sounds OK to me. I'll also be happy to hear other opinions.


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

https://reviews.llvm.org/D57146





More information about the llvm-commits mailing list