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