From 5a9529f4a2991c3b1cd8c9a4d248cd0fbfdbdbec Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Wed, 4 Apr 2018 21:25:37 +0000 Subject: [PATCH] Do not show alignment 0 because that is equivalent to 1. Differential Revision: https://reviews.llvm.org/D44991 llvm-svn: 329233 --- lld/ELF/MapFile.cpp | 4 ++-- lld/test/ELF/map-file.s | 32 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lld/ELF/MapFile.cpp b/lld/ELF/MapFile.cpp index 8f6fce3..52e2d13 100644 --- a/lld/ELF/MapFile.cpp +++ b/lld/ELF/MapFile.cpp @@ -102,7 +102,7 @@ getSymbolStrings(ArrayRef Syms) { std::vector Str(Syms.size()); parallelForEachN(0, Syms.size(), [&](size_t I) { raw_string_ostream OS(Str[I]); - writeHeader(OS, Syms[I]->getVA(), Syms[I]->getSize(), 0); + writeHeader(OS, Syms[I]->getVA(), Syms[I]->getSize(), 1); OS << Indent16 << toString(*Syms[I]); }); @@ -143,7 +143,7 @@ static void printEhFrame(raw_ostream &OS, OutputSection *OSec) { // Print out section pieces. for (EhSectionPiece &P : Pieces) { - writeHeader(OS, OSec->Addr + P.OutputOff, P.Size, 0); + writeHeader(OS, OSec->Addr + P.OutputOff, P.Size, 1); OS << Indent8 << toString(P.Sec->File) << ":(" << P.Sec->Name << "+0x" << Twine::utohexstr(P.InputOff) + ")\n"; } diff --git a/lld/test/ELF/map-file.s b/lld/test/ELF/map-file.s index 23b9381..7d252f9 100644 --- a/lld/test/ELF/map-file.s +++ b/lld/test/ELF/map-file.s @@ -54,38 +54,38 @@ labs = 0x1AB5 // CHECK-NEXT: 0000000000200300 0000000000000030 8 .rela.plt // CHECK-NEXT: 0000000000200300 0000000000000030 8 :(.rela.plt) // CHECK-NEXT: 0000000000200330 0000000000000060 8 .eh_frame -// CHECK-NEXT: 0000000000200330 000000000000002c 0 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.eh_frame+0x0) -// CHECK-NEXT: 0000000000200360 0000000000000014 0 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.eh_frame+0x2c) -// CHECK-NEXT: 0000000000200378 0000000000000018 0 {{.*}}{{/|\\}}map-file.s.tmp2.o:(.eh_frame+0x18) +// CHECK-NEXT: 0000000000200330 000000000000002c 1 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.eh_frame+0x0) +// CHECK-NEXT: 0000000000200360 0000000000000014 1 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.eh_frame+0x2c) +// CHECK-NEXT: 0000000000200378 0000000000000018 1 {{.*}}{{/|\\}}map-file.s.tmp2.o:(.eh_frame+0x18) // CHECK-NEXT: 0000000000201000 000000000000002d 4 .text // CHECK-NEXT: 0000000000201000 0000000000000028 4 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.text) -// CHECK-NEXT: 0000000000201000 0000000000000000 0 _start -// CHECK-NEXT: 000000000020101f 0000000000000000 0 f(int) -// CHECK-NEXT: 0000000000201028 0000000000000000 0 local +// CHECK-NEXT: 0000000000201000 0000000000000000 1 _start +// CHECK-NEXT: 000000000020101f 0000000000000000 1 f(int) +// CHECK-NEXT: 0000000000201028 0000000000000000 1 local // CHECK-NEXT: 0000000000201028 0000000000000002 4 {{.*}}{{/|\\}}map-file.s.tmp2.o:(.text) -// CHECK-NEXT: 0000000000201028 0000000000000000 0 foo -// CHECK-NEXT: 0000000000201029 0000000000000000 0 bar +// CHECK-NEXT: 0000000000201028 0000000000000000 1 foo +// CHECK-NEXT: 0000000000201029 0000000000000000 1 bar // CHECK-NEXT: 000000000020102a 0000000000000000 1 {{.*}}{{/|\\}}map-file.s.tmp2.o:(.text.zed) -// CHECK-NEXT: 000000000020102a 0000000000000000 0 zed +// CHECK-NEXT: 000000000020102a 0000000000000000 1 zed // CHECK-NEXT: 000000000020102c 0000000000000000 4 {{.*}}{{/|\\}}map-file.s.tmp3.o:(.text) -// CHECK-NEXT: 000000000020102c 0000000000000000 0 bah +// CHECK-NEXT: 000000000020102c 0000000000000000 1 bah // CHECK-NEXT: 000000000020102c 0000000000000001 4 {{.*}}{{/|\\}}map-file.s.tmp4.a(map-file.s.tmp4.o):(.text) -// CHECK-NEXT: 000000000020102c 0000000000000000 0 baz +// CHECK-NEXT: 000000000020102c 0000000000000000 1 baz // CHECK-NEXT: 0000000000201030 0000000000000030 16 .plt // CHECK-NEXT: 0000000000201030 0000000000000030 16 :(.plt) -// CHECK-NEXT: 0000000000201040 0000000000000000 0 sharedFunc1 -// CHECK-NEXT: 0000000000201050 0000000000000000 0 sharedFunc2 +// CHECK-NEXT: 0000000000201040 0000000000000000 1 sharedFunc1 +// CHECK-NEXT: 0000000000201050 0000000000000000 1 sharedFunc2 // CHECK-NEXT: 0000000000202000 0000000000000028 8 .got.plt // CHECK-NEXT: 0000000000202000 0000000000000028 8 :(.got.plt) // CHECK-NEXT: 0000000000203000 0000000000000100 8 .dynamic // CHECK-NEXT: 0000000000203000 0000000000000100 8 :(.dynamic) // CHECK-NEXT: 0000000000204000 0000000000000010 16 .bss // CHECK-NEXT: 0000000000204000 0000000000000004 16 {{.*}}{{/|\\}}map-file.s.tmp1.o:(COMMON) -// CHECK-NEXT: 0000000000204000 0000000000000004 0 common +// CHECK-NEXT: 0000000000204000 0000000000000004 1 common // CHECK-NEXT: 0000000000204004 0000000000000004 1 :(.bss) -// CHECK-NEXT: 0000000000204004 0000000000000004 0 sharedFoo +// CHECK-NEXT: 0000000000204004 0000000000000004 1 sharedFoo // CHECK-NEXT: 0000000000204008 0000000000000008 1 :(.bss) -// CHECK-NEXT: 0000000000204008 0000000000000008 0 sharedBar +// CHECK-NEXT: 0000000000204008 0000000000000008 1 sharedBar // CHECK-NEXT: 0000000000000000 0000000000000008 1 .comment // CHECK-NEXT: 0000000000000000 0000000000000008 1 :(.comment) // CHECK-NEXT: 0000000000000000 0000000000000198 8 .symtab -- 2.7.4