summaryrefslogtreecommitdiffstats
path: root/lld/ELF/MapFile.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2018-04-05 16:45:37 +0000
committerRui Ueyama <ruiu@google.com>2018-04-05 16:45:37 +0000
commit16a130bc78270bb9e2e77bd40e637df39ac13361 (patch)
tree7a525385f4e6479989c70d69179ff2a4fc80c399 /lld/ELF/MapFile.cpp
parentefc3f39f0293c930dd228cc43ce8c087795476b1 (diff)
downloadbcm5719-llvm-16a130bc78270bb9e2e77bd40e637df39ac13361.tar.gz
bcm5719-llvm-16a130bc78270bb9e2e77bd40e637df39ac13361.zip
Fix column size in the map file.
Size can be narrow, but LMA should be the same width as VMA. llvm-svn: 329312
Diffstat (limited to 'lld/ELF/MapFile.cpp')
-rw-r--r--lld/ELF/MapFile.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lld/ELF/MapFile.cpp b/lld/ELF/MapFile.cpp
index 55597adf7b9..4338efffee1 100644
--- a/lld/ELF/MapFile.cpp
+++ b/lld/ELF/MapFile.cpp
@@ -46,8 +46,10 @@ static const std::string Indent16 = " "; // 16 spaces
// Print out the first three columns of a line.
static void writeHeader(raw_ostream &OS, uint64_t VMA, uint64_t LMA,
uint64_t Size, uint64_t Align) {
- int W = Config->Is64 ? 16 : 8;
- OS << format("%*llx %9llx %*llx %5lld ", W, VMA, LMA, W, Size, Align);
+ if (Config->Is64)
+ OS << format("%16llx %16llx %9llx %5lld ", VMA, LMA, Size, Align);
+ else
+ OS << format("%8llx %8llx %9llx %5lld ", VMA, LMA, Size, Align);
}
// Returns a list of all symbols that we want to print out.
@@ -172,8 +174,8 @@ void elf::writeMapFile() {
// Print out the header line.
int W = Config->Is64 ? 16 : 8;
- OS << right_justify("VMA", W) << ' ' << right_justify("LMA", 9) << ' '
- << right_justify("Size", W) << " Align Out In Symbol\n";
+ OS << right_justify("VMA", W) << ' ' << right_justify("LMA", W) << ' '
+ << right_justify("Size", 9) << " Align Out In Symbol\n";
for (BaseCommand *Base : Script->SectionCommands) {
if (auto *Cmd = dyn_cast<SymbolAssignment>(Base)) {
OpenPOWER on IntegriCloud