1// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -s | FileCheck %s 2 3// Test that like gnu as we create text, data and bss by default. Also test 4// that shstrtab, symtab and strtab are listed in that order. 5 6// CHECK: Section { 7// CHECK: Name: .text 8// CHECK-NEXT: Type: SHT_PROGBITS 9// CHECK-NEXT: Flags [ 10// CHECK-NEXT: SHF_ALLOC 11// CHECK-NEXT: SHF_EXECINSTR 12// CHECK-NEXT: ] 13// CHECK-NEXT: Address: 0x0 14// CHECK-NEXT: Offset: 0x40 15// CHECK-NEXT: Size: 0 16// CHECK-NEXT: Link: 0 17// CHECK-NEXT: Info: 0 18// CHECK-NEXT: AddressAlignment: 4 19// CHECK-NEXT: EntrySize: 0 20// CHECK-NEXT: } 21// CHECK: Section { 22// CHECK: Name: .data 23// CHECK-NEXT: Type: SHT_PROGBITS 24// CHECK-NEXT: Flags [ 25// CHECK-NEXT: SHF_ALLOC 26// CHECK-NEXT: SHF_WRITE 27// CHECK-NEXT: ] 28// CHECK-NEXT: Address: 0x0 29// CHECK-NEXT: Offset: 0x40 30// CHECK-NEXT: Size: 0 31// CHECK-NEXT: Link: 0 32// CHECK-NEXT: Info: 0 33// CHECK-NEXT: AddressAlignment: 4 34// CHECK-NEXT: EntrySize: 0 35// CHECK-NEXT: } 36// CHECK: Section { 37// CHECK: Name: .bss 38// CHECK-NEXT: Type: SHT_NOBITS 39// CHECK-NEXT: Flags [ 40// CHECK-NEXT: SHF_ALLOC 41// CHECK-NEXT: SHF_WRITE 42// CHECK-NEXT: ] 43// CHECK-NEXT: Address: 0x0 44// CHECK-NEXT: Offset: 0x40 45// CHECK-NEXT: Size: 0 46// CHECK-NEXT: Link: 0 47// CHECK-NEXT: Info: 0 48// CHECK-NEXT: AddressAlignment: 4 49// CHECK-NEXT: EntrySize: 0 50// CHECK-NEXT: } 51// CHECK: Section { 52// CHECK: Name: .shstrtab 53// CHECK-NEXT: Type: SHT_STRTAB 54// CHECK-NEXT: Flags [ 55// CHECK-NEXT: ] 56// CHECK-NEXT: Address: 0x0 57// CHECK-NEXT: Offset: 0x40 58// CHECK-NEXT: Size: 44 59// CHECK-NEXT: Link: 0 60// CHECK-NEXT: Info: 0 61// CHECK-NEXT: AddressAlignment: 1 62// CHECK-NEXT: EntrySize: 0 63// CHECK-NEXT: } 64// CHECK: Section { 65// CHECK: Name: .symtab 66// CHECK-NEXT: Type: SHT_SYMTAB 67// CHECK-NEXT: Flags [ 68// CHECK-NEXT: ] 69// CHECK-NEXT: Address: 0x0 70// CHECK-NEXT: Offset: 71// CHECK-NEXT: Size: 96 72// CHECK-NEXT: Link: 6 73// CHECK-NEXT: Info: 4 74// CHECK-NEXT: AddressAlignment: 8 75// CHECK-NEXT: EntrySize: 24 76// CHECK-NEXT: } 77// CHECK: Section { 78// CHECK: Name: .strtab 79// CHECK-NEXT: Type: SHT_STRTAB 80// CHECK-NEXT: Flags [ 81// CHECK-NEXT: ] 82// CHECK-NEXT: Address: 0x0 83// CHECK-NEXT: Offset: 84// CHECK-NEXT: Size: 1 85// CHECK-NEXT: Link: 0 86// CHECK-NEXT: Info: 0 87// CHECK-NEXT: AddressAlignment: 1 88// CHECK-NEXT: EntrySize: 0 89// CHECK-NEXT: } 90