summaryrefslogtreecommitdiffstats
path: root/libc/arch-common
diff options
context:
space:
mode:
authorPavel Chupin <pavel.v.chupin@intel.com>2013-10-21 20:20:53 +0400
committerElliott Hughes <enh@google.com>2013-10-21 17:36:28 -0700
commit33a209e57595fbb7934fcc4606d2b0dd0de688ad (patch)
tree6616eec2a39fbe149e5ea794484299aead39a6ad /libc/arch-common
parentf4ac8ba566d80679ccc346b3b0af4b46d394319b (diff)
downloadbionic-33a209e57595fbb7934fcc4606d2b0dd0de688ad.zip
bionic-33a209e57595fbb7934fcc4606d2b0dd0de688ad.tar.gz
bionic-33a209e57595fbb7934fcc4606d2b0dd0de688ad.tar.bz2
Fix 16-byte stack alignment requirement for x86_64 ABI
Change-Id: I43304803ac54c8688c61688bd96c7160614172d4 Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
Diffstat (limited to 'libc/arch-common')
-rw-r--r--libc/arch-common/bionic/crtbegin.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libc/arch-common/bionic/crtbegin.c b/libc/arch-common/bionic/crtbegin.c
index bc67bfb..fa9f3f3 100644
--- a/libc/arch-common/bionic/crtbegin.c
+++ b/libc/arch-common/bionic/crtbegin.c
@@ -50,6 +50,10 @@ void _start() {
array.fini_array = &__FINI_ARRAY__;
void* raw_args = (void*) ((uintptr_t) __builtin_frame_address(0) + sizeof(void*));
+#ifdef __x86_64__
+ // 16-byte stack alignment is required by x86_64 ABI
+ asm("andq $~15, %rsp");
+#endif
__libc_init(raw_args, NULL, &main, &array);
}