Commit 8f025f2
authored
[clang] Do not emit template parameter objects as COMDATs when they have internal linkage. (llvm#125448)
Per the ELF spec, section groups may only contain local symbols if those
symbols are only
referenced from within the section group. [1] In the case of template
parameter objects,
they can be referenced from outside the group when the type of the
object was declared
in an anonymous namespace. In that case, we can't place the object in a
COMDAT. This matches
GCC's linkage behavior on the test input.
[1]:
https://www.sco.com/developers/gabi/latest/ch4.sheader.html#section_groups1 parent 5c065f0 commit 8f025f2
File tree
2 files changed
+11
-1
lines changed- clang
- lib/CodeGen
- test/CodeGenCXX
2 files changed
+11
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3765 | 3765 | | |
3766 | 3766 | | |
3767 | 3767 | | |
3768 | | - | |
| 3768 | + | |
3769 | 3769 | | |
3770 | 3770 | | |
3771 | 3771 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
0 commit comments