aboutsummaryrefslogtreecommitdiff
path: root/libexec/rtld-elf
diff options
context:
space:
mode:
authorDoug Rabson <dfr@FreeBSD.org>2005-05-19 07:32:42 +0000
committerDoug Rabson <dfr@FreeBSD.org>2005-05-19 07:32:42 +0000
commit9310a53def62d0a536eb8d27e5822832c94fa09b (patch)
treec06c71b03081b9ea014399e7965883773eaba671 /libexec/rtld-elf
parent0ff6455012ee33f2b3b64ad75fb765d2836347a9 (diff)
Notes
Diffstat (limited to 'libexec/rtld-elf')
-rw-r--r--libexec/rtld-elf/i386/rtld_start.S9
1 files changed, 6 insertions, 3 deletions
diff --git a/libexec/rtld-elf/i386/rtld_start.S b/libexec/rtld-elf/i386/rtld_start.S
index 76f1392625d7..9a6e2d5e5292 100644
--- a/libexec/rtld-elf/i386/rtld_start.S
+++ b/libexec/rtld-elf/i386/rtld_start.S
@@ -32,17 +32,20 @@
.rtld_start:
xorl %ebp,%ebp # Clear frame pointer for good form
movl %esp,%eax # Save initial stack pointer
- subl $8,%esp # A place to store exit procedure addr
+ movl %esp,%esi # Save initial stack pointer
+ andl $0xfffffff0,%esp # Align stack pointer
+ subl $16,%esp # A place to store exit procedure addr
movl %esp,%ebx # save address of exit proc
movl %esp,%ecx # construct address of obj_main
addl $4,%ecx
+ subl $4,%esp # Keep stack aligned
pushl %ecx # Pass address of obj_main
pushl %ebx # Pass address of exit proc
pushl %eax # Pass initial stack pointer to rtld
call _rtld@PLT # Call rtld(sp); returns entry point
- addl $12,%esp # Remove arguments from stack
+ addl $16,%esp # Remove arguments from stack
popl %edx # Get exit procedure address
- addl $4,%esp # Ignore obj_main
+ movl %esi,%esp # Ignore obj_main
/*
* At this point, %eax contains the entry point of the main program, and
* %edx contains a pointer to a termination function that should be