2017-07-12 19:09:46 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
|
2019-09-06 23:10:31 +08:00
|
|
|
## An weak undefined symbol does not fetch the lazy definition.
|
|
|
|
## Version scripts do not affect undefined symbols.
|
|
|
|
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
|
|
|
|
# RUN: echo '.globl foo; foo:' | llvm-mc -filetype=obj -triple=x86_64 - -o %t1.o
|
2017-07-12 19:09:46 +08:00
|
|
|
# RUN: echo "{ local: *; };" > %t.script
|
2019-09-06 23:10:31 +08:00
|
|
|
# RUN: ld.lld -shared --version-script %t.script %t.o --start-lib %t1.o --end-lib -o %t.so
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --dyn-syms -r %t.so | FileCheck %s
|
2017-07-12 19:09:46 +08:00
|
|
|
|
|
|
|
# CHECK: Relocations [
|
|
|
|
# CHECK-NEXT: Section ({{.*}}) .rela.plt {
|
2019-09-06 23:10:31 +08:00
|
|
|
# CHECK-NEXT: R_X86_64_JUMP_SLOT foo
|
2017-07-12 19:09:46 +08:00
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK: Symbol {
|
2019-01-08 18:50:59 +08:00
|
|
|
# CHECK: Name: foo
|
2017-07-12 19:09:46 +08:00
|
|
|
# CHECK-NEXT: Value: 0x0
|
|
|
|
# CHECK-NEXT: Size: 0
|
|
|
|
# CHECK-NEXT: Binding: Weak
|
|
|
|
# CHECK-NEXT: Type: None
|
|
|
|
# CHECK-NEXT: Other: 0
|
|
|
|
# CHECK-NEXT: Section: Undefined
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
|
|
|
|
.text
|
|
|
|
callq foo@PLT
|
|
|
|
.weak foo
|