[llvm] [DWARFLinker] Erase the type ref patch list with the section data (PR #217989)

Jonas Devlieghere via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 12:10:38 PDT 2026


https://github.com/JDevlieghere updated https://github.com/llvm/llvm-project/pull/217989

>From 9debf7971ef4f89b80bd84875407aeb6bc91d8c3 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <jonas at devlieghere.com>
Date: Thu, 20 Aug 2026 09:53:46 -0700
Subject: [PATCH] [DWARFLinker] Erase the type ref patch list with the section
 data

SectionDescriptor::clearAllSectionData drops every patch list but
ListDebugDieTypeRefPatch. maybeResetToLoadedStage calls eraseSections()
on a unit which is already past Stage::Cloned, so that list outlives
the section content it points into and is then applied to the offsets
of the re-cloned content.

Assisted-by: Claude
---
 llvm/lib/DWARFLinker/Parallel/OutputSections.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/lib/DWARFLinker/Parallel/OutputSections.cpp b/llvm/lib/DWARFLinker/Parallel/OutputSections.cpp
index 079be51ace24a..7d9a47a48b663 100644
--- a/llvm/lib/DWARFLinker/Parallel/OutputSections.cpp
+++ b/llvm/lib/DWARFLinker/Parallel/OutputSections.cpp
@@ -66,6 +66,7 @@ void SectionDescriptor::clearAllSectionData() {
   ListDebugDieRefPatch.erase();
   ListDebugULEB128DieRefPatch.erase();
   ListDebugOffsetPatch.erase();
+  ListDebugDieTypeRefPatch.erase();
   ListDebugType2TypeDieRefPatch.erase();
   ListDebugTypeDeclFilePatch.erase();
   ListDebugTypeLineStrPatch.erase();



More information about the llvm-commits mailing list