49 lines · plain
1# REQUIRES: x862 3# RUN: rm -rf %t.dir4# RUN: split-file %s %t.dir5# RUN: cd %t.dir6 7## Verify that in the following case:8##9## <exec>10## +- ref.so (weak reference to foo)11## +- wrap.so (non-weak reference to foo)12## +- def.so (defines foo)13##14## we don't report that foo is undefined in ref.so when linking <exec>.15 16# RUN: llvm-mc -filetype=obj -triple=x86_64 ref.s -o ref.o17# RUN: llvm-mc -filetype=obj -triple=x86_64 wrap.s -o wrap.o18# RUN: llvm-mc -filetype=obj -triple=x86_64 def.s -o def.o19# RUN: ld.lld -shared ref.o -o ref.so20# RUN: ld.lld -shared def.o -soname def.so -o def.so21# RUN: ld.lld -shared wrap.o def.so -o wrap.so22 23# RUN: llvm-mc -filetype=obj -triple=x86_64 start.s -o start.o24# RUN: ld.lld --no-allow-shlib-undefined start.o wrap.so ref.so 2>&1 | count 025 26#--- start.s27.globl _start28_start:29 callq wrap_get_foo@PLT30 31#--- ref.s32.weak foo33.globl ref_get_foo34ref_get_foo:35 movq foo@GOTPCREL(%rip), %rax36 retq37 38#--- wrap.s39.globl wrap_get_foo40wrap_get_foo:41 movq foo@GOTPCREL(%rip), %rax42 retq43 44#--- def.s45.data46.globl foo47foo:48 .long 049