* keep stack aligned when using profiler stubs

git-svn-id: trunk@38320 -
This commit is contained in:
florian 2018-02-23 19:35:20 +00:00
parent 048c2c09fd
commit 92776e1864
2 changed files with 4 additions and 0 deletions

View File

@ -42,6 +42,7 @@ _start:
movq %rdx, %r9 /* Address of the shared library termination
function. */
popq %rsi /* Pop the argument count. */
pushq %rsi /* keep stack aligned */
movq %rsp, %rdx /* argv starts just at the current stack top. */
movq entryinfo@GOTPCREL(%rip),%r10 /* load address of entryinfo variable */
@ -142,6 +143,7 @@ _haltproc:
movq ___fpc_ret_rbp@GOTPCREL(%rip),%rcx
movq (%rcx),%rbp
movq ___fpc_ret@GOTPCREL(%rip),%rcx
popq %rdx
movq (%rcx),%rdx
pushq %rdx
ret

View File

@ -88,6 +88,7 @@ procedure ini_dummy;
movq %rdx, %r9 { Address of the shared library termination
function. }
popq %rsi { Pop the argument count. }
pushq %rsi { keep stack aligned }
movq %rsp, %rdx { argv starts just at the current stack top. }
{$ifdef FPC_HAS_INDIRECT_ENTRY_INFORMATION}
@ -200,6 +201,7 @@ procedure main_stub; assembler; nostackframe;
procedure _FPC_libc_haltproc(e:longint); assembler; nostackframe; public name '_haltproc';
asm
movl %edi,%eax
popq %rdx { keep stack aligned }
movq fpc_ret(%rip),%rdx { return to libc }
movq fpc_ret_rbp(%rip),%rbp
pushq %rdx