From 371ae3c0e8fcc064eae7a61d91e0b04bf6a5738e Mon Sep 17 00:00:00 2001 From: Vladimir Sadov Date: Mon, 13 Jul 2020 09:55:21 -0700 Subject: [PATCH] enable GS Cookie on OSX (#39143) * enable GS Cookie on OSX * Actual fix --- src/coreclr/src/vm/ceemain.cpp | 7 ------- src/coreclr/src/vm/vars.hpp | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/coreclr/src/vm/ceemain.cpp b/src/coreclr/src/vm/ceemain.cpp index 0401160ab17b2d..5c763f86039db1 100644 --- a/src/coreclr/src/vm/ceemain.cpp +++ b/src/coreclr/src/vm/ceemain.cpp @@ -484,13 +484,6 @@ void InitGSCookie() } CONTRACTL_END; -#if defined(TARGET_OSX) && defined(CORECLR_EMBEDDED) - // OSX does not like the way we change section protection when running in a superhost bundle - // disabling this for now - // https://github.com/dotnet/runtime/issues/38184 - return; -#endif - volatile GSCookie * pGSCookiePtr = GetProcessGSCookiePtr(); #ifdef TARGET_UNIX diff --git a/src/coreclr/src/vm/vars.hpp b/src/coreclr/src/vm/vars.hpp index 57ac31a285ca80..ccf9289abab04b 100644 --- a/src/coreclr/src/vm/vars.hpp +++ b/src/coreclr/src/vm/vars.hpp @@ -694,7 +694,7 @@ typedef DPTR(GSCookie) PTR_GSCookie; #define READONLY_ATTR #else #ifdef __APPLE__ -#define READONLY_ATTR_ARGS section("__TEXT,__const") +#define READONLY_ATTR_ARGS section("__DATA,__const") #else #define READONLY_ATTR_ARGS section(".rodata") #endif