2018-06-06 21:56:51 +08:00
|
|
|
# REQUIRES: x86
|
2016-04-24 10:31:02 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
|
|
|
|
# RUN: echo "{ local: *; };" > %t.script
|
|
|
|
# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
|
|
|
|
# RUN: llvm-readobj -dyn-symbols %t.so | FileCheck %s
|
|
|
|
|
|
|
|
# CHECK: DynamicSymbols [
|
|
|
|
# CHECK-NEXT: Symbol {
|
2019-01-08 18:50:59 +08:00
|
|
|
# CHECK-NEXT: Name:
|
2016-04-24 10:31:02 +08:00
|
|
|
# CHECK-NEXT: Value: 0x0
|
|
|
|
# CHECK-NEXT: Size: 0
|
|
|
|
# CHECK-NEXT: Binding: Local (0x0)
|
|
|
|
# CHECK-NEXT: Type: None (0x0)
|
|
|
|
# CHECK-NEXT: Other: 0
|
|
|
|
# CHECK-NEXT: Section: Undefined (0x0)
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: Symbol {
|
2019-01-08 18:50:59 +08:00
|
|
|
# CHECK-NEXT: Name: bar
|
2016-04-24 10:31:02 +08:00
|
|
|
# CHECK-NEXT: Value: 0x0
|
|
|
|
# CHECK-NEXT: Size: 0
|
|
|
|
# CHECK-NEXT: Binding: Weak (0x2)
|
|
|
|
# CHECK-NEXT: Type: None (0x0)
|
|
|
|
# CHECK-NEXT: Other: 0
|
|
|
|
# CHECK-NEXT: Section: Undefined (0x0)
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: Symbol {
|
2019-01-08 18:50:59 +08:00
|
|
|
# CHECK-NEXT: Name: foo
|
2016-04-24 10:31:02 +08:00
|
|
|
# CHECK-NEXT: Value: 0x0
|
|
|
|
# CHECK-NEXT: Size: 0
|
|
|
|
# CHECK-NEXT: Binding: Global (0x1)
|
|
|
|
# CHECK-NEXT: Type: None (0x0)
|
|
|
|
# CHECK-NEXT: Other: 0
|
|
|
|
# CHECK-NEXT: Section: Undefined (0x0)
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
|
|
|
|
.global foo
|
|
|
|
.weak bar
|
2017-11-24 14:42:32 +08:00
|
|
|
.data
|
|
|
|
.dc.a foo
|
|
|
|
.dc.a bar
|