2013-04-12 12:06:46 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -s -t | FileCheck %s
|
2010-11-12 02:13:52 +08:00
|
|
|
|
2014-08-30 05:53:01 +08:00
|
|
|
// Test that we produce the group sections and that they are at the beginning
|
2010-11-12 02:13:52 +08:00
|
|
|
// of the file.
|
|
|
|
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK: Section {
|
2015-04-30 04:25:24 +08:00
|
|
|
// CHECK: Index: 2
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Name: .group
|
|
|
|
// CHECK-NEXT: Type: SHT_GROUP
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
2015-04-30 21:57:06 +08:00
|
|
|
// CHECK-NEXT: Offset:
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Size: 12
|
2015-04-30 04:25:24 +08:00
|
|
|
// CHECK-NEXT: Link:
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Info: 1
|
|
|
|
// CHECK-NEXT: AddressAlignment: 4
|
|
|
|
// CHECK-NEXT: EntrySize: 4
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Section {
|
2015-04-30 04:25:24 +08:00
|
|
|
// CHECK-NEXT: Index: 3
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Name: .group
|
|
|
|
// CHECK-NEXT: Type: SHT_GROUP
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
2015-04-30 21:57:06 +08:00
|
|
|
// CHECK-NEXT: Offset:
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Size: 8
|
2015-04-30 04:25:24 +08:00
|
|
|
// CHECK-NEXT: Link:
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Info: 2
|
|
|
|
// CHECK-NEXT: AddressAlignment: 4
|
|
|
|
// CHECK-NEXT: EntrySize: 4
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Section {
|
2015-04-30 04:25:24 +08:00
|
|
|
// CHECK-NEXT: Index: 4
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Name: .group
|
|
|
|
// CHECK-NEXT: Type: SHT_GROUP
|
|
|
|
// CHECK-NEXT: Flags [
|
|
|
|
// CHECK-NEXT: ]
|
|
|
|
// CHECK-NEXT: Address: 0x0
|
2015-04-30 21:57:06 +08:00
|
|
|
// CHECK-NEXT: Offset:
|
2013-07-11 04:58:17 +08:00
|
|
|
// CHECK-NEXT: Size: 12
|
2015-04-30 04:25:24 +08:00
|
|
|
// CHECK-NEXT: Link:
|
2014-10-17 09:48:58 +08:00
|
|
|
// CHECK-NEXT: Info: 10
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: AddressAlignment: 4
|
|
|
|
// CHECK-NEXT: EntrySize: 4
|
|
|
|
// CHECK-NEXT: }
|
2010-11-14 12:17:37 +08:00
|
|
|
|
|
|
|
// Test that g1 and g2 are local, but g3 is an undefined global.
|
|
|
|
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK: Symbol {
|
2014-05-01 00:25:02 +08:00
|
|
|
// CHECK: Name: g1
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Value: 0x0
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Local
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
2015-04-30 04:25:24 +08:00
|
|
|
// CHECK-NEXT: Section: .foo
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: Symbol {
|
2014-05-01 00:25:02 +08:00
|
|
|
// CHECK-NEXT: Name: g2
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Value: 0x0
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Local
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
2015-04-30 04:25:24 +08:00
|
|
|
// CHECK-NEXT: Section: .group (0x3)
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: }
|
2010-11-14 12:17:37 +08:00
|
|
|
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK: Symbol {
|
2014-05-01 00:25:02 +08:00
|
|
|
// CHECK: Name: g3
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: Value: 0x0
|
|
|
|
// CHECK-NEXT: Size: 0
|
|
|
|
// CHECK-NEXT: Binding: Global
|
|
|
|
// CHECK-NEXT: Type: None
|
|
|
|
// CHECK-NEXT: Other: 0
|
2014-03-24 13:00:34 +08:00
|
|
|
// CHECK-NEXT: Section: Undefined (0x0)
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: }
|
2010-11-14 12:17:37 +08:00
|
|
|
|
2010-11-12 02:13:52 +08:00
|
|
|
|
|
|
|
.section .foo,"axG",@progbits,g1,comdat
|
|
|
|
g1:
|
|
|
|
nop
|
|
|
|
|
2013-09-16 03:24:16 +08:00
|
|
|
.section .bar,"ax?",@progbits
|
2010-11-12 02:13:52 +08:00
|
|
|
nop
|
|
|
|
|
|
|
|
.section .zed,"axG",@progbits,g2,comdat
|
|
|
|
nop
|
2010-11-14 12:17:37 +08:00
|
|
|
|
|
|
|
.section .baz,"axG",@progbits,g3,comdat
|
|
|
|
.long g3
|