File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1036,6 +1036,9 @@ void check_duplicate_symbols(Context<E> &ctx) {
10361036 Timer t (ctx, " check_duplicate_symbols" );
10371037
10381038 tbb::parallel_for_each (ctx.objs , [&](ObjectFile<E> *file) {
1039+ if (!file->is_reachable )
1040+ return ;
1041+
10391042 for (i64 i = file->first_global ; i < file->elf_syms .size (); i++) {
10401043 const ElfSym<E> &esym = file->elf_syms [i];
10411044 Symbol<E> &sym = *file->symbols [i];
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ . $( dirname $0 ) /common.inc
3+
4+ test_cflags -flto=auto || skip
5+
6+ cat << EOF | $CC -o $t /a.o -c -xc - -flto
7+ void foo() {}
8+ EOF
9+
10+ rm -f $t /b.a
11+ ar rc $t /b.a $t /a.o
12+ ar rc $t /c.a $t /a.o
13+
14+ cat << EOF | $CC -o $t /c.o -c -xc -
15+ void foo();
16+ int main() { foo(); }
17+ EOF
18+
19+ $CC -B. -o $t /exe -flto $t /c.o $t /b.a $t /c.a
You can’t perform that action at this time.
0 commit comments