1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
3# RUN: echo "SECTIONS { . = SIZEOF_HEADERS; .common : { *(COMMON) } }" > %t.script
4# RUN: ld.lld -o %t1 --script %t.script %t
5# RUN: llvm-readobj -S --symbols %t1 | FileCheck %s
6
7# CHECK:       Section {
8# CHECK:         Index:
9# CHECK:         Name: .common
10# CHECK-NEXT:    Type: SHT_NOBITS
11# CHECK-NEXT:    Flags [
12# CHECK-NEXT:      SHF_ALLOC
13# CHECK-NEXT:      SHF_WRITE
14# CHECK-NEXT:    ]
15# CHECK-NEXT:    Address: 0x200
16# CHECK-NEXT:    Offset: 0x
17# CHECK-NEXT:    Size: 384
18# CHECK-NEXT:    Link: 0
19# CHECK-NEXT:    Info: 0
20# CHECK-NEXT:    AddressAlignment: 256
21# CHECK-NEXT:    EntrySize: 0
22# CHECK-NEXT:  }
23# CHECK:       Symbol {
24# CHECK:         Name: q1
25# CHECK-NEXT:    Value: 0x200
26# CHECK-NEXT:    Size: 128
27# CHECK-NEXT:    Binding: Global
28# CHECK-NEXT:    Type: Object
29# CHECK-NEXT:    Other: 0
30# CHECK-NEXT:    Section: .common
31# CHECK-NEXT:  }
32# CHECK-NEXT:  Symbol {
33# CHECK-NEXT:    Name: q2
34# CHECK-NEXT:    Value: 0x300
35# CHECK-NEXT:    Size: 128
36# CHECK-NEXT:    Binding: Global
37# CHECK-NEXT:    Type: Object
38# CHECK-NEXT:    Other: 0
39# CHECK-NEXT:    Section: .common
40# CHECK-NEXT:  }
41
42.globl _start
43_start:
44  jmp _start
45
46.comm q1,128,8
47.comm q2,128,256
48