File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 1111#### Bug fixes
1212- Fix potentially corrupt IR layouts for bit fields. (#4646 , #4708 )
1313- Fix potentially corrupt IR layouts for explicitly under-aligned aggregates, a regression introduced in LDC v1.31. (#4734 , #4736 )
14+ - ELF: Emit (most) instantiated symbols in COMDATs for proper link-time culling. (#3589 , #4748 )
1415
1516# LDC 1.39.0 (2024-07-04)
1617
Original file line number Diff line number Diff line change @@ -259,7 +259,13 @@ LLGlobalValue::LinkageTypes DtoLinkageOnly(Dsymbol *sym) {
259259}
260260
261261LinkageWithCOMDAT DtoLinkage (Dsymbol *sym) {
262- return {DtoLinkageOnly (sym), needsCOMDAT ()};
262+ const auto linkage = DtoLinkageOnly (sym);
263+ const bool inCOMDAT = needsCOMDAT () ||
264+ // ELF needs some help for ODR linkages:
265+ // https://github.com/ldc-developers/ldc/issues/3589
266+ (linkage == templateLinkage &&
267+ global.params .targetTriple ->isOSBinFormatELF ());
268+ return {linkage, inCOMDAT};
263269}
264270
265271bool needsCOMDAT () {
You can’t perform that action at this time.
0 commit comments