• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1RUN: yaml2obj %p/Inputs/COFF/i386.yaml | llvm-nm - \
2RUN:         | FileCheck %s -check-prefix COFF
3RUN: yaml2obj %p/Inputs/COFF/x86-64.yaml | llvm-nm - \
4RUN:         | FileCheck %s -check-prefix COFF
5RUN: llvm-nm %p/Inputs/trivial-object-test.elf-i386 \
6RUN:         | FileCheck %s -check-prefix ELF
7RUN: llvm-nm %p/Inputs/trivial-object-test.elf-x86-64 \
8RUN:         | FileCheck %s -check-prefix ELF64
9RUN: llvm-nm %p/Inputs/weak.elf-x86-64 \
10RUN:         | FileCheck %s -check-prefix WEAK-ELF64
11RUN: llvm-nm %p/Inputs/absolute.elf-x86-64 \
12RUN:         | FileCheck %s -check-prefix ABSOLUTE-ELF64
13RUN: llvm-nm %p/Inputs/trivial-object-test.macho-i386 \
14RUN:         | FileCheck %s -check-prefix macho
15RUN: llvm-nm -U %p/Inputs/trivial-object-test.macho-i386 \
16RUN:         | FileCheck %s -check-prefix macho-U
17RUN: llvm-nm %p/Inputs/trivial-object-test.macho-x86-64 \
18RUN:         | FileCheck %s -check-prefix macho64
19RUN: llvm-nm %p/Inputs/macho-text-data-bss.macho-x86_64 \
20RUN:         | FileCheck %s -check-prefix macho-tdb
21RUN: llvm-nm -j %p/Inputs/macho-text-data-bss.macho-x86_64 \
22RUN:         | FileCheck %s -check-prefix macho-j
23RUN: llvm-nm -r %p/Inputs/macho-text-data-bss.macho-x86_64 \
24RUN:         | FileCheck %s -check-prefix macho-r
25RUN: llvm-nm %p/Inputs/common.coff-i386 \
26RUN:         | FileCheck %s -check-prefix COFF-COMMON
27RUN: llvm-nm %p/Inputs/relocatable-with-section-address.elf-x86-64 \
28RUN:         | FileCheck %s -check-prefix ELF-SEC-ADDR64
29RUN: llvm-nm %p/Inputs/thumb-symbols.elf.arm \
30RUN:         | FileCheck %s -check-prefix ELF-THUMB
31RUN: mkdir -p %t
32RUN: cd %t
33RUN: cp %p/Inputs/trivial-object-test.macho-i386 a.out
34RUN: llvm-nm | FileCheck %s -check-prefix A-OUT
35REQUIRES: shell
36
37
38COFF: 00000000 d .data
39COFF: 00000000 t .text
40COFF: 00000000 d L{{_?}}.str
41COFF:          U {{_?}}SomeOtherFunction
42COFF: 00000000 T {{_?}}main
43COFF:          U {{_?}}puts
44
45COFF-COMMON: 00000000 b .bss
46COFF-COMMON-NEXT: 00000000 d .data
47COFF-COMMON-NEXT: 00000000 d .drectve
48COFF-COMMON-NEXT: 00000000 n .file
49COFF-COMMON-NEXT: 00000000 r .rdata$zzz
50COFF-COMMON-NEXT: 00000000 t .text
51COFF-COMMON-NEXT:          C _a
52
53
54ELF-NOT:      U
55ELF:          U SomeOtherFunction
56ELF: 00000000 T main
57ELF:          U puts
58
59ELF64:                  U SomeOtherFunction
60ELF64: 0000000000000000 T main
61ELF64:                  U puts
62
63WEAK-ELF64:                  w f1
64WEAK-ELF64: 0000000000000000 W f2
65WEAK-ELF64:                  v x1
66WEAK-ELF64: 0000000000000000 V x2
67
68ABSOLUTE-ELF64: 0000000000000123 a a1
69ABSOLUTE-ELF64: 0000000000000123 A a2
70
71macho:          U _SomeOtherFunction
72macho: 00000000 T _main
73macho:          U _puts
74
75macho-U-NOT:          U _SomeOtherFunction
76macho-U: 00000000 T _main
77macho-U-NOT:          U _puts
78
79macho64: 0000000000000028 s L_.str
80macho64:                  U _SomeOtherFunction
81macho64: 0000000000000000 T _main
82macho64:                  U _puts
83
84macho-tdb: 0000000000000030 s EH_frame0
85macho-tdb: 0000000000000070 b _b
86macho-tdb: 000000000000000c D _d
87macho-tdb: 0000000000000000 T _t
88macho-tdb: 0000000000000048 S _t.eh
89
90macho-j: EH_frame0
91macho-j: _b
92macho-j: _d
93macho-j: _t
94macho-j: _t.eh
95
96macho-r: 0000000000000048 S _t.eh
97macho-r-NEXT: 0000000000000000 T _t
98macho-r-NEXT: 000000000000000c D _d
99macho-r-NEXT: 0000000000000070 b _b
100macho-r-NEXT: 0000000000000030 s EH_frame0
101
102Test that nm uses addresses even with ELF .o files.
103ELF-SEC-ADDR64:      0000000000000058 D a
104ELF-SEC-ADDR64-NEXT: 000000000000005c D b
105ELF-SEC-ADDR64-NEXT: 0000000000000040 T f
106ELF-SEC-ADDR64-NEXT: 0000000000000050 T g
107ELF-SEC-ADDR64-NEXT: 0000000000000060 D p
108
109
110Test that we drop the thumb bit only from function addresses.
111ELF-THUMB: 00000000 t f
112ELF-THUMB: 00000003 t g
113
114A-OUT:          U _SomeOtherFunction
115A-OUT: 00000000 T _main
116A-OUT:          U _puts
117