diff options
| author | Kevin Enderby <enderby@apple.com> | 2014-07-11 20:30:00 +0000 |
|---|---|---|
| committer | Kevin Enderby <enderby@apple.com> | 2014-07-11 20:30:00 +0000 |
| commit | fe6ad97ca83ec5e80331e93dda17525ce0d851c9 (patch) | |
| tree | 3446c326393f7d9a7bd13fdf5530076c63930ec3 /llvm/test | |
| parent | 9b21c33da44985b59e637ee3a235ad1fb3472c60 (diff) | |
| download | bcm5719-llvm-fe6ad97ca83ec5e80331e93dda17525ce0d851c9.tar.gz bcm5719-llvm-fe6ad97ca83ec5e80331e93dda17525ce0d851c9.zip | |
Add the "-s" flag to llvm-nm for Mach-O files that prints symbols only in
the specified section. This is same functionality as darwin’s nm(1) "-s" flag.
There is one FIXME in the code and I’m all ears to anyone that can help me
with that. This option takes exactly two strings and should be allowed
anywhere on the command line. Such that "llvm-nm -s __TEXT __text foo.o"
would work. But that does not as the CommandLine Library does not have a
way to make this work as far as I can tell. For now the "-s __TEXT __text"
has to be last on the command line.
llvm-svn: 212842
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Object/nm-trivial-object.test | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/test/Object/nm-trivial-object.test b/llvm/test/Object/nm-trivial-object.test index 656d6b00cd3..93ddb0c56c1 100644 --- a/llvm/test/Object/nm-trivial-object.test +++ b/llvm/test/Object/nm-trivial-object.test @@ -22,6 +22,8 @@ RUN: llvm-nm -j %p/Inputs/macho-text-data-bss.macho-x86_64 \ RUN: | FileCheck %s -check-prefix macho-j RUN: llvm-nm -r %p/Inputs/macho-text-data-bss.macho-x86_64 \ RUN: | FileCheck %s -check-prefix macho-r +RUN: llvm-nm %p/Inputs/macho-text-data-bss.macho-x86_64 -s __DATA __data \ +RUN: | FileCheck %s -check-prefix macho-s RUN: llvm-nm %p/Inputs/common.coff-i386 \ RUN: | FileCheck %s -check-prefix COFF-COMMON RUN: llvm-nm %p/Inputs/relocatable-with-section-address.elf-x86-64 \ @@ -99,6 +101,12 @@ macho-r-NEXT: 000000000000000c D _d macho-r-NEXT: 0000000000000070 b _b macho-r-NEXT: 0000000000000030 s EH_frame0 +macho-s: 000000000000000c D _d +macho-s-NOT: 0000000000000048 S _t.eh +macho-s-NOT: 0000000000000000 T _t +macho-s-NOT: 0000000000000070 b _b +macho-s-NOT: 0000000000000030 s EH_frame0 + Test that nm uses addresses even with ELF .o files. ELF-SEC-ADDR64: 0000000000000058 D a ELF-SEC-ADDR64-NEXT: 000000000000005c D b |

