2017-01-20 17:45:36 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
|
|
|
|
# RUN: echo "SECTIONS { . = SIZEOF_HEADERS; pfoo = foo; pbar = bar; }" > %t.script
|
|
|
|
# RUN: ld.lld -o %t1 --script %t.script %t
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --symbols %t1 | FileCheck %s
|
2017-01-20 17:45:36 +08:00
|
|
|
|
|
|
|
# CHECK: Symbol {
|
|
|
|
# CHECK: Name: bar
|
2020-03-20 08:26:35 +08:00
|
|
|
# CHECK-NEXT: Value: [[BAR:.*]]
|
2017-01-20 17:45:36 +08:00
|
|
|
# CHECK-NEXT: Size: 4
|
|
|
|
# CHECK-NEXT: Binding: Global
|
|
|
|
# CHECK-NEXT: Type: Object
|
|
|
|
# CHECK-NEXT: Other: 0
|
|
|
|
# CHECK-NEXT: Section: .bss
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: Symbol {
|
|
|
|
# CHECK-NEXT: Name: foo
|
2020-03-20 08:26:35 +08:00
|
|
|
# CHECK-NEXT: Value: [[FOO:.*]]
|
2017-01-20 17:45:36 +08:00
|
|
|
# CHECK-NEXT: Size: 4
|
|
|
|
# CHECK-NEXT: Binding: Global
|
|
|
|
# CHECK-NEXT: Type: Object
|
|
|
|
# CHECK-NEXT: Other: 0
|
|
|
|
# CHECK-NEXT: Section: .bss
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: Symbol {
|
|
|
|
# CHECK-NEXT: Name: pfoo
|
2020-03-20 08:26:35 +08:00
|
|
|
# CHECK-NEXT: Value: [[FOO]]
|
2017-01-20 17:45:36 +08:00
|
|
|
# CHECK-NEXT: Size: 0
|
|
|
|
# CHECK-NEXT: Binding: Global
|
2020-08-21 07:05:27 +08:00
|
|
|
# CHECK-NEXT: Type: Object
|
2017-01-20 17:45:36 +08:00
|
|
|
# CHECK-NEXT: Other: 0
|
|
|
|
# CHECK-NEXT: Section: .bss
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: Symbol {
|
|
|
|
# CHECK-NEXT: Name: pbar
|
2020-03-20 08:26:35 +08:00
|
|
|
# CHECK-NEXT: Value: [[BAR]]
|
2017-01-20 17:45:36 +08:00
|
|
|
# CHECK-NEXT: Size: 0
|
|
|
|
# CHECK-NEXT: Binding: Global
|
2020-08-21 07:05:27 +08:00
|
|
|
# CHECK-NEXT: Type: Object
|
2017-01-20 17:45:36 +08:00
|
|
|
# CHECK-NEXT: Other: 0
|
|
|
|
# CHECK-NEXT: Section: .bss
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
|
|
|
|
.comm foo,4,4
|
|
|
|
.comm bar,4,4
|
|
|
|
movl $1, foo(%rip)
|
|
|
|
movl $2, bar(%rip)
|