[llvm] r188193 - [stackprotector] Add in the stackprotector libcall.

Michael Gottesman mgottesman at apple.com
Mon Aug 12 11:45:38 PDT 2013


Author: mgottesman
Date: Mon Aug 12 13:45:38 2013
New Revision: 188193

URL: http://llvm.org/viewvc/llvm-project?rev=188193&view=rev
Log:
[stackprotector] Add in the stackprotector libcall.

We support this libcall on all platforms except for OpenBSD (See
lib/Codegen/StackProtector.cpp).

Modified:
    llvm/trunk/include/llvm/CodeGen/RuntimeLibcalls.h
    llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp

Modified: llvm/trunk/include/llvm/CodeGen/RuntimeLibcalls.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/RuntimeLibcalls.h?rev=188193&r1=188192&r2=188193&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/RuntimeLibcalls.h (original)
+++ llvm/trunk/include/llvm/CodeGen/RuntimeLibcalls.h Mon Aug 12 13:45:38 2013
@@ -354,6 +354,9 @@ namespace RTLIB {
     SYNC_FETCH_AND_NAND_4,
     SYNC_FETCH_AND_NAND_8,
 
+    // Stack Protector Fail.
+    STACKPROTECTOR_CHECK_FAIL,
+
     UNKNOWN_LIBCALL
   };
 

Modified: llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp?rev=188193&r1=188192&r2=188193&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp (original)
+++ llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp Mon Aug 12 13:45:38 2013
@@ -361,6 +361,13 @@ static void InitLibcallNames(const char
     Names[RTLIB::SINCOS_F128] = 0;
     Names[RTLIB::SINCOS_PPCF128] = 0;
   }
+
+  if (Triple(TM.getTargetTriple()).getOS() != Triple::OpenBSD) {
+    Names[RTLIB::STACKPROTECTOR_CHECK_FAIL] = "__stack_chk_fail";
+  } else {
+    // These are generally not available.
+    Names[RTLIB::STACKPROTECTOR_CHECK_FAIL] = 0;
+  }
 }
 
 /// InitLibcallCallingConvs - Set default libcall CallingConvs.





More information about the llvm-commits mailing list