[lld] [LLD][COFF] Prevent merging .bss into shared sections (PR #202817)

Evgenii Kudriashov via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 03:55:32 PDT 2026


================
@@ -1656,19 +1658,27 @@ void Writer::createSymbolAndStringTable() {
   fileSize = alignTo(fileOff, ctx.config.fileAlign);
 }
 
-void Writer::mergeSection(const std::map<StringRef, StringRef>::value_type &p) {
-  StringRef toName = p.second;
-  if (p.first == toName)
-    return;
+StringRef Writer::getMergeDestination(const StringRef sectionName,
+                                      const StringRef destName) {
+  StringRef toName = destName;
----------------
e-kud wrote:

I don't know why I used `const StringRef`. I think it is meaningless. No need to split `toName` and `toSection` anymore.

https://github.com/llvm/llvm-project/pull/202817


More information about the llvm-commits mailing list