From c150516f36d3cefa8672a7818893bae57060f398 Mon Sep 17 00:00:00 2001 From: Kevin Enderby Date: Thu, 3 Jul 2014 18:18:50 +0000 Subject: [PATCH] =?UTF-8?q?Add=20the=20-U=20flag=20to=20llvm-nm=20as=20an?= =?UTF-8?q?=20alias=20to=20-defined-only=20as=20darwin=E2=80=99s=20nm(1)?= =?UTF-8?q?=20uses=20-U=20for=20this=20functionality.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212280 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Object/nm-trivial-object.test | 6 ++++++ tools/llvm-nm/llvm-nm.cpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/test/Object/nm-trivial-object.test b/test/Object/nm-trivial-object.test index a1b8a30df25..09642e1c688 100644 --- a/test/Object/nm-trivial-object.test +++ b/test/Object/nm-trivial-object.test @@ -12,6 +12,8 @@ RUN: llvm-nm %p/Inputs/absolute.elf-x86-64 \ RUN: | FileCheck %s -check-prefix ABSOLUTE-ELF64 RUN: llvm-nm %p/Inputs/trivial-object-test.macho-i386 \ RUN: | FileCheck %s -check-prefix macho +RUN: llvm-nm -U %p/Inputs/trivial-object-test.macho-i386 \ +RUN: | FileCheck %s -check-prefix macho-U RUN: llvm-nm %p/Inputs/trivial-object-test.macho-x86-64 \ RUN: | FileCheck %s -check-prefix macho64 RUN: llvm-nm %p/Inputs/macho-text-data-bss.macho-x86_64 \ @@ -68,6 +70,10 @@ macho: U _SomeOtherFunction macho: 00000000 T _main macho: U _puts +macho-U-NOT: U _SomeOtherFunction +macho-U: 00000000 T _main +macho-U-NOT: U _puts + macho64: 0000000000000028 s L_.str macho64: U _SomeOtherFunction macho64: 0000000000000000 T _main diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp index 64aae5e0c34..0264b708ad6 100644 --- a/tools/llvm-nm/llvm-nm.cpp +++ b/tools/llvm-nm/llvm-nm.cpp @@ -73,6 +73,8 @@ cl::alias DynamicSyms2("D", cl::desc("Alias for --dynamic"), cl::opt DefinedOnly("defined-only", cl::desc("Show only defined symbols")); +cl::alias DefinedOnly2("U", cl::desc("Alias for --defined-only"), + cl::aliasopt(DefinedOnly)); cl::opt ExternalOnly("extern-only", cl::desc("Show only external symbols"));