[PATCH] D44899: [ELF] - Print LMA in a -Map file.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 28 02:31:42 PDT 2018


jhenderson added a comment.

In https://reviews.llvm.org/D44899#1050202, @grimar wrote:

> In https://reviews.llvm.org/D44899#1050199, @jhenderson wrote:
>
> > Do we always want to show LMAs and VMAs? In some (possibly many) systems, the LMA will always match the VMA, so it seems like a lot of noise that doesn't benefit many consumers. Perhaps this could be put under an extra switch? Something like "--show-lma-in-map" (happy with a better name)?
>
>
> I suggested a bit different thing in the description that might help to solve this:
>  "to hide LMA column if it is known there is no difference with VA column. Then VA could be renamed to VMA/LMA"
>
> That might not be convenient for parsing sometimes probably since we would have a different amount of columns depending on inputs.
>  Not sure how much it is a problem though.


I missed that comment, but this would work for me, although the switch might resolve the parsing issue better. I think in general terms, it is likely on people's systems that the VMA and LMA will either always be the same or always different, though I wouldn't want to guarantee it. The parsing issue is then only an issue if we have people sharing parsers between the two cases. I don't think it would be that hard to work-around though: take a typical regex parser for example, and just have an optional catching group for the extra column. Then use the number of captured groups to determine whether LMA was emitted or not.

> FWIW, Rui's suggestion to drop leading zeroes also looks fine for me, it should make map file more readable with both VMA/LMA I think.

No problem with dropping leading zeroes, but I don't think that's really solving my issue. Less is more as they say (at least when the bit missing is useless info), and the LMA values are often redundant.


https://reviews.llvm.org/D44899





More information about the llvm-commits mailing list