2019-09-06 23:10:31 +08:00
|
|
|
# REQUIRES: x86
|
2017-10-31 01:26:12 +08:00
|
|
|
|
2019-09-06 23:10:31 +08:00
|
|
|
## Test SHN_ABS symbols are not copy relocated.
|
2017-10-31 01:26:12 +08:00
|
|
|
|
2019-09-06 23:10:31 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64 %p/Inputs/copy-rel-abs.s -o %t1.o
|
|
|
|
# RUN: ld.lld -shared %t1.o -o %t1.so
|
|
|
|
# RUN: llvm-readelf --dyn-syms %t1.so | FileCheck --check-prefix=SYMS %s
|
2017-10-31 01:26:12 +08:00
|
|
|
|
2019-09-06 23:10:31 +08:00
|
|
|
# SYMS: [[ADDR:[0-9a-f]+]] {{.*}} 5 bar
|
|
|
|
# SYMS: [[ADDR]] {{.*}} 5 foo
|
|
|
|
# SYMS: [[ADDR]] {{.*}} ABS zed
|
|
|
|
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t2.o
|
|
|
|
# RUN: ld.lld %t2.o %t1.so -o %t2
|
2019-09-20 04:44:12 +08:00
|
|
|
# RUN: llvm-objdump -t %t2 | FileCheck %s
|
2019-09-06 23:10:31 +08:00
|
|
|
|
|
|
|
# CHECK: SYMBOL TABLE:
|
2019-09-20 04:44:12 +08:00
|
|
|
# CHECK-NOT: zed
|
2019-09-06 23:10:31 +08:00
|
|
|
# CHECK: .bss.rel.ro {{.*}} foo
|
2019-09-20 04:44:12 +08:00
|
|
|
# CHECK-NOT: zed
|
2019-09-06 23:10:31 +08:00
|
|
|
# CHECK: .bss.rel.ro {{.*}} bar
|
2019-09-20 04:44:12 +08:00
|
|
|
# CHECK-NOT: zed
|
2017-10-31 01:26:12 +08:00
|
|
|
|
|
|
|
.global _start
|
|
|
|
_start:
|
|
|
|
.quad foo
|