2016-12-20 02:00:52 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
|
|
|
|
# RUN: echo "bar" > %t_retain.txt
|
|
|
|
# RUN: echo "foo" >> %t_retain.txt
|
2017-10-06 17:37:44 +08:00
|
|
|
# RUN: ld.lld --hash-style=sysv -shared --retain-symbols-file=%t_retain.txt %t -o %t2
|
2017-01-26 05:23:06 +08:00
|
|
|
# RUN: llvm-readobj --dyn-symbols %t2 | FileCheck %s
|
2016-12-20 02:00:52 +08:00
|
|
|
|
|
|
|
## Check separate form.
|
2017-10-06 17:37:44 +08:00
|
|
|
# RUN: ld.lld --hash-style=sysv -shared --retain-symbols-file %t_retain.txt %t -o %t2
|
2017-01-26 05:23:06 +08:00
|
|
|
# RUN: llvm-readobj --dyn-symbols %t2 | FileCheck %s
|
2016-12-20 02:00:52 +08:00
|
|
|
|
2017-01-26 05:23:06 +08:00
|
|
|
# CHECK: DynamicSymbols [
|
2016-12-20 02:00:52 +08:00
|
|
|
# CHECK-NEXT: Symbol {
|
2017-01-26 05:23:06 +08:00
|
|
|
# CHECK-NEXT: Name: @
|
2017-01-26 04:53:36 +08:00
|
|
|
# CHECK-NEXT: Value:
|
|
|
|
# CHECK-NEXT: Size:
|
|
|
|
# CHECK-NEXT: Binding:
|
|
|
|
# CHECK-NEXT: Type:
|
|
|
|
# CHECK-NEXT: Other:
|
|
|
|
# CHECK-NEXT: Section:
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: Symbol {
|
2016-12-20 02:00:52 +08:00
|
|
|
# CHECK-NEXT: Name: bar
|
2017-01-26 04:53:36 +08:00
|
|
|
# CHECK-NEXT: Value:
|
|
|
|
# CHECK-NEXT: Size:
|
|
|
|
# CHECK-NEXT: Binding: Global
|
|
|
|
# CHECK-NEXT: Type:
|
|
|
|
# CHECK-NEXT: Other:
|
|
|
|
# CHECK-NEXT: Section: .text
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: Symbol {
|
2016-12-20 02:00:52 +08:00
|
|
|
# CHECK-NEXT: Name: foo
|
2017-01-26 04:53:36 +08:00
|
|
|
# CHECK-NEXT: Value:
|
|
|
|
# CHECK-NEXT: Size:
|
|
|
|
# CHECK-NEXT: Binding: Global
|
|
|
|
# CHECK-NEXT: Type:
|
|
|
|
# CHECK-NEXT: Other:
|
|
|
|
# CHECK-NEXT: Section: .text
|
|
|
|
# CHECK-NEXT: }
|
2017-01-26 05:23:06 +08:00
|
|
|
# CHECK-NEXT: Symbol {
|
|
|
|
# CHECK-NEXT: Name: und
|
|
|
|
# CHECK-NEXT: Value:
|
|
|
|
# CHECK-NEXT: Size:
|
|
|
|
# CHECK-NEXT: Binding: Global
|
|
|
|
# CHECK-NEXT: Type:
|
|
|
|
# CHECK-NEXT: Other:
|
|
|
|
# CHECK-NEXT: Section: Undefined
|
|
|
|
# CHECK-NEXT: }
|
2017-01-26 04:53:36 +08:00
|
|
|
# CHECK-NEXT: ]
|
2016-12-20 02:00:52 +08:00
|
|
|
|
|
|
|
.text
|
|
|
|
.globl _start
|
|
|
|
_start:
|
|
|
|
call zed@PLT
|
|
|
|
call und@PLT
|
|
|
|
|
|
|
|
.globl foo
|
|
|
|
.type foo,@function
|
|
|
|
foo:
|
|
|
|
retq
|
|
|
|
|
|
|
|
.globl bar
|
|
|
|
.type bar,@function
|
|
|
|
bar:
|
|
|
|
retq
|
|
|
|
|
|
|
|
.globl zed
|
|
|
|
.type zed,@function
|
|
|
|
zed:
|
|
|
|
retq
|
|
|
|
|
|
|
|
.type loc,@function
|
|
|
|
loc:
|
|
|
|
retq
|