[lld] [lld-macho][NFC] Refactor ObjCSelRefsSection out of ObjCStubsSection (PR #83878)
Kyungwoo Lee via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 5 13:53:23 PST 2024
================
@@ -806,26 +806,13 @@ void StubHelperSection::setUp() {
dyldPrivate->used = true;
}
-ObjCStubsSection::ObjCStubsSection()
- : SyntheticSection(segment_names::text, section_names::objcStubs) {
- flags = S_ATTR_SOME_INSTRUCTIONS | S_ATTR_PURE_INSTRUCTIONS;
- align = config->objcStubsMode == ObjCStubsMode::fast
- ? target->objcStubsFastAlignment
- : target->objcStubsSmallAlignment;
-}
-
-bool ObjCStubsSection::isObjCStubSymbol(Symbol *sym) {
- return sym->getName().starts_with(symbolPrefix);
-}
-
-StringRef ObjCStubsSection::getMethname(Symbol *sym) {
- assert(isObjCStubSymbol(sym) && "not an objc stub");
- auto name = sym->getName();
- StringRef methname = name.drop_front(symbolPrefix.size());
- return methname;
+ObjCSelRefsSection::ObjCSelRefsSection()
+ : SyntheticSection(segment_names::data, section_names::objcSelrefs) {
+ flags = S_ATTR_NO_DEAD_STRIP;
----------------
kyulee-com wrote:
Is this actually used? Perhaps not, as this section won't be written from here.
https://github.com/llvm/llvm-project/pull/83878
More information about the llvm-commits
mailing list