2017-12-01 06:29:14 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/provide-shared.s -o %t2.o
|
|
|
|
# RUN: ld.lld %t2.o -o %t2.so -shared
|
|
|
|
# RUN: echo "SECTIONS { . = . + SIZEOF_HEADERS; PROVIDE(foo = 42);}" > %t.script
|
|
|
|
# RUN: ld.lld -o %t --script %t.script %t.o %t2.so
|
2020-03-05 00:17:35 +08:00
|
|
|
# RUN: llvm-readelf -s %t | FileCheck %s
|
2017-12-01 06:29:14 +08:00
|
|
|
|
2020-03-05 00:17:35 +08:00
|
|
|
# CHECK: 000000000000002a 0 NOTYPE GLOBAL DEFAULT ABS foo
|
2017-12-01 06:29:14 +08:00
|
|
|
|
|
|
|
.global _start
|
|
|
|
_start:
|
|
|
|
.quad foo
|