From: Fariborz Jahanian Date: Sat, 28 Feb 2009 00:54:00 +0000 (+0000) Subject: Alignment of pointers in __objc_classlist must be on their X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5a1edf6c0dc70bd555e51bedba782da8e3552f94;p=clang Alignment of pointers in __objc_classlist must be on their natural alignment. Otherwise, the excess hole confuses the objc2 runtime (this is darwin specific). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65666 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index 6a806a3371..3beb91a29e 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -3394,6 +3394,8 @@ void CGObjCNonFragileABIMac::FinishNonFragileABIModule() { Init, "\01L_OBJC_LABEL_CLASS_$", &CGM.getModule()); + GV->setAlignment( + CGM.getTargetData().getPrefTypeAlignment(ObjCTypes.Int8PtrTy)); GV->setSection("__DATA, __objc_classlist, regular, no_dead_strip"); UsedGlobals.push_back(GV); }