• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -s -t -sd | FileCheck %s
2
3// Test that we produce the group sections and that they are before the members
4
5// CHECK:        Section {
6// CHECK:          Index: 3
7// CHECK-NEXT:     Name: .group
8// CHECK-NEXT:     Type: SHT_GROUP
9// CHECK-NEXT:     Flags [
10// CHECK-NEXT:     ]
11// CHECK-NEXT:     Address: 0x0
12// CHECK-NEXT:     Offset:
13// CHECK-NEXT:     Size: 12
14// CHECK-NEXT:     Link:
15// CHECK-NEXT:     Info: 1
16// CHECK-NEXT:     AddressAlignment: 4
17// CHECK-NEXT:     EntrySize: 4
18// CHECK-NEXT:     SectionData (
19// CHECK-NEXT:       0000:    01000000 04000000 05000000
20// CHECK-NEXT:     )
21// CHECK-NEXT:   }
22// CHECK:        Section {
23// CHECK:          Index: 6
24// CHECK-NEXT:     Name: .group
25// CHECK-NEXT:     Type: SHT_GROUP
26// CHECK-NEXT:     Flags [
27// CHECK-NEXT:     ]
28// CHECK-NEXT:     Address: 0x0
29// CHECK-NEXT:     Offset:
30// CHECK-NEXT:     Size: 8
31// CHECK-NEXT:     Link:
32// CHECK-NEXT:     Info: 2
33// CHECK-NEXT:     AddressAlignment: 4
34// CHECK-NEXT:     EntrySize: 4
35// CHECK-NEXT:     SectionData (
36// CHECK-NEXT:       0000:    01000000 07000000
37// CHECK-NEXT:     )
38// CHECK-NEXT:   }
39// CHECK:        Section {
40// CHECK:          Index: 8
41// CHECK-NEXT:     Name: .group
42// CHECK-NEXT:     Type: SHT_GROUP
43// CHECK-NEXT:     Flags [
44// CHECK-NEXT:     ]
45// CHECK-NEXT:     Address: 0x0
46// CHECK-NEXT:     Offset:
47// CHECK-NEXT:     Size: 12
48// CHECK-NEXT:     Link:
49// CHECK-NEXT:     Info: 3
50// CHECK-NEXT:     AddressAlignment: 4
51// CHECK-NEXT:     EntrySize: 4
52// CHECK-NEXT:     SectionData (
53// CHECK-NEXT:       0000:    01000000 09000000 0A000000
54// CHECK-NEXT:     )
55// CHECK-NEXT:   }
56
57// Test that g1 and g2 are local, but g3 is an undefined global.
58
59// CHECK:        Symbol {
60// CHECK:          Name: g1
61// CHECK-NEXT:     Value: 0x0
62// CHECK-NEXT:     Size: 0
63// CHECK-NEXT:     Binding: Local
64// CHECK-NEXT:     Type: None
65// CHECK-NEXT:     Other: 0
66// CHECK-NEXT:     Section: .foo
67// CHECK-NEXT:   }
68// CHECK-NEXT:   Symbol {
69// CHECK-NEXT:     Name: g2
70// CHECK-NEXT:     Value: 0x0
71// CHECK-NEXT:     Size: 0
72// CHECK-NEXT:     Binding: Local
73// CHECK-NEXT:     Type: None
74// CHECK-NEXT:     Other: 0
75// CHECK-NEXT:     Section: .group
76// CHECK-NEXT:   }
77
78// CHECK:        Symbol {
79// CHECK:          Name: g3
80// CHECK-NEXT:     Value: 0x0
81// CHECK-NEXT:     Size: 0
82// CHECK-NEXT:     Binding: Global
83// CHECK-NEXT:     Type: None
84// CHECK-NEXT:     Other: 0
85// CHECK-NEXT:     Section: Undefined (0x0)
86// CHECK-NEXT:   }
87
88
89	.section	.foo,"axG",@progbits,g1,comdat
90g1:
91        nop
92
93        .section	.bar,"ax?",@progbits
94        nop
95
96        .section	.zed,"axG",@progbits,g2,comdat
97        nop
98
99        .section	.baz,"axG",@progbits,g3,comdat
100        .long g3
101