[lld] [lld-macho] Add swift support to ObjC category merger (PR #95124)

Kyungwoo Lee via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 11 20:35:43 PDT 2024


================
@@ -1270,7 +1274,9 @@ void ObjcCategoryMerger::eraseMergedCategories() {
 
       eraseISec(catInfo.catBodyIsec);
 
-      tryEraseDefinedAtIsecOffset(catInfo.catBodyIsec, catLayout.nameOffset);
+      // We can't erase 'catLayout.nameOffset' because for Swift categories, the
+      // name will be referenced in __METACLASS_DATA_.
+      // TODO: handle the above smarter
----------------
kyulee-com wrote:

I'm not sure I follow. Is this the same behavior with ld64?
What is __METACLASS_DATA__? -- do you have a reference to it?
What's the consequence if we leave it without deleting it?

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


More information about the llvm-commits mailing list