65 lines · plain
1# REQUIRES: x862 3# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %s -o %t.o4# RUN: %lld -lSystem -dead_strip -why_live _foo -why_live _undef -U _undef \5# RUN: -why_live _support -why_live _support_refs_dylib_fun \6# RUN: -why_live _abs %t.o -o /dev/null 2>&1 | FileCheck %s7 8## Due to an implementation detail, LLD is not able to report -why_live info for9## absolute symbols. (ld64 has the same shortcoming.)10# CHECK-NOT: _abs11# CHECK: _foo from {{.*}}why-live.s.tmp.o12# CHECK-NEXT: _quux from {{.*}}why-live.s.tmp.o13# CHECK-NEXT: _undef from {{.*}}why-live.s.tmp.o14# CHECK-NEXT: _main from {{.*}}why-live.s.tmp.o15## Our handling of live_support sections can be improved... we should print the16## dylib symbol that keeps _support_refs_dylib_fun alive, instead of printing17## the live_support symbol's name itself. (ld64 seems to have the same issue.)18# CHECK-NEXT: _support_refs_dylib_fun from {{.*}}why-live.s.tmp.o19# CHECK-NEXT: _support_refs_dylib_fun from {{.*}}why-live.s.tmp.o20## Again, this can be improved: we shouldn't be printing _support twice. (ld6421## seems to have the same issue.)22# CHECK-NEXT: _support from {{.*}}why-live.s.tmp.o23# CHECK-NEXT: _support from {{.*}}why-live.s.tmp.o24# CHECK-NEXT: _foo from {{.*}}why-live.s.tmp.o25# CHECK-EMPTY:26 27.text28_foo:29 retq30 31_bar:32 retq33 34_baz:35 callq _foo36 retq37 38.no_dead_strip _quux39_quux:40 callq _foo41 retq42 43.globl _main44_main:45 callq _foo46 callq _baz47 callq _undef48 callq ___isnan49 retq50 51.globl _abs52_abs = 0x100053 54.section __TEXT,support,regular,live_support55_support:56 callq _foo57 callq _abs58 retq59 60_support_refs_dylib_fun:61 callq ___isnan62 retq63 64.subsections_via_symbols65