brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 218f43c Raw
38 lines · plain
1# REQUIRES: x862# RUN: echo 'v1 { f; }; v2 { g; };' > %t.ver3# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o4# RUN: ld.lld -shared --version-script %t.ver %t.o -o %t.so5 6# RUN: ld.lld --version-script %t.ver %t.o %t.so -o /dev/null -y f@v1 | \7# RUN:   FileCheck --check-prefix=TRACE %s --implicit-check-not=f@v18 9## TRACE:      {{.*}}.o: definition of f@v110## TRACE-NEXT: {{.*}}.so: shared definition of f@v111 12# RUN: echo '.symver f,f@v1; .symver g,g@v2; call f; call g' | \13# RUN:   llvm-mc -filetype=obj -triple=x86_64 - -o %t1.o14# RUN: ld.lld -shared %t1.o %t.so -o %t1.so15 16## Test that we can parse SHT_GNU_verneed to know that the undefined symbols in17## %t1.so are called 'f@v1' and 'g@v2', which can be satisfied by the executable.18## We will thus export the symbols.19# RUN: ld.lld -pie %t.o %t1.so -o %t20# RUN: llvm-nm -D %t | FileCheck --check-prefix=NM %s21 22# NM: T f23# NM: T g24 25## The default is --no-allow-shlib-undefined.26## Don't error because undefined symbols in %t1.so are satisfied by %t.so27# RUN: llvm-mc -filetype=obj -triple=x86_64 /dev/null -o %t2.o28# RUN: ld.lld %t2.o %t1.so %t.so -y f@v1 -o /dev/null | FileCheck %s29 30# CHECK:      {{.*}}1.so: reference to f@v131# CHECK-NEXT: {{.*}}.so: shared definition of f@v132 33.globl f_v1, g_v234.symver f_v1,f@v135.symver g_v2,g@v236f_v1:37g_v2:38