Index: test/ELF/Inputs/verneed.so.sh =================================================================== --- test/ELF/Inputs/verneed.so.sh +++ test/ELF/Inputs/verneed.so.sh @@ -1,58 +0,0 @@ -#!/bin/sh -eu - -# This script was used to produce the verneed{1,2}.so files. - -tmp=$(mktemp -d) - -echo "v1 {}; v2 {}; v3 {}; { local: *; };" > $tmp/verneed.script - -cat > $tmp/verneed1.s < $tmp/verneed2.s <@È@8@ @@@ààþþððððùüúýûøñÿñÿñÿverneed1.so.0v1v2v3f1f2f3 - €€€€Ðë ‘’“ÃÃÃÃÃà   -!8ðÿÿotüÿÿoˆýÿÿo GNUgold 1.11øù úûüý%ð.ñÿð5ñÿðAñÿðFñÿIñÿLñÿOùRüOúUýRûOøf1_v1f1_v2f1_v3f2_v1f2_v2f3_v1_DYNAMIC_edata__bss_start_endv3v2v1f1f2f3.text.bss.dynstr.gnu.version.note.gnu.gold-version.dynsym.hash.gnu.version_d.dynamic.shstrtab.strtab.symtab.data8   ð !@88<ÿÿÿottFýÿÿoˆˆpøøUðxðððð!ðpà hðX^H~ \ No newline at end of file Index: test/ELF/Inputs/verneed2.s =================================================================== --- test/ELF/Inputs/verneed2.s +++ test/ELF/Inputs/verneed2.s @@ -0,0 +1,5 @@ +.globl g1_v1 +g1_v1: +ret + +.symver g1_v1, g1@@v1 Index: test/ELF/Inputs/verneed2.so =================================================================== --- test/ELF/Inputs/verneed2.so +++ test/ELF/Inputs/verneed2.so @@ -1,3 +0,0 @@ -ELF>@@8@ @@@àà]]```ðð```ðð\ñÿñÿñÿverneed2.so.0v1v2v3g1Ðëœ ‘’“à  ˜ -¸ðÿÿoàüÿÿoìýÿÿo GNUgold 1.11\`ðñÿPñÿP#ñÿP(ñÿ+ñÿ.ñÿ1\g1_v1_DYNAMIC_edata__bss_start_endv3v2v1g1.text.bss.dynstr.gnu.version.note.gnu.gold-version.dynsym.hash.gnu.version_d.dynamic.shstrtab.strtab.symtab.data8   x ˜˜@¸¸(ÿÿÿoàà -Fýÿÿoììp\\U``ðxPPPP!Pppð h`4^”~ \ No newline at end of file Index: test/ELF/verneed-as-needed-weak.s =================================================================== --- test/ELF/verneed-as-needed-weak.s +++ test/ELF/verneed-as-needed-weak.s @@ -1,6 +1,10 @@ # REQUIRES: x86 +# RUN: echo "v1 {}; v2 {}; v3 { local: *; };" > %t.script +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/verneed1.s -o %t1.o +# RUN: ld.lld -shared %t1.o --version-script %t.script -o %t.so + # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -# RUN: ld.lld %t.o --as-needed %S/Inputs/verneed1.so -o %t +# RUN: ld.lld %t.o --as-needed %t.so -o %t # RUN: llvm-readobj -V %t | FileCheck %s # CHECK: SHT_GNU_verneed { Index: test/ELF/verneed-local.s =================================================================== --- test/ELF/verneed-local.s +++ test/ELF/verneed-local.s @@ -1,6 +1,10 @@ # REQUIRES: x86 +# RUN: echo "v1 {}; v2 {}; v3 { local: *; };" > %t.script +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/verneed1.s -o %t1.o +# RUN: ld.lld -shared %t1.o --version-script %t.script -o %t.so + # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -# RUN: not ld.lld %t.o %S/Inputs/verneed1.so -o %t 2>&1 | FileCheck %s +# RUN: not ld.lld %t.o %t.so -o %t 2>&1 | FileCheck %s # CHECK: error: undefined symbol: f3 # CHECK: >>> referenced by {{.*}}:(.text+0x1) Index: test/ELF/verneed.s =================================================================== --- test/ELF/verneed.s +++ test/ELF/verneed.s @@ -1,6 +1,12 @@ # REQUIRES: x86 +# RUN: echo "v1 {}; v2 {}; v3 { local: *; };" > %t.script +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/verneed1.s -o %t1.o +# RUN: ld.lld -shared %t1.o --version-script %t.script -o %t1.so -soname verneed1.so.0 +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/verneed2.s -o %t2.o +# RUN: ld.lld -shared %t2.o --version-script %t.script -o %t2.so -soname verneed2.so.0 + # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -# RUN: ld.lld %t.o %S/Inputs/verneed1.so %S/Inputs/verneed2.so -o %t +# RUN: ld.lld %t.o %t1.so %t2.so -o %t # RUN: llvm-readobj -V -sections -section-data -dyn-symbols -dynamic-table %t | FileCheck %s # CHECK: Section {