3 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %s -o %t.o
4 # 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 %s
8 ## Due to an implementation detail, LLD is not able to report -why_live info for
9 ## absolute symbols. (ld64 has the same shortcoming.)
11 # CHECK: _foo from {{.*}}why-live.s.tmp.o
12 # CHECK-NEXT: _quux from {{.*}}why-live.s.tmp.o
13 # CHECK-NEXT: _undef from {{.*}}why-live.s.tmp.o
14 # CHECK-NEXT: _main from {{.*}}why-live.s.tmp.o
15 ## Our handling of live_support sections can be improved... we should print the
16 ## dylib symbol that keeps _support_refs_dylib_fun alive, instead of printing
17 ## 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.o
19 # CHECK-NEXT: _support_refs_dylib_fun from {{.*}}why-live.s.tmp.o
20 ## Again, this can be improved: we shouldn't be printing _support twice. (ld64
21 ## seems to have the same issue.)
22 # CHECK-NEXT: _support from {{.*}}why-live.s.tmp.o
23 # CHECK-NEXT: _support from {{.*}}why-live.s.tmp.o
24 # CHECK-NEXT: _foo from {{.*}}why-live.s.tmp.o
54 .section __TEXT,support,regular,live_support
60 _support_refs_dylib_fun
:
64 .subsections_via_symbols