From: Kevin Enderby Date: Tue, 8 Jul 2014 23:47:31 +0000 (+0000) Subject: Changed the lvm-nm alias "-s" for -print-armap to "-M". X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8da4bd60fbbf09f3705c56327aab708423c0b821;p=platform%2Fupstream%2Fllvm.git Changed the lvm-nm alias "-s" for -print-armap to "-M". This will allow the "-s" flag to implemented in the future as it is in darwin’s nm(1) to list symbols only in the specified section. Given a LGTM by Shankar Easwaran who originally implemented the support for lvm-nm’s -print-armap and archive map symbols. llvm-svn: 212576 --- diff --git a/llvm/test/Object/X86/archive-ir-asm.ll b/llvm/test/Object/X86/archive-ir-asm.ll index 31ef6c6..560ac17 100644 --- a/llvm/test/Object/X86/archive-ir-asm.ll +++ b/llvm/test/Object/X86/archive-ir-asm.ll @@ -1,7 +1,7 @@ ; RUN: llvm-as %s -o=%t1 ; RUN: rm -f %t2 ; RUN: llvm-ar rcs %t2 %t1 -; RUN: llvm-nm -s %t2 | FileCheck %s +; RUN: llvm-nm -M %t2 | FileCheck %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" diff --git a/llvm/test/Object/archive-long-index.test b/llvm/test/Object/archive-long-index.test index f2f4df6..6feb69e 100644 --- a/llvm/test/Object/archive-long-index.test +++ b/llvm/test/Object/archive-long-index.test @@ -1,7 +1,7 @@ # # Check if the index is appearing properly in the output file # -RUN: llvm-nm -s %p/Inputs/liblong_filenames.a | FileCheck -check-prefix=CHECKIDX %s +RUN: llvm-nm -M %p/Inputs/liblong_filenames.a | FileCheck -check-prefix=CHECKIDX %s CHECKIDX: Archive map CHECKIDX: abcdefghijklmnopqrstuvwxyz12345678 in 1.o diff --git a/llvm/test/Object/archive-symtab.test b/llvm/test/Object/archive-symtab.test index 683d5f3..0899828b 100644 --- a/llvm/test/Object/archive-symtab.test +++ b/llvm/test/Object/archive-symtab.test @@ -1,6 +1,6 @@ RUN: rm -f %t.a RUN: llvm-ar rcs %t.a %p/Inputs/trivial-object-test.elf-x86-64 %p/Inputs/trivial-object-test2.elf-x86-64 -RUN: llvm-nm -s %t.a | FileCheck %s +RUN: llvm-nm -M %t.a | FileCheck %s CHECK: Archive map CHECK-NEXT: main in trivial-object-test.elf-x86-64 @@ -20,17 +20,17 @@ CHECK-NEXT: 0000000000000016 T main RUN: rm -f %t.a RUN: llvm-ar rcS %t.a %p/Inputs/trivial-object-test.elf-x86-64 %p/Inputs/trivial-object-test2.elf-x86-64 -RUN: llvm-nm -s %t.a | FileCheck %s --check-prefix=NOMAP +RUN: llvm-nm -M %t.a | FileCheck %s --check-prefix=NOMAP NOMAP-NOT: Archive map RUN: llvm-ar s %t.a -RUN: llvm-nm -s %t.a | FileCheck %s +RUN: llvm-nm -M %t.a | FileCheck %s check that the archive does have a corrupt symbol table. RUN: rm -f %t.a RUN: cp %p/Inputs/archive-test.a-corrupt-symbol-table %t.a -RUN: llvm-nm -s %t.a | FileCheck %s --check-prefix=CORRUPT +RUN: llvm-nm -M %t.a | FileCheck %s --check-prefix=CORRUPT CORRUPT: Archive map CORRUPT-NEXT: mbin in trivial-object-test.elf-x86-64 @@ -49,18 +49,18 @@ CORRUPT-NEXT: 0000000000000016 T main check that the we *don't* update the symbol table. RUN: llvm-ar s %t.a -RUN: llvm-nm -s %t.a | FileCheck %s --check-prefix=CORRUPT +RUN: llvm-nm -M %t.a | FileCheck %s --check-prefix=CORRUPT repeate the test with llvm-ranlib RUN: rm -f %t.a RUN: llvm-ar rcS %t.a %p/Inputs/trivial-object-test.elf-x86-64 %p/Inputs/trivial-object-test2.elf-x86-64 -RUN: llvm-nm -s %t.a | FileCheck %s --check-prefix=NOMAP +RUN: llvm-nm -M %t.a | FileCheck %s --check-prefix=NOMAP RUN: llvm-ranlib %t.a -RUN: llvm-nm -s %t.a | FileCheck %s +RUN: llvm-nm -M %t.a | FileCheck %s -RUN: llvm-nm -s %p/Inputs/macho-archive-x86_64.a | FileCheck %s --check-prefix=BSD-MachO +RUN: llvm-nm -M %p/Inputs/macho-archive-x86_64.a | FileCheck %s --check-prefix=BSD-MachO BSD-MachO: Archive map BSD-MachO: _bar in bar.o diff --git a/llvm/test/Object/coff-archive-short.test b/llvm/test/Object/coff-archive-short.test index fa531b3..2aee9569 100644 --- a/llvm/test/Object/coff-archive-short.test +++ b/llvm/test/Object/coff-archive-short.test @@ -5,7 +5,7 @@ # than 15 characters, thus, unlike coff_archive.lib, it has no string # table as the third member. # -RUN: llvm-nm --numeric-sort -s %p/Inputs/coff_archive_short.lib | FileCheck -check-prefix=CHECKIDX %s +RUN: llvm-nm --numeric-sort -M %p/Inputs/coff_archive_short.lib | FileCheck -check-prefix=CHECKIDX %s CHECKIDX: Archive map CHECKIDX: _shortfn1 in short1.obj diff --git a/llvm/test/Object/coff-archive.test b/llvm/test/Object/coff-archive.test index 768fe1c..3b0aa0c 100644 --- a/llvm/test/Object/coff-archive.test +++ b/llvm/test/Object/coff-archive.test @@ -1,7 +1,7 @@ # # Check if the index is appearing properly in the output file # -RUN: llvm-nm --numeric-sort -s %p/Inputs/coff_archive.lib | FileCheck -check-prefix=CHECKIDX %s +RUN: llvm-nm --numeric-sort -M %p/Inputs/coff_archive.lib | FileCheck -check-prefix=CHECKIDX %s CHECKIDX: Archive map CHECKIDX: ??0invalid_argument@std@@QAE@PBD@Z in Debug\mymath.obj diff --git a/llvm/test/Object/nm-archive.test b/llvm/test/Object/nm-archive.test index 9cb84b2..7dbc22a 100644 --- a/llvm/test/Object/nm-archive.test +++ b/llvm/test/Object/nm-archive.test @@ -30,7 +30,7 @@ RUN: llvm-nm %p/Inputs/archive-test.a-gnu-minimal And don't crash when asked to print a non-existing symtab. -RUN: llvm-nm -s %p/Inputs/archive-test.a-gnu-minimal +RUN: llvm-nm -M %p/Inputs/archive-test.a-gnu-minimal Don't reject an empty archive. RUN: llvm-nm %p/Inputs/archive-test.a-empty diff --git a/llvm/test/Object/simple-archive.test b/llvm/test/Object/simple-archive.test index 3e6760e..085a91e 100644 --- a/llvm/test/Object/simple-archive.test +++ b/llvm/test/Object/simple-archive.test @@ -1,7 +1,7 @@ # # Check if the index is appearing properly in the output file # -RUN: llvm-nm -s %p/Inputs/libsimple_archive.a | FileCheck -check-prefix=CHECKIDX %s +RUN: llvm-nm -M %p/Inputs/libsimple_archive.a | FileCheck -check-prefix=CHECKIDX %s CHECKIDX: Archive map CHECKIDX: abcdefghijklmnopqrstuvwxyz12345678 in 1.o diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp index 8a89dd8..3bd9ef9 100644 --- a/llvm/tools/llvm-nm/llvm-nm.cpp +++ b/llvm/tools/llvm-nm/llvm-nm.cpp @@ -129,7 +129,7 @@ cl::opt WithoutAliases("without-aliases", cl::Hidden, cl::desc("Exclude aliases from output")); cl::opt ArchiveMap("print-armap", cl::desc("Print the archive map")); -cl::alias ArchiveMaps("s", cl::desc("Alias for --print-armap"), +cl::alias ArchiveMaps("M", cl::desc("Alias for --print-armap"), cl::aliasopt(ArchiveMap)); cl::opt JustSymbolName("just-symbol-name",