3 # RUN: echo '.globl a1, a2; .type a1, @function; .type a2, @function; a1: a2: ret' | \
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux - -o %ta.o
5 # RUN: ld.lld %ta.o --shared --soname=a.so -o %ta.so
7 # RUN: echo '.globl b; .type b, @function; b: jmp a1@PLT' | \
8 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux - -o %tb.o
9 # RUN: ld.lld %tb.o %ta.so --shared --soname=b.so -o %tb.so
11 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
12 # RUN: ld.lld %t.o %tb.so --as-needed %ta.so -o %t
13 # RUN: llvm-readelf -d %t | FileCheck %s
15 # RUN: ld.lld %t.o %tb.so --as-needed %ta.so --gc-sections -o %t
16 # RUN: llvm-readelf -d %t | FileCheck %s
18 # The symbol a1 (defined in a.so) is not referenced by a regular object,
19 # the reference to a2 is weak, don't add a DT_NEEDED entry for a.so.
22 # RUN: ld.lld %t.o %tb.so --as-needed %ta.so --no-as-needed %ta.so -o %t
23 # RUN: llvm-readelf -d %t | FileCheck %s -check-prefix=NEEDED
25 # a.so is needed because one of its occurrences is needed.