]> granicus.if.org Git - clang/commitdiff
Alignment of pointers in __objc_classlist must be on their
authorFariborz Jahanian <fjahanian@apple.com>
Sat, 28 Feb 2009 00:54:00 +0000 (00:54 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Sat, 28 Feb 2009 00:54:00 +0000 (00:54 +0000)
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

lib/CodeGen/CGObjCMac.cpp

index 6a806a33716b9ba6e622ce0a812a41db135bc1fc..3beb91a29ed3f35954feb488150382c91e75fe08 100644 (file)
@@ -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);
   }