33 lines · plain
1# REQUIRES: x862 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.o5# RUN: ld.lld %ta.o --shared --soname=a.so -o %ta.so6 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.o9# RUN: ld.lld %tb.o %ta.so --shared --soname=b.so -o %tb.so10 11# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o12# RUN: ld.lld %t.o %tb.so --as-needed %ta.so -o %t13# RUN: llvm-readelf -d %t | FileCheck %s14 15# RUN: ld.lld %t.o %tb.so --as-needed %ta.so --gc-sections -o %t16# RUN: llvm-readelf -d %t | FileCheck %s17 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.20# CHECK-NOT: a.so21 22# RUN: ld.lld %t.o %tb.so --as-needed %ta.so --no-as-needed %ta.so -o %t23# RUN: llvm-readelf -d %t | FileCheck %s -check-prefix=NEEDED24 25# a.so is needed because one of its occurrences is needed.26# NEEDED: a.so27 28.global _start29.weak a230_start:31 jmp b@PLT32 jmp a233