diff options
author | sb <sb@openoffice.org> | 2010-02-01 09:40:00 +0100 |
---|---|---|
committer | sb <sb@openoffice.org> | 2010-02-01 09:40:00 +0100 |
commit | 02a4c1261901d32b8b7a80cd4a45273b5d096c89 (patch) | |
tree | aee4487aa4b83f7370d1083635b1af68e4a13679 /bridges | |
parent | a51028098af2f5f531a2fe87d20856c0d6a655ac (diff) |
sb119: #i108371# preserve potential 128bit stack alignment in gcc3_linux_intel UNO bridge (based on a patch by ecatmur)
Diffstat (limited to 'bridges')
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_intel/call.s | 16 | ||||
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx | 7 |
2 files changed, 18 insertions, 5 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/call.s b/bridges/source/cpp_uno/gcc3_linux_intel/call.s index f345e3a764ac..45d7c5308d30 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/call.s +++ b/bridges/source/cpp_uno/gcc3_linux_intel/call.s @@ -9,7 +9,8 @@ privateSnippetExecutorGeneral: .LCFIg0: movl %esp,%ebp .LCFIg1: - subl $0x4,%esp # 32bit returnValue + subl $0x8,%esp # 32bit returnValue, and preserve potential 128bit + # stack alignment pushl %esp # 32bit &returnValue pushl %ecx # 32bit pCallStack pushl %edx # 32bit nVtableOffset @@ -30,6 +31,7 @@ privateSnippetExecutorVoid: .LCFIv0: movl %esp,%ebp .LCFIv1: + andl $0xFFFFFFF0,%esp # preserve potential 128bit stack alignment pushl $0 # 32bit null pointer (returnValue not used) pushl %ecx # 32bit pCallStack pushl %edx # 32bit nVtableOffset @@ -49,7 +51,8 @@ privateSnippetExecutorHyper: .LCFIh0: movl %esp,%ebp .LCFIh1: - subl $0x8,%esp # 64bit returnValue + subl $0x8,%esp # 64bit returnValue (preserves potential 128bit + # stack alignment) pushl %esp # 32bit &returnValue pushl %ecx # 32bit pCallStack pushl %edx # 32bit nVtableOffset @@ -71,7 +74,8 @@ privateSnippetExecutorFloat: .LCFIf0: movl %esp,%ebp .LCFIf1: - subl $0x4,%esp # 32bit returnValue + subl $0x8,%esp # 32bit returnValue, and preserve potential 128bit + # stack alignment pushl %esp # 32bit &returnValue pushl %ecx # 32bit pCallStack pushl %edx # 32bit nVtableOffset @@ -92,7 +96,8 @@ privateSnippetExecutorDouble: .LCFId0: movl %esp,%ebp .LCFId1: - subl $0x8,%esp # 64bit returnValue + subl $0x8,%esp # 64bit returnValue (preserves potential 128bit + # stack alignment) pushl %esp # 32bit &returnValue pushl %ecx # 32bit pCallStack pushl %edx # 32bit nVtableOffset @@ -113,7 +118,8 @@ privateSnippetExecutorClass: .LCFIc0: movl %esp,%ebp .LCFIc1: - subl $0x4,%esp # 32bit returnValue + subl $0x8,%esp # 32bit returnValue, and preserve potential 128bit + # stack alignment pushl %esp # 32bit &returnValue pushl %ecx # 32bit pCallStack pushl %edx # 32bit nVtableOffset diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx index 2a88705ce01c..a02ba6b622f7 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx @@ -87,6 +87,13 @@ void callVirtualMethod( void * stackptr; asm volatile ( "mov %%esp, %6\n\t" + // preserve potential 128bit stack alignment + "and $0xfffffff0, %%esp\n\t" + "mov %0, %%eax\n\t" + "lea -4(,%%eax,4), %%eax\n\t" + "and $0xf, %%eax\n\t" + "sub $0xc, %%eax\n\t" + "add %%eax, %%esp\n\t" // copy values "mov %0, %%eax\n\t" "mov %%eax, %%edx\n\t" |