]> granicus.if.org Git - llvm/commitdiff
[llvm-nm] Add --special-syms no-op flag
authorEugene Leviant <eleviant@accesssoftek.com>
Tue, 30 Apr 2019 13:51:48 +0000 (13:51 +0000)
committerEugene Leviant <eleviant@accesssoftek.com>
Tue, 30 Apr 2019 13:51:48 +0000 (13:51 +0000)
Differential revision: https://reviews.llvm.org/D60502

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359563 91177308-0d34-0410-b5e6-96231b3b80d8

test/tools/llvm-nm/AArch64/special-syms.test [new file with mode: 0644]
tools/llvm-nm/llvm-nm.cpp

diff --git a/test/tools/llvm-nm/AArch64/special-syms.test b/test/tools/llvm-nm/AArch64/special-syms.test
new file mode 100644 (file)
index 0000000..afc706b
--- /dev/null
@@ -0,0 +1,32 @@
+# RUN: yaml2obj %s > %t
+# Test --special-syms flag. Currently this flag is a no-op, so outputs with and without
+# this flag should be identical. GNU nm doesn't show ARM and AArch64 special symbols
+# without --special-syms, so this test is to be changed when/if we decide to implement
+# GNU nm-like behavior in llvm-nm
+
+# RUN: llvm-nm %t | FileCheck %s
+# RUN: llvm-nm %t --special-syms | FileCheck %s
+
+!ELF
+FileHeader:
+  Class:           ELFCLASS64
+  Data:            ELFDATA2LSB
+  Type:            ET_REL
+  Machine:         EM_AARCH64
+Sections:
+  - Name:            .text
+    Type:            SHT_PROGBITS
+    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
+    Address:         0x1000
+  - Name:            .data
+    Type:            SHT_PROGBITS
+    Flags:           [ SHF_ALLOC, SHF_WRITE ]
+    Address:         0x2000
+Symbols:
+  - Name:     $x.1
+    Section:  .text
+  - Name:     $d.1
+    Section:  .data
+
+# CHECK:      2000 d $d.1
+# CHECK-NEXT: 1000 t $x.1
index 62951480aad31819f96b8225dde51b57d4faa718..898ffd8bd92aff6142fd69d582cd0b840f2d49bc 100644 (file)
@@ -180,6 +180,9 @@ cl::opt<bool> JustSymbolName("just-symbol-name",
 cl::alias JustSymbolNames("j", cl::desc("Alias for --just-symbol-name"),
                           cl::aliasopt(JustSymbolName), cl::Grouping);
 
+cl::opt<bool> SpecialSyms("special-syms",
+                          cl::desc("No-op. Used for GNU compatibility only"));
+
 // FIXME: 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