summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorfvdl <fvdl@NetBSD.org>2001-06-20 17:58:16 +0000
committerfvdl <fvdl@NetBSD.org>2001-06-20 17:58:16 +0000
commitb13cc91d3140c54da1e6a69d9406faecbec6ea80 (patch)
tree8e9e406fc0468a31332786b4d517ba0686cdb966 /libexec
parente55b167011c11295bb1b27b0325f38a81db10e40 (diff)
Get stack layout right.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ld.elf_so/arch/x86_64/rtld_start.S13
1 files changed, 11 insertions, 2 deletions
diff --git a/libexec/ld.elf_so/arch/x86_64/rtld_start.S b/libexec/ld.elf_so/arch/x86_64/rtld_start.S
index 818fd1bd420..0f92d74fca8 100644
--- a/libexec/ld.elf_so/arch/x86_64/rtld_start.S
+++ b/libexec/ld.elf_so/arch/x86_64/rtld_start.S
@@ -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 @@ _rtld_bind_start: # (obj, reloff)
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 @@ _rtld_bind_start: # (obj, reloff)
popq %rax
popfq
+ leaq 8(%rsp),%rsp
+
ret