File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -2413,7 +2413,7 @@ static void findKeepUniqueSections(Ctx &ctx, opt::InputArgList &args) {
2413
2413
// or DSOs, so we conservatively mark them as address-significant.
2414
2414
bool icfSafe = ctx.arg .icf == ICFLevel::Safe;
2415
2415
for (Symbol *sym : ctx.symtab ->getSymbols ())
2416
- if (sym->includeInDynsym (ctx) )
2416
+ if (sym->isExported )
2417
2417
markAddrsig (icfSafe, sym);
2418
2418
2419
2419
// Visit the address-significance table in each object file and mark each
Original file line number Diff line number Diff line change 1
1
# REQUIRES: x86
2
+ # RUN: llvm-mc -filetype=obj -triple=x86_64 %S/Inputs/shared.s -o %ta.o
3
+ # RUN: ld.lld -shared -soname=ta %ta.o -o %ta.so
2
4
3
5
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o
4
6
# RUN: llvm-objcopy %t1.o %t1copy.o
5
7
# RUN: llvm-objcopy --localize-symbol=h1 %t1.o %t1changed.o
6
8
# RUN: ld.lld -r %t1.o -o %t1reloc.o
7
9
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %S/Inputs/icf-safe.s -o %t2.o
8
- # RUN: ld.lld %t1.o %t2.o -o %t2 --icf=safe --print-icf-sections | FileCheck %s
10
+ # RUN: ld.lld %t1.o %t2.o -o %t2 --icf=safe --print-icf-sections --export-dynamic | FileCheck %s
9
11
# RUN: ld.lld %t1copy.o %t2.o -o %t2 --icf=safe --print-icf-sections | FileCheck %s
10
12
# RUN: ld.lld %t1.o %t2.o -o %t3 --icf=safe --print-icf-sections -shared | FileCheck --check-prefix=EXPORT %s
11
- # RUN: ld.lld %t1.o %t2.o -o %t3 --icf=safe --print-icf-sections --export-dynamic | FileCheck --check-prefix=EXPORT %s
13
+ ## Exported symbols are suppressed for ICF when dynamic linking is enabled.
14
+ # RUN: ld.lld %t1.o %t2.o %ta.so -o %t3 --icf=safe --print-icf-sections --export-dynamic | FileCheck --check-prefix=EXPORT %s
12
15
# RUN: ld.lld %t1.o %t2.o -o %t2 --icf=all --print-icf-sections | FileCheck --check-prefix=ALL %s
13
- # RUN: ld.lld %t1.o %t2.o -o %t2 --icf=all --print-icf-sections --export-dynamic | FileCheck --check-prefix=ALL-EXPORT %s
16
+ # RUN: ld.lld %t1.o %t2.o %ta.so -o %t2 --icf=all --print-icf-sections --export-dynamic | FileCheck --check-prefix=ALL-EXPORT %s
14
17
# RUN: ld.lld %t1changed.o -o %t4 --icf=safe 2>&1 | FileCheck --check-prefix=SH_LINK_0 %s
15
18
# RUN: ld.lld %t1reloc.o -o %t4 --icf=safe 2>&1 | FileCheck --check-prefix=SH_LINK_0 %s
16
19
You can’t perform that action at this time.
0 commit comments