File tree 3 files changed +21
-8
lines changed
3 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -602,7 +602,7 @@ template <class ELFT> void ICF<ELFT>::run() {
602
602
fold (sym);
603
603
auto it = symbolEquivalence.findLeader (sym);
604
604
if (it != symbolEquivalence.member_end () && *it != sym) {
605
- print () << " Redirecting " << sym->getName () << " to " << (*it)->getName ();
605
+ print () << " redirecting ' " << sym->getName () << " ' in symtab to ' " << (*it)->getName () << " ' " ;
606
606
ctx.symtab ->redirect (sym, *it);
607
607
}
608
608
}
@@ -612,8 +612,8 @@ template <class ELFT> void ICF<ELFT>::run() {
612
612
for (Symbol *&sym : file->getMutableGlobalSymbols ()) {
613
613
auto it = symbolEquivalence.findLeader (sym);
614
614
if (it != symbolEquivalence.member_end () && *it != sym) {
615
- print () << " Redirecting " << sym->getName () << " to "
616
- << (*it)->getName ();
615
+ print () << " redirecting ' " << sym->getName () << " ' to ' "
616
+ << (*it)->getName () << " ' " ;
617
617
sym = *it;
618
618
}
619
619
}
Original file line number Diff line number Diff line change 1
1
// REQUIRES: aarch64
2
2
3
3
# RUN: llvm - mc - filetype=obj - triple=aarch64 %s - o %t
4
+ # RUN: llvm - mc - filetype=obj - crel - triple=aarch64 %s - o %tcrel
4
5
# RUN: ld.lld %t - o %t2 -- icf=all
6
+ # RUN: ld.lld %tcrel - o %tcrel2 -- icf=all
7
+
5
8
# RUN: llvm - objdump -- section - headers %t2 | FileCheck %s -- check - prefix=EXE
9
+ # RUN: llvm - objdump -- section - headers %tcrel2 | FileCheck %s -- check - prefix=EXE
6
10
7
11
# RUN: ld.lld - shared %t - o %t3 -- icf=all
12
+ # RUN: ld.lld - shared %tcrel - o %tcrel3 -- icf=all
13
+
8
14
# RUN: llvm - objdump -- section - headers %t3 | FileCheck %s -- check - prefix=DSO
15
+ # RUN: llvm - objdump -- section - headers %tcrel3 | FileCheck %s -- check - prefix=DSO
9
16
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.
11
19
# EXE: {{. * }}.got 00000010 {{. * }}
12
20
13
21
## When symbols are preemptible in DSO mode , GOT entries wouldn't be merged
@@ -50,7 +58,8 @@ bl f1_\index
50
58
51
59
.endm
52
60
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.
54
63
55
64
. section .text.t1_0 , "ax" , @progbits
56
65
t1_0:
Original file line number Diff line number Diff line change 17
17
# EXE-NEXT: selected section {{.*}}:(.text.h1)
18
18
# EXE-NEXT: removing identical section {{.*}}:(.text.h2)
19
19
# 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: {{.}}
23
27
24
28
## Definitions are preemptible in a DSO. Only leaf functions can be folded.
25
29
# DSO-NOT: {{.}}
You can’t perform that action at this time.
0 commit comments