2016-09-07 17:59:29 +08:00
|
|
|
# REQUIRES: x86
|
2016-07-16 20:26:39 +08:00
|
|
|
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
|
|
|
|
# RUN: echo "LIBSAMPLE_1.0 { \
|
|
|
|
# RUN: global: \
|
2016-09-07 17:59:29 +08:00
|
|
|
# RUN: extern \"C++\" { \
|
|
|
|
# RUN: \"foo(int)\"; \
|
|
|
|
# RUN: \"zed(int)\"; \
|
2016-09-08 01:51:00 +08:00
|
|
|
# RUN: \"abc::abc()\"; \
|
2016-07-16 20:26:39 +08:00
|
|
|
# RUN: }; \
|
|
|
|
# RUN: }; \
|
|
|
|
# RUN: LIBSAMPLE_2.0 { \
|
|
|
|
# RUN: global: \
|
2016-09-07 17:59:29 +08:00
|
|
|
# RUN: extern \"C++\" { \
|
|
|
|
# RUN: \"bar(int)\"; \
|
2016-07-16 20:26:39 +08:00
|
|
|
# RUN: }; \
|
|
|
|
# RUN: }; " > %t.script
|
|
|
|
# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
|
|
|
|
# RUN: llvm-readobj -V -dyn-symbols %t.so | FileCheck --check-prefix=DSO %s
|
|
|
|
|
|
|
|
# DSO: DynamicSymbols [
|
|
|
|
# DSO-NEXT: Symbol {
|
|
|
|
# DSO-NEXT: Name: @
|
|
|
|
# DSO-NEXT: Value: 0x0
|
|
|
|
# DSO-NEXT: Size: 0
|
|
|
|
# DSO-NEXT: Binding: Local
|
|
|
|
# DSO-NEXT: Type: None
|
|
|
|
# DSO-NEXT: Other: 0
|
|
|
|
# DSO-NEXT: Section: Undefined
|
|
|
|
# DSO-NEXT: }
|
|
|
|
# DSO-NEXT: Symbol {
|
|
|
|
# DSO-NEXT: Name: _Z3bari@@LIBSAMPLE_2.0
|
|
|
|
# DSO-NEXT: Value: 0x1001
|
|
|
|
# DSO-NEXT: Size: 0
|
|
|
|
# DSO-NEXT: Binding: Global
|
|
|
|
# DSO-NEXT: Type: Function
|
|
|
|
# DSO-NEXT: Other: 0
|
|
|
|
# DSO-NEXT: Section: .text
|
|
|
|
# DSO-NEXT: }
|
|
|
|
# DSO-NEXT: Symbol {
|
|
|
|
# DSO-NEXT: Name: _Z3fooi@@LIBSAMPLE_1.0
|
|
|
|
# DSO-NEXT: Value: 0x1000
|
|
|
|
# DSO-NEXT: Size: 0
|
|
|
|
# DSO-NEXT: Binding: Global
|
|
|
|
# DSO-NEXT: Type: Function
|
|
|
|
# DSO-NEXT: Other: 0
|
|
|
|
# DSO-NEXT: Section: .text
|
|
|
|
# DSO-NEXT: }
|
|
|
|
# DSO-NEXT: Symbol {
|
|
|
|
# DSO-NEXT: Name: _Z3zedi@@LIBSAMPLE_1.0
|
|
|
|
# DSO-NEXT: Value: 0x1002
|
|
|
|
# DSO-NEXT: Size: 0
|
|
|
|
# DSO-NEXT: Binding: Global (0x1)
|
|
|
|
# DSO-NEXT: Type: Function (0x2)
|
|
|
|
# DSO-NEXT: Other: 0
|
|
|
|
# DSO-NEXT: Section: .text (0x6)
|
|
|
|
# DSO-NEXT: }
|
2016-09-08 01:51:00 +08:00
|
|
|
# DSO-NEXT: Symbol {
|
|
|
|
# DSO-NEXT: Name: _ZN3abcC1Ev@@LIBSAMPLE_1.0
|
|
|
|
# DSO-NEXT: Value: 0x1003
|
|
|
|
# DSO-NEXT: Size: 0
|
|
|
|
# DSO-NEXT: Binding: Global (0x1)
|
|
|
|
# DSO-NEXT: Type: Function (0x2)
|
|
|
|
# DSO-NEXT: Other: 0
|
|
|
|
# DSO-NEXT: Section: .text (0x6)
|
|
|
|
# DSO-NEXT: }
|
2016-09-15 20:44:38 +08:00
|
|
|
# DSO-NEXT: Symbol {
|
|
|
|
# DSO-NEXT: Name: _ZN3abcC2Ev@@LIBSAMPLE_1.0
|
|
|
|
# DSO-NEXT: Value: 0x1004
|
|
|
|
# DSO-NEXT: Size: 0
|
|
|
|
# DSO-NEXT: Binding: Global (0x1)
|
|
|
|
# DSO-NEXT: Type: Function (0x2)
|
|
|
|
# DSO-NEXT: Other: 0
|
|
|
|
# DSO-NEXT: Section: .text (0x6)
|
|
|
|
# DSO-NEXT: }
|
2016-07-16 20:26:39 +08:00
|
|
|
# DSO-NEXT: ]
|
|
|
|
# DSO-NEXT: Version symbols {
|
|
|
|
# DSO-NEXT: Section Name: .gnu.version
|
2016-09-15 20:44:38 +08:00
|
|
|
# DSO-NEXT: Address: 0x258
|
|
|
|
# DSO-NEXT: Offset: 0x258
|
2016-07-16 20:26:39 +08:00
|
|
|
# DSO-NEXT: Link: 1
|
|
|
|
# DSO-NEXT: Symbols [
|
|
|
|
# DSO-NEXT: Symbol {
|
|
|
|
# DSO-NEXT: Version: 0
|
|
|
|
# DSO-NEXT: Name: @
|
|
|
|
# DSO-NEXT: }
|
|
|
|
# DSO-NEXT: Symbol {
|
|
|
|
# DSO-NEXT: Version: 3
|
|
|
|
# DSO-NEXT: Name: _Z3bari@@LIBSAMPLE_2.0
|
|
|
|
# DSO-NEXT: }
|
|
|
|
# DSO-NEXT: Symbol {
|
|
|
|
# DSO-NEXT: Version: 2
|
|
|
|
# DSO-NEXT: Name: _Z3fooi@@LIBSAMPLE_1.0
|
|
|
|
# DSO-NEXT: }
|
|
|
|
# DSO-NEXT: Symbol {
|
|
|
|
# DSO-NEXT: Version: 2
|
|
|
|
# DSO-NEXT: Name: _Z3zedi@@LIBSAMPLE_1.0
|
|
|
|
# DSO-NEXT: }
|
2016-09-08 01:51:00 +08:00
|
|
|
# DSO-NEXT: Symbol {
|
|
|
|
# DSO-NEXT: Version: 2
|
|
|
|
# DSO-NEXT: Name: _ZN3abcC1Ev@@LIBSAMPLE_1.0
|
|
|
|
# DSO-NEXT: }
|
2016-09-15 20:44:38 +08:00
|
|
|
# DSO-NEXT: Symbol {
|
|
|
|
# DSO-NEXT: Version: 2
|
|
|
|
# DSO-NEXT: Name: _ZN3abcC2Ev@@LIBSAMPLE_1.0
|
|
|
|
# DSO-NEXT: }
|
2016-07-16 20:26:39 +08:00
|
|
|
# DSO-NEXT: ]
|
|
|
|
# DSO-NEXT: }
|
|
|
|
|
|
|
|
.text
|
|
|
|
.globl _Z3fooi
|
|
|
|
.type _Z3fooi,@function
|
|
|
|
_Z3fooi:
|
|
|
|
retq
|
|
|
|
|
|
|
|
.globl _Z3bari
|
|
|
|
.type _Z3bari,@function
|
|
|
|
_Z3bari:
|
|
|
|
retq
|
|
|
|
|
|
|
|
.globl _Z3zedi
|
|
|
|
.type _Z3zedi,@function
|
|
|
|
_Z3zedi:
|
|
|
|
retq
|
2016-09-08 01:51:00 +08:00
|
|
|
|
|
|
|
.globl _ZN3abcC1Ev
|
|
|
|
.type _ZN3abcC1Ev,@function
|
|
|
|
_ZN3abcC1Ev:
|
|
|
|
retq
|
2016-09-15 20:44:38 +08:00
|
|
|
|
|
|
|
.globl _ZN3abcC2Ev
|
|
|
|
.type _ZN3abcC2Ev,@function
|
|
|
|
_ZN3abcC2Ev:
|
|
|
|
retq
|