• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// REQUIRES: x86
2// Check that symbol table is correctly populated with local symbols.
3// RUN: llvm-mc -save-temp-labels -filetype=obj -triple=x86_64-pc-linux %s -o %t
4// RUN: ld.lld %t -o %t1
5// RUN: llvm-readobj --symbols -S %t1 | FileCheck %s
6
7// Check that Info is equal to the number of local symbols.
8// CHECK:   Section {
9// CHECK:     Name: .symtab
10// CHECK-NEXT:     Type: SHT_SYMTAB
11// CHECK-NEXT:     Flags [
12// CHECK-NEXT:     ]
13// CHECK-NEXT:     Address:
14// CHECK-NEXT:     Offset:
15// CHECK-NEXT:     Size:
16// CHECK-NEXT:     Link:
17// CHECK-NEXT:     Info: 6
18
19// CHECK: Symbols [
20// CHECK-NEXT:   Symbol {
21// CHECK-NEXT:     Name:
22// CHECK-NEXT:     Value: 0x0
23// CHECK-NEXT:     Size: 0
24// CHECK-NEXT:     Binding: Local
25// CHECK-NEXT:     Type: None
26// CHECK-NEXT:     Other: 0
27// CHECK-NEXT:     Section: Undefined
28// CHECK-NEXT:   }
29// CHECK-NEXT:   Symbol {
30// CHECK-NEXT:     Name: .Labs
31// CHECK-NEXT:     Value:
32// CHECK-NEXT:     Size: 0
33// CHECK-NEXT:     Binding: Local
34// CHECK-NEXT:     Type: None
35// CHECK-NEXT:     Other: 0
36// CHECK-NEXT:     Section: Absolute
37// CHECK-NEXT:   }
38// CHECK-NEXT:   Symbol {
39// CHECK-NEXT:     Name: abs
40// CHECK-NEXT:     Value:
41// CHECK-NEXT:     Size: 0
42// CHECK-NEXT:     Binding: Local
43// CHECK-NEXT:     Type: None
44// CHECK-NEXT:     Other: 0
45// CHECK-NEXT:     Section: Absolute
46// CHECK-NEXT:   }
47// CHECK-NEXT:   Symbol {
48// CHECK-NEXT:     Name: blah
49// CHECK-NEXT:     Value:
50// CHECK-NEXT:     Size: 0
51// CHECK-NEXT:     Binding: Local
52// CHECK-NEXT:     Type: None
53// CHECK-NEXT:     Other: 0
54// CHECK-NEXT:     Section: .text
55// CHECK-NEXT:   }
56// CHECK-NEXT:   Symbol {
57// CHECK-NEXT:     Name: foo
58// CHECK-NEXT:     Value:
59// CHECK-NEXT:     Size: 0
60// CHECK-NEXT:     Binding: Local
61// CHECK-NEXT:     Type: None
62// CHECK-NEXT:     Other: 0
63// CHECK-NEXT:     Section: .text
64// CHECK-NEXT:   }
65// CHECK-NEXT:   Symbol {
66// CHECK-NEXT:     Name: goo
67// CHECK-NEXT:     Value:
68// CHECK-NEXT:     Size: 0
69// CHECK-NEXT:     Binding: Local
70// CHECK-NEXT:     Type: None
71// CHECK-NEXT:     Other: 0
72// CHECK-NEXT:     Section: .text
73// CHECK-NEXT:   }
74// CHECK-NEXT:   Symbol {
75// CHECK-NEXT:     Name: _start
76// CHECK-NEXT:     Value:
77// CHECK-NEXT:     Size: 0
78// CHECK-NEXT:     Binding: Global
79// CHECK-NEXT:     Type: None
80// CHECK-NEXT:     Other: 0
81// CHECK-NEXT:     Section: .text
82// CHECK-NEXT:   }
83// CHECK-NEXT: ]
84
85.global _start
86_start:
87
88blah:
89foo:
90goo:
91abs = 42
92.Labs = 43
93