1// REQUIRES: x86
2// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3// RUN: ld.lld %t.o -o %t --gc-sections
4// RUN: llvm-readobj --symbols %t | FileCheck %s
5
6// CHECK:      Symbols [
7// CHECK-NEXT:   Symbol {
8// CHECK-NEXT:     Name:  (0)
9// CHECK-NEXT:     Value: 0x0
10// CHECK-NEXT:     Size: 0
11// CHECK-NEXT:     Binding: Local (0x0)
12// CHECK-NEXT:     Type: None (0x0)
13// CHECK-NEXT:     Other: 0
14// CHECK-NEXT:     Section: Undefined (0x0)
15// CHECK-NEXT:   }
16// CHECK-NEXT:   Symbol {
17// CHECK-NEXT:     Name: s3
18// CHECK-NEXT:     Value: 0x200120
19// CHECK-NEXT:     Size: 0
20// CHECK-NEXT:     Binding: Local (0x0)
21// CHECK-NEXT:     Type: Object (0x1)
22// CHECK-NEXT:     Other: 0
23// CHECK-NEXT:     Section: .rodata (0x1)
24// CHECK-NEXT:   }
25// CHECK-NEXT:   Symbol {
26// CHECK-NEXT:     Name: s1
27// CHECK-NEXT:     Value: 0x200125
28// CHECK-NEXT:     Size: 0
29// CHECK-NEXT:     Binding: Local (0x0)
30// CHECK-NEXT:     Type: Object (0x1)
31// CHECK-NEXT:     Other [ (0x2)
32// CHECK-NEXT:       STV_HIDDEN (0x2)
33// CHECK-NEXT:     ]
34// CHECK-NEXT:     Section: .rodata (0x1)
35// CHECK-NEXT:   }
36// CHECK-NEXT:   Symbol {
37// CHECK-NEXT:     Name: _start
38// CHECK-NEXT:     Value:
39// CHECK-NEXT:     Size: 0
40// CHECK-NEXT:     Binding: Global (0x1)
41// CHECK-NEXT:     Type: Function (0x2)
42// CHECK-NEXT:     Other: 0
43// CHECK-NEXT:     Section: .text (0x2)
44// CHECK-NEXT:   }
45// CHECK-NEXT: ]
46
47.text
48.globl _start
49.type _start,@function
50_start:
51movl $s1, %eax
52movl $s3, %eax
53
54.hidden s1
55.type s1,@object
56.section .rodata.str1.1,"aMS",@progbits,1
57.globl s1
58s1:
59.asciz "abcd"
60
61.hidden s2
62.type s2,@object
63.globl s2
64s2:
65.asciz "efgh"
66
67.type s3,@object
68s3:
69.asciz "ijkl"
70
71.type s4,@object
72.globl s4
73s4:
74.asciz "mnop"
75