Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/ld.elf_so/arch/x86_64 Get stack layout right.



details:   https://anonhg.NetBSD.org/src/rev/4c2988e0414e
branches:  trunk
changeset: 511512:4c2988e0414e
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Wed Jun 20 17:58:16 2001 +0000

description:
Get stack layout right.

diffstat:

 libexec/ld.elf_so/arch/x86_64/rtld_start.S |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r e5da3b4477d5 -r 4c2988e0414e libexec/ld.elf_so/arch/x86_64/rtld_start.S
--- a/libexec/ld.elf_so/arch/x86_64/rtld_start.S        Wed Jun 20 17:58:05 2001 +0000
+++ b/libexec/ld.elf_so/arch/x86_64/rtld_start.S        Wed Jun 20 17:58:16 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtld_start.S,v 1.1 2001/06/19 01:11:44 fvdl Exp $      */
+/*     $NetBSD: rtld_start.S,v 1.2 2001/06/20 17:58:16 fvdl Exp $      */
 
 #include <machine/asm.h>
 
@@ -33,8 +33,15 @@
        pushq   %r10
        pushq   %r11
 
+       movq    80(%rsp),%rdi
+       movq    88(%rsp),%rsi
+       movq    %rsi,%r11               # multiply by sizeof (Elf64_Rela) (24)
+       shlq    $3,%r11
+       shlq    $4,%rsi                 # 16 * index + 8 * index = 24 * index
+       addq    %r11,%rsi
+
        call    _rtld_bind@PLT          # call the binder
-       movq    %rax,80(%rsp)           # store function in return address
+       movq    %rax,88(%rsp)           # store function in obj
 
        popq    %r11
        popq    %r10
@@ -47,4 +54,6 @@
        popq    %rax
        popfq
 
+       leaq    8(%rsp),%rsp
+
        ret



Home | Main Index | Thread Index | Old Index