[ORC][MachO] __objc_imageinfo isn't a MachO "object platform section".
authorLang Hames <lhames@gmail.com>
Sat, 1 Apr 2023 03:31:16 +0000 (20:31 -0700)
committerLang Hames <lhames@gmail.com>
Sat, 1 Apr 2023 03:41:32 +0000 (20:41 -0700)
Commit 2666231d173 fixed a typo ("__objc_image_info" was corrected to
"__objc_imageinfo"), but this has exposed a bug where we were adding this
section to the list of platform sections to register with the ORC runtime.
The ORC runtime's MachO "object platform section" code doesn't recognize
this section (it's handled elsewhere) and errors out on it.

The solution is simply to remove __objc_imageinfo from the list of sections
to register in MachOPlatform::PlatformPlugin::registerObjectPlatformSections.

llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp

index 4266bbc..10364e4 100644 (file)
@@ -1166,10 +1166,9 @@ Error MachOPlatform::MachOPlatformPlugin::registerObjectPlatformSections(
   // If any platform sections were found then add an allocation action to call
   // the registration function.
   StringRef PlatformSections[] = {
-      MachOModInitFuncSectionName,   MachOObjCClassListSectionName,
-      MachOObjCImageInfoSectionName, MachOObjCSelRefsSectionName,
-      MachOSwift5ProtoSectionName,   MachOSwift5ProtosSectionName,
-      MachOSwift5TypesSectionName,
+      MachOModInitFuncSectionName, MachOObjCClassListSectionName,
+      MachOObjCSelRefsSectionName, MachOSwift5ProtoSectionName,
+      MachOSwift5ProtosSectionName, MachOSwift5TypesSectionName,
   };
 
   for (auto &SecName : PlatformSections) {