aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bitcoin-util.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bitcoin-util.cpp b/src/bitcoin-util.cpp
index b702a68bdf..30b8098716 100644
--- a/src/bitcoin-util.cpp
+++ b/src/bitcoin-util.cpp
@@ -181,7 +181,16 @@ static int CommandLineUtil(int argc, char* argv[])
return nRet;
}
+#ifdef WIN32
+// Export main() and ensure working ASLR on Windows.
+// Exporting a symbol will prevent the linker from stripping
+// the .reloc section from the binary, which is a requirement
+// for ASLR. This is a temporary workaround until a fixed
+// version of binutils is used for releases.
+__declspec(dllexport) int main(int argc, char* argv[])
+#else
int main(int argc, char* argv[])
+#endif
{
SetupEnvironment();