From cd073cc2e9eb8adef732e8a2dc3e2fa362d0d411 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Sat, 28 Feb 2009 00:54:00 +0000 Subject: [PATCH] Alignment of pointers in __objc_classlist must be on their natural alignment. Otherwise, the excess hole confuses the objc2 runtime (this is darwin specific). llvm-svn: 65666 --- clang/lib/CodeGen/CGObjCMac.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index 6a806a33716b..3beb91a29ed3 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/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); }