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

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 27 19:49:12 PDT 2018


ruiu added inline comments.


================
Comment at: ELF/MapFile.cpp:50
   int W = Config->Is64 ? 16 : 8;
-  OS << format("%0*llx %0*llx %5lld ", W, Addr, W, Size, Align);
+  OS << format("%0*llx %0*llx %0*llx %5lld ", W, VA, W, LMA, W, Size, Align);
 }
----------------
I think I'm fine with showing LMA along with VMA, but my concern was that we would be showing too much information that's not easy to digest. I have one suggestion. We could stop printing out leading zeros for VMA and LMA to make it more concise. I.e. changing this line to

  format("%*llx %*llx %*llx %5lld ", W, VA, W, LMA, W, Size, Align)


================
Comment at: ELF/MapFile.cpp:112
+    OutputSection *OSec = Syms[I]->getOutputSection();
+    uint64_t VA = Syms[I]->getVA();
+    uint64_t LMA = OSec ? getLMA(OSec) + VA - OSec->getVA(0) : 0;
----------------
Please always be consistent. The word that pair up with "LMA" is "VMA".


================
Comment at: ELF/MapFile.cpp:181-182
   int W = Config->Is64 ? 16 : 8;
-  OS << left_justify("Address", W) << ' ' << left_justify("Size", W)
-     << " Align Out     In      Symbol\n";
+  OS << left_justify("VA", W) << ' ' << left_justify("LMA", W) << ' '
+     << left_justify("Size", W) << " Align Out     In      Symbol\n";
 
----------------
Use right_justify.


https://reviews.llvm.org/D44899





More information about the llvm-commits mailing list