summaryrefslogtreecommitdiff
path: root/src/pal
diff options
context:
space:
mode:
authorJonghyun Park <parjong@gmail.com>2016-12-14 11:15:21 +0900
committerJan Kotas <jkotas@microsoft.com>2016-12-13 18:15:21 -0800
commitdb529508a0623def4da3baa7175f4c654d3d6fbd (patch)
tree3fb1e63b6e8cb52c18ab1bb2c87ca2ad262d2c43 /src/pal
parent24c23c2649a0eec7621466626a5a637daca10337 (diff)
downloadcoreclr-db529508a0623def4da3baa7175f4c654d3d6fbd.tar.gz
coreclr-db529508a0623def4da3baa7175f4c654d3d6fbd.tar.bz2
coreclr-db529508a0623def4da3baa7175f4c654d3d6fbd.zip
[x86/Linux] Enforce 16-byte stack alignment (#8587)
Clang (and GCC) requires 16-byte stack alignment, but the current implementation of CallDescrInternal and ThePreStub does not provide any guarantee on stack alignment. This commit adds 16-byte stack alignment adjust code inside these functions.
Diffstat (limited to 'src/pal')
-rw-r--r--src/pal/inc/unixasmmacrosx86.inc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pal/inc/unixasmmacrosx86.inc b/src/pal/inc/unixasmmacrosx86.inc
index 6e7254e1b1..77b3a63484 100644
--- a/src/pal/inc/unixasmmacrosx86.inc
+++ b/src/pal/inc/unixasmmacrosx86.inc
@@ -76,3 +76,12 @@ C_FUNC(\Name\()_End):
movl C_FUNC(\Name)@GOT(%\Reg), %\Reg
.intel_syntax noprefix
.endm
+
+.macro CHECK_STACK_ALIGNMENT
+#ifdef _DEBUG
+ test esp, 0Fh
+ je 0f
+ int3
+0:
+#endif // _DEBUG
+.endm