[lld] [lld-macho] Category Merger: add support for addrsig references (PR #90903)

via llvm-commits llvm-commits at lists.llvm.org
Fri May 3 15:16:52 PDT 2024


================
@@ -1188,6 +1200,36 @@ void ObjcCategoryMerger::eraseMergedCategories() {
                                   catLayout.instancePropsOffset);
     }
   }
+
+  removeRefsToErasedIsecs();
+}
+
+// The compiler may generate references to categories inside the addrsig
+// section. This function will erase these references.
+void ObjcCategoryMerger::removeRefsToErasedIsecs() {
+  for (InputSection *isec : inputSections) {
+    if (isec->getName() != section_names::addrSig)
+      continue;
+
+    auto &_erasedIsecs = erasedIsecs;
----------------
alx32 wrote:

Can't capture `erasedIsecs` because `'erasedIsecs' in capture list does not name a variable` , but I can fully capture `this` to not use temp variable.

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


More information about the llvm-commits mailing list