Author: dim
Date: Tue Apr  2 17:51:28 2019
New Revision: 345806
URL: https://svnweb.freebsd.org/changeset/base/345806

Log:
  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
  MFC after:    3 days

Modified:
  head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp

Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp
==============================================================================
--- head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp     Tue Apr  2 
14:46:10 2019        (r345805)
+++ head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp     Tue Apr  2 
17:51:28 2019        (r345806)
@@ -1519,7 +1519,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);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to