[lld] [lld-macho][NFC] Refactor ObjCSelRefsSection out of ObjCStubsSection (PR #83878)

via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 5 14:05:53 PST 2024


================
@@ -315,6 +315,25 @@ class StubHelperSection final : public SyntheticSection {
   Defined *dyldPrivate = nullptr;
 };
 
+class ObjCSelRefsSection final : public SyntheticSection {
+public:
+  ObjCSelRefsSection();
+  void initialize();
+
+  // This SyntheticSection does not do its own writing, but instead uses the
+  // creates SyntheticInputSection's and inserts them into inputSections
+  uint64_t getSize() const override { return 0; }
----------------
alx32 wrote:

Agree, I don't think there is any good current pattern for this. I followed closest available pattern `PageZeroSection` which also doen't use the features.
We can make it a global helper, but then I think it has to be static - also not a good pattern. Any suggestions where to put the helper ? 

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


More information about the llvm-commits mailing list