• Home
  • Raw
  • Download

Lines Matching full:symbols

1 ## This is a general test for --symbols option and its aliases.
2 ## There are also other symbols* tests that check specific things.
6 ## They might never have dynamic symbols normally, for example, though we still want
7 ## to document the --dyn-symbols behavior.
11 ## Case 1: Test how llvm-readobj and llvm-readelf dumps symbols.
14 # RUN: llvm-readobj --symbols %t64 | FileCheck %s --match-full-lines --strict-whitespace --check-pr…
15 # RUN: llvm-readelf --symbols %t64 | FileCheck %s --match-full-lines --strict-whitespace --check-pr…
17 # RUN: llvm-readobj --symbols %t32 | FileCheck %s --match-full-lines --strict-whitespace --check-pr…
18 # RUN: llvm-readelf --symbols %t32 | FileCheck %s --match-full-lines --strict-whitespace --check-pr…
21 # RUN: llvm-readobj --symbols %t64.so | FileCheck %s --match-full-lines --strict-whitespace --check…
22 # RUN: llvm-readelf --symbols %t64.so | FileCheck %s --match-full-lines --strict-whitespace --check…
24 # RUN: llvm-readobj --symbols %t32.so | FileCheck %s --match-full-lines --strict-whitespace --check…
25 # RUN: llvm-readelf --symbols %t32.so | FileCheck %s --match-full-lines --strict-whitespace --check…
27 # SYMBOLS-LLVM:Symbols [
28 # SYMBOLS-LLVM-NEXT: Symbol {
29 # SYMBOLS-LLVM-NEXT: Name: (0)
30 # SYMBOLS-LLVM-NEXT: Value: 0x0
31 # SYMBOLS-LLVM-NEXT: Size: 0
32 # SYMBOLS-LLVM-NEXT: Binding: Local (0x0)
33 # SYMBOLS-LLVM-NEXT: Type: None (0x0)
34 # SYMBOLS-LLVM-NEXT: Other: 0
35 # SYMBOLS-LLVM-NEXT: Section: Undefined (0x0)
36 # SYMBOLS-LLVM-NEXT: }
37 # SYMBOLS-LLVM-NEXT: Symbol {
38 # SYMBOLS-LLVM-NEXT: Name: foo (5)
39 # SYMBOLS-LLVM-NEXT: Value: 0x1
40 # SYMBOLS-LLVM-NEXT: Size: 0
41 # SYMBOLS-LLVM-NEXT: Binding: Local (0x0)
42 # SYMBOLS-LLVM-NEXT: Type: None (0x0)
43 # SYMBOLS-LLVM-NEXT: Other: 0
44 # SYMBOLS-LLVM-NEXT: Section: Undefined (0x0)
45 # SYMBOLS-LLVM-NEXT: }
46 # SYMBOLS-LLVM-NEXT: Symbol {
47 # SYMBOLS-LLVM-NEXT: Name: bar (1)
48 # SYMBOLS-LLVM-NEXT: Value: 0x2
49 # SYMBOLS-LLVM-NEXT: Size: 0
50 # SYMBOLS-LLVM-NEXT: Binding: Local (0x0)
51 # SYMBOLS-LLVM-NEXT: Type: None (0x0)
52 # SYMBOLS-LLVM-NEXT: Other: 0
53 # SYMBOLS-LLVM-NEXT: Section: Undefined (0x0)
54 # SYMBOLS-LLVM-NEXT: }
55 # SYMBOLS-LLVM-NEXT:]
57 # SYMBOLS-GNU64:Symbol table '.symtab' contains 3 entries:
58 # SYMBOLS-GNU64-NEXT: Num: Value Size Type Bind Vis Ndx Name
59 # SYMBOLS-GNU64-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
60 # SYMBOLS-GNU64-NEXT: 1: 0000000000000001 0 NOTYPE LOCAL DEFAULT UND foo
61 # SYMBOLS-GNU64-NEXT: 2: 0000000000000002 0 NOTYPE LOCAL DEFAULT UND bar
63 # SYMBOLS-GNU32:Symbol table '.symtab' contains 3 entries:
64 # SYMBOLS-GNU32-NEXT: Num: Value Size Type Bind Vis Ndx Name
65 # SYMBOLS-GNU32-NEXT: 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
66 # SYMBOLS-GNU32-NEXT: 1: 00000001 0 NOTYPE LOCAL DEFAULT UND foo
67 # SYMBOLS-GNU32-NEXT: 2: 00000002 0 NOTYPE LOCAL DEFAULT UND bar
70 # RUN: llvm-readobj --symbols %t64 > %t.symbols
72 # RUN: cmp %t.symbols %t.syms
74 # RUN: cmp %t.symbols %t.t
76 # RUN: cmp %t.symbols %t.lowers
78 # RUN: llvm-readelf --symbols %t64 > %t.symbols.gnu
80 # RUN: cmp %t.symbols.gnu %t.syms.gnu
85 ## Case 3: Test that both regular and dynamic symbols are dumped when `--symbols` and `--dyn-symbol…
87 # RUN: llvm-readobj --symbols --dyn-symbols %t64 | FileCheck %s --check-prefix=BOTH-LLVM
88 # RUN: llvm-readelf --symbols --dyn-symbols %t64 | FileCheck %s --check-prefix=BOTH-GNU
90 # BOTH-LLVM: Symbols [
96 ## Case 4: --symbols implies --dyn-symbols for llvm-readelf.
97 # RUN: llvm-readobj --symbols %t64 | FileCheck %s --implicit-check-not="DynamicSymbols ["
98 # RUN: llvm-readelf --symbols %t64 | FileCheck %s --check-prefix=BOTH-GNU
100 ## Case 5: Test that `--dyn-symbols` does not trigger `--symbols` implicitly.
101 # RUN: llvm-readobj --dyn-symbols %t64 | FileCheck %s --implicit-check-not="{{^}}Symbols ["
102 # RUN: llvm-readelf --dyn-symbols %t64 | FileCheck %s --implicit-check-not="Symbol table '.symtab'"
105 # RUN: llvm-readelf --symbols %t64 %t64 | FileCheck %s --check-prefix=NUM-INDEX
119 Symbols:
127 ## Check the behavior when we are unable to print symbols due to an error.
129 ## Case 1: check we are able to dump symbols even when can't get the string table for the
132 # RUN: llvm-readobj --symbols %t64.err1 2>&1 | \
134 # RUN: llvm-readelf --symbols %t64.err1 2>&1 | \
137 # STRTAB-LINK-ERR-LLVM: Symbols [
179 Symbols:
185 ## Case 2: check we report a warning when we are unable to read symbols
188 # RUN: llvm-readobj --symbols %t64.err2 2>&1 | \
190 # RUN: llvm-readelf --symbols %t64.err2 2>&1 | \
193 # SYMTAB-ENTSIZE-ERR-LLVM: Symbols [
194 # SYMTAB-ENTSIZE-ERR-LLVM-NEXT: warning: '[[FILE]]': unable to read symbols from the SHT_SYMTAB s…
197 # SYMTAB-ENTSIZE-ERR-GNU: warning: '[[FILE]]': unable to read symbols from the SHT_SYMTAB secti…
203 # RUN: llvm-readobj --symbols %t64.err3 2>&1 | \
205 # RUN: llvm-readelf --symbols %t64.err3 2>&1 | \
208 # SYMTAB-SHSTRTAB-ERR-LLVM: Symbols [