Skip to content

Conversation

@ellishg
Copy link
Contributor

@ellishg ellishg commented Jun 23, 2025

Fix size measurements for duplicate sections that was added in #145106.

@llvmbot llvmbot added the lld label Jun 23, 2025
@ellishg ellishg requested a review from MaskRay June 23, 2025 18:46
@llvmbot
Copy link
Member

llvmbot commented Jun 23, 2025

@llvm/pr-subscribers-lld

Author: Ellis Hoag (ellishg)

Changes

Fix size measurements for duplicate sections that was added in #145106.


Full diff: https://github.com/llvm/llvm-project/pull/145384.diff

1 Files Affected:

  • (modified) lld/include/lld/Common/BPSectionOrdererBase.inc (+2-2)
diff --git a/lld/include/lld/Common/BPSectionOrdererBase.inc b/lld/include/lld/Common/BPSectionOrdererBase.inc
index fbeca187aa76f..00c9dc7159ddd 100644
--- a/lld/include/lld/Common/BPSectionOrdererBase.inc
+++ b/lld/include/lld/Common/BPSectionOrdererBase.inc
@@ -319,7 +319,7 @@ auto BPOrderer<D>::computeOrder(
     for (auto dupSecIdx : It->getSecond()) {
       const auto *dupIsec = sections[dupSecIdx];
       if (orderedSections.insert(dupIsec)) {
-        duplicateCodeSize += D::getSize(*isec);
+        duplicateCodeSize += D::getSize(*dupIsec);
         ++numDuplicateCodeSections;
       }
     }
@@ -337,7 +337,7 @@ auto BPOrderer<D>::computeOrder(
     for (auto dupSecIdx : It->getSecond()) {
       const auto *dupIsec = sections[dupSecIdx];
       if (orderedSections.insert(dupIsec)) {
-        duplicateDataSize += D::getSize(*isec);
+        duplicateDataSize += D::getSize(*dupIsec);
         ++numDuplicateDataSections;
       }
     }

@ellishg ellishg requested a review from SharonXSharon June 23, 2025 20:35
@ellishg ellishg merged commit b77c713 into llvm:main Jun 24, 2025
9 checks passed
DrSergei pushed a commit to DrSergei/llvm-project that referenced this pull request Jun 24, 2025
anthonyhatran pushed a commit to anthonyhatran/llvm-project that referenced this pull request Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants