2015-04-30 22:21:49 +08:00
|
|
|
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -s -t -sd | FileCheck %s
|
2010-11-12 02:13:52 +08:00
|
|
|
|
2015-04-30 22:21:49 +08:00
|
|
|
// Test that we produce the group sections and that they are before the members
|
2010-11-12 02:13:52 +08:00
|
|
|
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK: Section {
|
2015-11-04 04:02:22 +08:00
|
|
|
// CHECK: 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: 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
|
2015-04-30 22:21:49 +08:00
|
|
|
// CHECK-NEXT: SectionData (
|
2015-11-04 04:02:22 +08:00
|
|
|
// CHECK-NEXT: 0000: 01000000 04000000 05000000
|
2015-04-30 22:21:49 +08:00
|
|
|
// CHECK-NEXT: )
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: }
|
2015-04-30 22:21:49 +08:00
|
|
|
// CHECK: Section {
|
2015-11-04 04:02:22 +08:00
|
|
|
// CHECK: Index: 6
|
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
|
2015-04-30 22:21:49 +08:00
|
|
|
// CHECK-NEXT: SectionData (
|
2015-11-04 04:02:22 +08:00
|
|
|
// CHECK-NEXT: 0000: 01000000 07000000
|
2015-04-30 22:21:49 +08:00
|
|
|
// CHECK-NEXT: )
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: }
|
2015-04-30 22:21:49 +08:00
|
|
|
// CHECK: Section {
|
2015-11-04 04:02:22 +08:00
|
|
|
// CHECK: Index: 8
|
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:
|
2015-06-04 23:33:30 +08:00
|
|
|
// CHECK-NEXT: Info: 3
|
2013-04-12 12:06:46 +08:00
|
|
|
// CHECK-NEXT: AddressAlignment: 4
|
|
|
|
// CHECK-NEXT: EntrySize: 4
|
2015-04-30 22:21:49 +08:00
|
|
|
// CHECK-NEXT: SectionData (
|
2015-11-04 04:02:22 +08:00
|
|
|
// CHECK-NEXT: 0000: 01000000 09000000 0A000000
|
2015-04-30 22:21:49 +08:00
|
|
|
// CHECK-NEXT: )
|
2013-04-12 12:06:46 +08:00
|
|
|
// 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-11-04 04:02:22 +08:00
|
|
|
// CHECK-NEXT: Section: .group
|
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
|