From 88db195695215e920a63e197517103b4b9744445 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Fri, 31 Mar 2023 20:31:16 -0700 Subject: [PATCH] [ORC][MachO] __objc_imageinfo isn't a MachO "object platform section". 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 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp b/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp index 4266bbc..10364e4 100644 --- a/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp +++ b/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp @@ -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) { -- 2.7.4