1 RUN: yaml2obj %p/Inputs/COFF/i386.yaml | llvm-nm \
2 RUN: | FileCheck %s -check-prefix COFF
3 RUN: yaml2obj %p/Inputs/COFF/x86-64.yaml | llvm-nm \
4 RUN: | FileCheck %s -check-prefix COFF
5 RUN: llvm-nm %p/Inputs/trivial-object-test.elf-i386 \
6 RUN: | FileCheck %s -check-prefix ELF
7 RUN: llvm-nm %p/Inputs/trivial-object-test.elf-x86-64 \
8 RUN: | FileCheck %s -check-prefix ELF64
9 RUN: llvm-nm %p/Inputs/weak.elf-x86-64 \
10 RUN: | FileCheck %s -check-prefix WEAK-ELF64
11 RUN: llvm-nm %p/Inputs/absolute.elf-x86-64 \
12 RUN: | FileCheck %s -check-prefix ABSOLUTE-ELF64
13 RUN: llvm-nm %p/Inputs/trivial-object-test.macho-i386 \
14 RUN: | FileCheck %s -check-prefix macho
15 RUN: llvm-nm %p/Inputs/trivial-object-test.macho-x86-64 \
16 RUN: | FileCheck %s -check-prefix macho64
17 RUN: llvm-nm %p/Inputs/common.coff-i386 \
18 RUN: | FileCheck %s -check-prefix COFF-COMMON
19 RUN: llvm-nm %p/Inputs/relocatable-with-section-address.elf-x86-64 \
20 RUN: | FileCheck %s -check-prefix ELF-SEC-ADDR64
21 RUN: llvm-nm %p/Inputs/thumb-symbols.elf.arm \
22 RUN: | FileCheck %s -check-prefix ELF-THUMB
25 COFF: 00000000 d .data
26 COFF: 00000000 t .text
27 COFF: 00000000 d L{{_?}}.str
28 COFF: U {{_?}}SomeOtherFunction
29 COFF: 00000000 T {{_?}}main
32 COFF-COMMON: 00000000 b .bss
33 COFF-COMMON-NEXT: 00000000 d .data
34 COFF-COMMON-NEXT: 00000000 d .drectve
35 COFF-COMMON-NEXT: 00000000 n .file
36 COFF-COMMON-NEXT: 00000000 r .rdata$zzz
37 COFF-COMMON-NEXT: 00000000 t .text
38 COFF-COMMON-NEXT: C _a
42 ELF: U SomeOtherFunction
46 ELF64: U SomeOtherFunction
47 ELF64: 0000000000000000 T main
51 WEAK-ELF64: 0000000000000000 W f2
53 WEAK-ELF64: 0000000000000000 V x2
55 ABSOLUTE-ELF64: 0000000000000123 a a1
56 ABSOLUTE-ELF64: 0000000000000123 A a2
58 macho: U _SomeOtherFunction
59 macho: 00000000 T _main
62 macho64: 0000000000000028 s L_.str
63 macho64: U _SomeOtherFunction
64 macho64: 0000000000000000 T _main
68 Test that nm uses addresses even with ELF .o files.
69 ELF-SEC-ADDR64: 0000000000000058 D a
70 ELF-SEC-ADDR64-NEXT: 000000000000005c D b
71 ELF-SEC-ADDR64-NEXT: 0000000000000040 T f
72 ELF-SEC-ADDR64-NEXT: 0000000000000050 T g
73 ELF-SEC-ADDR64-NEXT: 0000000000000060 D p
76 Test that we drop the thumb bit only from function addresses.
77 ELF-THUMB: 00000000 t f
78 ELF-THUMB: 00000003 t g