2021-03-13 06:26:11 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
|
2021-05-09 02:42:15 +08:00
|
|
|
# RUN: rm -rf %t; split-file %s %t
|
2021-03-13 06:26:11 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/bar.s -o %t/bar.o
|
|
|
|
# RUN: %lld -dylib %t/bar.o -o %t/libbar.dylib
|
|
|
|
# RUN: not %lld -lSystem -o /dev/null %t/libbar.dylib %t/test.o 2>&1 | FileCheck %s
|
|
|
|
|
2021-03-13 07:43:33 +08:00
|
|
|
# CHECK: error: relocation UNSIGNED is out of range: [[#]] is not in [0, 4294967295]; references _foo
|
|
|
|
# CHECK: error: relocation GOT_LOAD is out of range: [[#]] is not in [-2147483648, 2147483647]; references _foo
|
|
|
|
# CHECK: error: stub is out of range: [[#]] is not in [-2147483648, 2147483647]; references _bar
|
|
|
|
# CHECK: error: stub helper header is out of range: [[#]] is not in [-2147483648, 2147483647]
|
|
|
|
# CHECK: error: stub helper header is out of range: [[#]] is not in [-2147483648, 2147483647]
|
2021-03-13 06:26:11 +08:00
|
|
|
|
|
|
|
#--- bar.s
|
|
|
|
.globl _bar
|
|
|
|
_bar:
|
|
|
|
|
|
|
|
#--- test.s
|
|
|
|
.globl _main, _foo
|
|
|
|
|
|
|
|
_main:
|
|
|
|
movq _foo@GOTPCREL(%rip), %rax
|
|
|
|
callq _bar
|
|
|
|
ret
|
|
|
|
|
|
|
|
.int _foo
|
|
|
|
.zerofill __TEXT,bss,_zero,0xffffffff
|
|
|
|
|
|
|
|
.data
|
|
|
|
_foo:
|
|
|
|
.space 0
|