svn commit: r345952 - in stable: 11/contrib/llvm/tools/clang/lib/CodeGen 12/contrib/llvm/tools/clang/lib/CodeGen

Dimitry Andric dim at FreeBSD.org
Fri Apr 5 16:09:25 UTC 2019


Author: dim
Date: Fri Apr  5 16:09:23 2019
New Revision: 345952
URL: https://svnweb.freebsd.org/changeset/base/345952

Log:
  MFC r345806:
  
  Pull in r357362 from upstream clang trunk (by David Chisnall):
  
    [objc-gnustep] Use .init_array not .ctors when requested.
  
    This doesn't make a difference most of the time but FreeBSD/ARM
    doesn't run anything in the .ctors array.
  
  This should help with updating the libobjc2 port for armv7.
  
  Requested by:	theraven
  Upstream PR:	https://github.com/gnustep/libobjc2/issues/83

Modified:
  stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp
==============================================================================
--- stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp	Fri Apr  5 15:53:27 2019	(r345951)
+++ stable/11/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp	Fri Apr  5 16:09:23 2019	(r345952)
@@ -1508,7 +1508,12 @@ class CGObjCGNUstep2 : public CGObjCGNUstep {
     if (CGM.getTriple().isOSBinFormatCOFF())
         InitVar->setSection(".CRT$XCLz");
     else
-      InitVar->setSection(".ctors");
+    {
+      if (CGM.getCodeGenOpts().UseInitArray)
+        InitVar->setSection(".init_array");
+      else
+        InitVar->setSection(".ctors");
+    }
     InitVar->setVisibility(llvm::GlobalValue::HiddenVisibility);
     InitVar->setComdat(TheModule.getOrInsertComdat(".objc_ctor"));
     CGM.addUsedGlobal(InitVar);


More information about the svn-src-all mailing list