2016-07-29 03:24:13 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
|
2016-09-30 08:06:24 +08:00
|
|
|
# RUN: echo "SECTIONS { . = SIZEOF_HEADERS; .common : { *(COMMON) } }" > %t.script
|
2016-07-29 03:24:13 +08:00
|
|
|
# RUN: ld.lld -o %t1 --script %t.script %t
|
|
|
|
# RUN: llvm-readobj -s -t %t1 | FileCheck %s
|
|
|
|
|
|
|
|
# CHECK: Section {
|
2016-09-21 04:48:54 +08:00
|
|
|
# CHECK: Index:
|
|
|
|
# CHECK: Name: .common
|
|
|
|
# CHECK-NEXT: Type: SHT_NOBITS
|
|
|
|
# CHECK-NEXT: Flags [
|
|
|
|
# CHECK-NEXT: SHF_ALLOC
|
|
|
|
# CHECK-NEXT: SHF_WRITE
|
2016-07-29 03:24:13 +08:00
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Address: 0x200
|
2016-09-21 04:48:54 +08:00
|
|
|
# CHECK-NEXT: Offset: 0x
|
2017-09-09 00:22:43 +08:00
|
|
|
# CHECK-NEXT: Size: 384
|
2016-07-29 03:24:13 +08:00
|
|
|
# CHECK-NEXT: Link: 0
|
|
|
|
# CHECK-NEXT: Info: 0
|
|
|
|
# CHECK-NEXT: AddressAlignment: 256
|
|
|
|
# CHECK-NEXT: EntrySize: 0
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK: Symbol {
|
2016-09-21 04:48:54 +08:00
|
|
|
# CHECK: Name: q1
|
2017-09-09 00:22:43 +08:00
|
|
|
# CHECK-NEXT: Value: 0x200
|
2016-07-29 03:24:13 +08:00
|
|
|
# CHECK-NEXT: Size: 128
|
2016-09-21 04:48:54 +08:00
|
|
|
# CHECK-NEXT: Binding: Global
|
|
|
|
# CHECK-NEXT: Type: Object
|
2016-07-29 03:24:13 +08:00
|
|
|
# CHECK-NEXT: Other: 0
|
2016-09-21 04:48:54 +08:00
|
|
|
# CHECK-NEXT: Section: .common
|
2016-07-29 03:24:13 +08:00
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: Symbol {
|
2016-09-21 04:48:54 +08:00
|
|
|
# CHECK-NEXT: Name: q2
|
2017-09-09 00:22:43 +08:00
|
|
|
# CHECK-NEXT: Value: 0x300
|
2016-07-29 03:24:13 +08:00
|
|
|
# CHECK-NEXT: Size: 128
|
2016-09-21 04:48:54 +08:00
|
|
|
# CHECK-NEXT: Binding: Global
|
|
|
|
# CHECK-NEXT: Type: Object
|
2016-07-29 03:24:13 +08:00
|
|
|
# CHECK-NEXT: Other: 0
|
2016-09-21 04:48:54 +08:00
|
|
|
# CHECK-NEXT: Section: .common
|
2016-07-29 03:24:13 +08:00
|
|
|
# CHECK-NEXT: }
|
|
|
|
|
|
|
|
.globl _start
|
|
|
|
_start:
|
|
|
|
jmp _start
|
|
|
|
|
|
|
|
.comm q1,128,8
|
|
|
|
.comm q2,128,256
|