70 lines · plain
1# REQUIRES: x862# RUN: rm -rf %t && split-file %s %t && cd %t3# RUN: llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o && ld.lld a.o -shared -o a.so4# RUN: llvm-mc -filetype=obj -triple=x86_64 b.s -o b.o && ld.lld b.o -shared -o b.so5# RUN: llvm-ar rc a.a a.o6# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux ref.s -o ref.o7# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux ref2.s -o ref2.o8# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux weakref2.s -o weakref2.o9# RUN: ld.lld a.a b.so ref.o -shared -o 1.so10# RUN: llvm-readelf --dyn-syms 1.so | FileCheck %s11# RUN: ld.lld a.so a.a ref.o -shared -o 1.so12# RUN: llvm-readelf --dyn-syms 1.so | FileCheck %s13 14## The definitions from a.so are used and we don't extract a member from the15## archive.16 17# CHECK: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND x118# CHECK-NEXT: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND x219 20## The extracted x1 is defined as STB_GLOBAL.21# RUN: ld.lld ref.o a.a b.so -o 2.so -shared22# RUN: llvm-readelf --dyn-symbols 2.so | FileCheck %s --check-prefix=CHECK223# RUN: ld.lld a.a ref.o b.so -o 2.so -shared24# RUN: llvm-readelf --dyn-symbols 2.so | FileCheck %s --check-prefix=CHECK225 26# CHECK2: {{.*}} 0 NOTYPE GLOBAL DEFAULT [[#]] x127# CHECK2-NEXT: {{.*}} 0 NOTYPE WEAK DEFAULT [[#]] x228 29## The extracted x2 is defined as STB_WEAK. x1 is not referenced by any relocatable object file.30# RUN: ld.lld a.a ref2.o b.so -o 2.so -shared31# RUN: llvm-readelf --dyn-syms 2.so | FileCheck %s --check-prefix=CHECK232# RUN: ld.lld a.a a.so ref2.o -o 3.so -shared33# RUN: llvm-readelf --dyn-syms 3.so | FileCheck %s --check-prefix=CHECK334# RUN: ld.lld a.so a.a ref2.o -o 3.so -shared35# RUN: llvm-readelf --dyn-syms 3.so | FileCheck %s --check-prefix=CHECK336 37# CHECK3: 1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND x238# CHECK3-EMPTY:39 40# RUN: ld.lld a.a weakref2.o a.so -o 4.so -shared41# RUN: llvm-readelf --dyn-syms 4.so | FileCheck %s --check-prefix=CHECK442 43# CHECK4: 1: 0000000000000000 0 NOTYPE WEAK DEFAULT UND x244# CHECK4-EMPTY:45 46# RUN: ld.lld a.a --as-needed a.so -o noneeded.so -shared47# RUN: llvm-readelf -d noneeded.so | FileCheck %s --check-prefix=NONEEDED48 49# NONEEDED-NOT: NEEDED50 51#--- a.s52.global x153x1:54.weak x255x2:56#--- b.s57.globl x1, x258x1:59x2:60 .byte 061.size x1, .-x162.size x2, .-x263#--- ref.s64.globl x165.globl x266#--- ref2.s67.globl x268#--- weakref2.s69.weak x270