File tree Expand file tree Collapse file tree 3 files changed +22
-8
lines changed Expand file tree Collapse file tree 3 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -602,7 +602,8 @@ template <class ELFT> void ICF<ELFT>::run() {
602602 fold (sym);
603603 auto it = symbolEquivalence.findLeader (sym);
604604 if (it != symbolEquivalence.member_end () && *it != sym) {
605- print () << " Redirecting " << sym->getName () << " to " << (*it)->getName ();
605+ print () << " redirecting '" << sym->getName () << " ' in symtab to '"
606+ << (*it)->getName () << " '" ;
606607 ctx.symtab ->redirect (sym, *it);
607608 }
608609 }
@@ -612,8 +613,8 @@ template <class ELFT> void ICF<ELFT>::run() {
612613 for (Symbol *&sym : file->getMutableGlobalSymbols ()) {
613614 auto it = symbolEquivalence.findLeader (sym);
614615 if (it != symbolEquivalence.member_end () && *it != sym) {
615- print () << " Redirecting " << sym->getName () << " to "
616- << (*it)->getName ();
616+ print () << " redirecting ' " << sym->getName () << " ' to ' "
617+ << (*it)->getName () << " ' " ;
617618 sym = *it;
618619 }
619620 }
Original file line number Diff line number Diff line change 11// REQUIRES: aarch64
22
33# RUN: llvm - mc - filetype=obj - triple=aarch64 %s - o %t
4+ # RUN: llvm - mc - filetype=obj - crel - triple=aarch64 %s - o %tcrel
45# RUN: ld.lld %t - o %t2 -- icf=all
6+ # RUN: ld.lld %tcrel - o %tcrel2 -- icf=all
7+
58# RUN: llvm - objdump -- section - headers %t2 | FileCheck %s -- check - prefix=EXE
9+ # RUN: llvm - objdump -- section - headers %tcrel2 | FileCheck %s -- check - prefix=EXE
610
711# RUN: ld.lld - shared %t - o %t3 -- icf=all
12+ # RUN: ld.lld - shared %tcrel - o %tcrel3 -- icf=all
13+
814# RUN: llvm - objdump -- section - headers %t3 | FileCheck %s -- check - prefix=DSO
15+ # RUN: llvm - objdump -- section - headers %tcrel3 | FileCheck %s -- check - prefix=DSO
916
10- ## All .rodata. * sections should merge into a single GOT entry
17+ ## All global g * symbols should merge into a single GOT entry while non - global
18+ ## gets its own GOT entry.
1119# EXE: {{. * }}.got 00000010 {{. * }}
1220
1321## When symbols are preemptible in DSO mode , GOT entries wouldn't be merged
@@ -50,7 +58,8 @@ bl f1_\index
5058
5159.endm
5260
53- # another set of sections merging: g1 < - g2
61+ ## Another set of sections merging: g1 < - g2. Linker should be able to
62+ ## resolve both g1 and g2 to g0 based on ICF on previous sections.
5463
5564. section .text.t1_0 , "ax" , @progbits
5665t1_0:
Original file line number Diff line number Diff line change 1717# EXE-NEXT: selected section {{.*}}:(.text.h1)
1818# EXE-NEXT: removing identical section {{.*}}:(.text.h2)
1919# EXE-NEXT: removing identical section {{.*}}:(.text.h3)
20- # EXE-NEXT: Redirecting f2 to f1
21- # EXE-NEXT: Redirecting g2 to g1
22- # EXE-NEXT: Redirecting g3 to g1
20+ # EXE-NEXT: redirecting 'f2' in symtab to 'f1'
21+ # EXE-NEXT: redirecting 'g2' in symtab to 'g1'
22+ # EXE-NEXT: redirecting 'g3' in symtab to 'g1'
23+ # EXE-NEXT: redirecting 'f2' to 'f1'
24+ # EXE-NEXT: redirecting 'g2' to 'g1'
25+ # EXE-NEXT: redirecting 'g3' to 'g1'
26+ # EXE-NOT: {{.}}
2327
2428## Definitions are preemptible in a DSO. Only leaf functions can be folded.
2529# DSO-NOT: {{.}}
You can’t perform that action at this time.
0 commit comments