Partly fix this port -- still needs a self-reloc function.

This commit is contained in:
mycroft 2002-09-25 08:37:57 +00:00
parent a9c999925c
commit 23b2275ee8
2 changed files with 8 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mdreloc.c,v 1.17 2002/09/12 22:56:31 mycroft Exp $ */
/* $NetBSD: mdreloc.c,v 1.18 2002/09/25 08:37:57 mycroft Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@ -82,6 +82,7 @@
#include "rtld.h"
void _rtld_bind_start(void);
caddr_t _rtld_bind __P((const Obj_Entry *, Elf_Word));
void
_rtld_setup_pltgot(const Obj_Entry *obj)
@ -221,12 +222,12 @@ _rtld_relocate_plt_lazy(obj)
return 0;
}
int
_rtld_relocate_plt_object(obj, rela, addrp)
caddr_t
_rtld_bind(obj, reloff)
const Obj_Entry *obj;
const Elf_Rela *rela;
caddr_t *addrp;
Elf_Word reloff;
{
const Elf_Rela *rela = obj->pltrela + reloff;
Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
Elf_Addr new_value;
const Elf_Sym *def;
@ -245,6 +246,5 @@ _rtld_relocate_plt_object(obj, rela, addrp)
if (*where != new_value)
*where = new_value;
*addrp = (caddr_t)(new_value - rela->r_addend);
return 0;
return (caddr_t)(new_value - rela->r_addend);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtld_start.S,v 1.3 2001/12/14 21:33:59 fvdl Exp $ */
/* $NetBSD: rtld_start.S,v 1.4 2002/09/25 08:37:57 mycroft Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@ -70,10 +70,6 @@ _rtld_bind_start: # (obj, reloff)
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,88(%rsp) # store function in obj