|
10 | 10 | # RUN: ld.lld %t1.o %t2.o -o %t2 --icf=all --print-icf-sections --export-dynamic | FileCheck --check-prefix=ALL-EXPORT %s
|
11 | 11 | # RUN: ld.lld %t1copy.o -o %t4 --icf=safe 2>&1 | FileCheck --check-prefix=OBJCOPY %s
|
12 | 12 |
|
13 |
| -# CHECK-NOT: selected section {{.*}}:(.rodata.l1) |
14 |
| -# CHECK: selected section {{.*}}:(.rodata.l3) |
15 |
| -# CHECK: removing identical section {{.*}}:(.rodata.l4) |
16 |
| - |
17 | 13 | # CHECK-NOT: selected section {{.*}}:(.text.f1)
|
18 | 14 | # CHECK: selected section {{.*}}:(.text.f3)
|
19 | 15 | # CHECK: removing identical section {{.*}}:(.text.f4)
|
|
22 | 18 | # CHECK: selected section {{.*}}:(.rodata.h3)
|
23 | 19 | # CHECK: removing identical section {{.*}}:(.rodata.h4)
|
24 | 20 |
|
| 21 | +# CHECK-NOT: selected section {{.*}}:(.rodata.l1) |
| 22 | +# CHECK: selected section {{.*}}:(.rodata.l3) |
| 23 | +# CHECK: removing identical section {{.*}}:(.rodata.l4) |
| 24 | + |
25 | 25 | # CHECK-NOT: selected section {{.*}}:(.rodata.g1)
|
26 | 26 | # CHECK: selected section {{.*}}:(.rodata.g3)
|
27 | 27 | # CHECK: removing identical section {{.*}}:(.rodata.g4)
|
|
30 | 30 |
|
31 | 31 | # With --icf=all address-significance implies keep-unique only for rodata, not
|
32 | 32 | # text.
|
33 |
| -# ALL-NOT: selected section {{.*}}:(.rodata.l1) |
34 |
| -# ALL: selected section {{.*}}:(.rodata.l3) |
35 |
| -# ALL: removing identical section {{.*}}:(.rodata.l4) |
36 |
| - |
37 | 33 | # ALL: selected section {{.*}}:(.text.f3)
|
38 | 34 | # ALL: removing identical section {{.*}}:(.text.f4)
|
39 | 35 |
|
40 |
| -# ALL: selected section {{.*}}:(.text.f1) |
41 |
| -# ALL: removing identical section {{.*}}:(.text.f2) |
42 |
| -# ALL: removing identical section {{.*}}:(.text.non_addrsig1) |
43 |
| -# ALL: removing identical section {{.*}}:(.text.non_addrsig2) |
44 |
| - |
45 | 36 | # ALL-NOT: selected section {{.*}}:(.rodata.h1)
|
46 | 37 | # ALL: selected section {{.*}}:(.rodata.h3)
|
47 | 38 | # ALL: removing identical section {{.*}}:(.rodata.h4)
|
48 | 39 |
|
| 40 | +# ALL-NOT: selected section {{.*}}:(.rodata.l1) |
| 41 | +# ALL: selected section {{.*}}:(.rodata.l3) |
| 42 | +# ALL: removing identical section {{.*}}:(.rodata.l4) |
| 43 | + |
49 | 44 | # ALL-NOT: selected section {{.*}}:(.rodata.g1)
|
50 | 45 | # ALL: selected section {{.*}}:(.rodata.g3)
|
51 | 46 | # ALL: removing identical section {{.*}}:(.rodata.g4)
|
52 | 47 |
|
| 48 | +# ALL: selected section {{.*}}:(.text.f1) |
| 49 | +# ALL: removing identical section {{.*}}:(.text.f2) |
| 50 | +# ALL: removing identical section {{.*}}:(.text.non_addrsig1) |
| 51 | +# ALL: removing identical section {{.*}}:(.text.non_addrsig2) |
| 52 | + |
53 | 53 | # llvm-mc normally emits an empty .text section into every object file. Since
|
54 | 54 | # nothing actually refers to it via a relocation, it doesn't have any associated
|
55 | 55 | # symbols (thus nor can anything refer to it via a relocation, making it safe to
|
|
58 | 58 | # STB_LOCAL or STV_HIDDEN symbols. The dynsym entries should have prevented
|
59 | 59 | # anything else from being merged.
|
60 | 60 | # EXPORT-NOT: selected section
|
61 |
| -# EXPORT: selected section {{.*}}:(.rodata.l3) |
62 |
| -# EXPORT: removing identical section {{.*}}:(.rodata.l4) |
63 |
| -# EXPORT-NOT: selected section |
64 | 61 | # EXPORT: selected section {{.*}}:(.rodata.h3)
|
65 | 62 | # EXPORT: removing identical section {{.*}}:(.rodata.h4)
|
66 | 63 | # EXPORT-NOT: selected section
|
67 | 64 | # EXPORT: selected section {{.*}}:(.text)
|
68 | 65 | # EXPORT: removing identical section {{.*}}:(.text)
|
69 | 66 | # EXPORT-NOT: selected section
|
| 67 | +# EXPORT: selected section {{.*}}:(.rodata.l3) |
| 68 | +# EXPORT: removing identical section {{.*}}:(.rodata.l4) |
| 69 | +# EXPORT-NOT: selected section |
70 | 70 |
|
71 | 71 | # If --icf=all is specified when exporting we can also merge the exported text
|
72 | 72 | # sections, but not the exported rodata.
|
73 | 73 | # ALL-EXPORT-NOT: selected section
|
74 |
| -# ALL-EXPORT: selected section {{.*}}:(.rodata.l3) |
75 |
| -# ALL-EXPORT: removing identical section {{.*}}:(.rodata.l4) |
76 |
| -# ALL-EXPORT-NOT: selected section |
77 | 74 | # ALL-EXPORT: selected section {{.*}}:(.text.f3)
|
78 | 75 | # ALL-EXPORT: removing identical section {{.*}}:(.text.f4)
|
79 | 76 | # ALL-EXPORT-NOT: selected section
|
80 |
| -# ALL-EXPORT: selected section {{.*}}:(.text.f1) |
81 |
| -# ALL-EXPORT: removing identical section {{.*}}:(.text.f2) |
82 |
| -# ALL-EXPORT: removing identical section {{.*}}:(.text.non_addrsig1) |
83 |
| -# ALL-EXPORT: removing identical section {{.*}}:(.text.non_addrsig2) |
84 |
| -# ALL-EXPORT-NOT: selected section |
85 | 77 | # ALL-EXPORT: selected section {{.*}}:(.rodata.h3)
|
86 | 78 | # ALL-EXPORT: removing identical section {{.*}}:(.rodata.h4)
|
87 | 79 | # ALL-EXPORT-NOT: selected section
|
88 | 80 | # ALL-EXPORT: selected section {{.*}}:(.text)
|
89 | 81 | # ALL-EXPORT: removing identical section {{.*}}:(.text)
|
90 | 82 | # ALL-EXPORT-NOT: selected section
|
| 83 | +# ALL-EXPORT: selected section {{.*}}:(.rodata.l3) |
| 84 | +# ALL-EXPORT: removing identical section {{.*}}:(.rodata.l4) |
| 85 | +# ALL-EXPORT-NOT: selected section |
| 86 | +# ALL-EXPORT: selected section {{.*}}:(.text.f1) |
| 87 | +# ALL-EXPORT: removing identical section {{.*}}:(.text.f2) |
| 88 | +# ALL-EXPORT: removing identical section {{.*}}:(.text.non_addrsig1) |
| 89 | +# ALL-EXPORT: removing identical section {{.*}}:(.text.non_addrsig2) |
| 90 | +# ALL-EXPORT-NOT: selected section |
91 | 91 |
|
92 | 92 | # OBJCOPY: --icf=safe is incompatible with object files created using objcopy or ld -r
|
93 | 93 |
|
|
0 commit comments