Remove the `self' args to _rtld_relocate_objects() and

_rtld_relocate_nonplt_objects().
This commit is contained in:
mycroft 2002-09-26 20:42:10 +00:00
parent 7d4bbc7f4e
commit 1c495430dd
14 changed files with 32 additions and 65 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: alpha_reloc.c,v 1.21 2002/09/25 07:27:51 mycroft Exp $ */ /* $NetBSD: alpha_reloc.c,v 1.22 2002/09/26 20:42:10 mycroft Exp $ */
/* /*
* Copyright (c) 2001 Wasabi Systems, Inc. * Copyright (c) 2001 Wasabi Systems, Inc.
@ -191,9 +191,8 @@ _rtld_relocate_nonplt_self(dynp, relocbase)
} }
int int
_rtld_relocate_nonplt_objects(obj, self) _rtld_relocate_nonplt_objects(obj)
const Obj_Entry *obj; const Obj_Entry *obj;
bool self;
{ {
const Elf_Rela *rela; const Elf_Rela *rela;
#define COMBRELOC #define COMBRELOC
@ -202,9 +201,6 @@ _rtld_relocate_nonplt_objects(obj, self)
#endif #endif
Elf_Addr target; Elf_Addr target;
if (self)
return 0;
for (rela = obj->rela; rela < obj->relalim; rela++) { for (rela = obj->rela; rela < obj->relalim; rela++) {
Elf_Addr *where; Elf_Addr *where;
const Elf_Sym *def; const Elf_Sym *def;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mdreloc.c,v 1.18 2002/09/25 07:27:51 mycroft Exp $ */ /* $NetBSD: mdreloc.c,v 1.19 2002/09/26 20:42:11 mycroft Exp $ */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -68,15 +68,11 @@ store_ptr(void *where, Elf_Addr val)
} }
int int
_rtld_relocate_nonplt_objects(obj, self) _rtld_relocate_nonplt_objects(obj)
const Obj_Entry *obj; const Obj_Entry *obj;
bool self;
{ {
const Elf_Rel *rel; const Elf_Rel *rel;
if (self)
return 0;
for (rel = obj->rel; rel < obj->rellim; rel++) { for (rel = obj->rel; rel < obj->rellim; rel++) {
Elf_Addr *where; Elf_Addr *where;
const Elf_Sym *def; const Elf_Sym *def;

View File

@ -1,4 +1,4 @@
/* $NetBSD: hppa_reloc.c,v 1.14 2002/09/12 22:56:29 mycroft Exp $ */ /* $NetBSD: hppa_reloc.c,v 1.15 2002/09/26 20:42:11 mycroft Exp $ */
/*- /*-
* Copyright (c) 2002 The NetBSD Foundation, Inc. * Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -321,9 +321,8 @@ _rtld_setup_pltgot(const Obj_Entry *obj)
} }
int int
_rtld_relocate_nonplt_objects(obj, self) _rtld_relocate_nonplt_objects(obj)
const Obj_Entry *obj; const Obj_Entry *obj;
bool self;
{ {
const Elf_Rela *rela; const Elf_Rela *rela;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mdreloc.c,v 1.16 2002/09/25 07:27:52 mycroft Exp $ */ /* $NetBSD: mdreloc.c,v 1.17 2002/09/26 20:42:11 mycroft Exp $ */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -44,9 +44,8 @@ _rtld_relocate_nonplt_self(dynp, relocbase)
} }
int int
_rtld_relocate_nonplt_objects(obj, self) _rtld_relocate_nonplt_objects(obj)
const Obj_Entry *obj; const Obj_Entry *obj;
bool self;
{ {
const Elf_Rel *rel; const Elf_Rel *rel;
#define COMBRELOC #define COMBRELOC
@ -55,9 +54,6 @@ _rtld_relocate_nonplt_objects(obj, self)
#endif #endif
Elf_Addr target; Elf_Addr target;
if (self)
return 0;
for (rel = obj->rel; rel < obj->rellim; rel++) { for (rel = obj->rel; rel < obj->rellim; rel++) {
Elf_Addr *where; Elf_Addr *where;
const Elf_Sym *def; const Elf_Sym *def;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mdreloc.c,v 1.14 2002/09/25 07:27:52 mycroft Exp $ */ /* $NetBSD: mdreloc.c,v 1.15 2002/09/26 20:42:11 mycroft Exp $ */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -44,15 +44,11 @@ _rtld_relocate_nonplt_self(dynp, relocbase)
} }
int int
_rtld_relocate_nonplt_objects(obj, self) _rtld_relocate_nonplt_objects(obj)
const Obj_Entry *obj; const Obj_Entry *obj;
bool self;
{ {
const Elf_Rela *rela; const Elf_Rela *rela;
if (self)
return 0;
for (rela = obj->rela; rela < obj->relalim; rela++) { for (rela = obj->rela; rela < obj->relalim; rela++) {
Elf_Addr *where; Elf_Addr *where;
const Elf_Sym *def; const Elf_Sym *def;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ppc_reloc.c,v 1.30 2002/09/26 03:25:29 mycroft Exp $ */ /* $NetBSD: ppc_reloc.c,v 1.31 2002/09/26 20:42:11 mycroft Exp $ */
/*- /*-
* Copyright (C) 1998 Tsubai Masanari * Copyright (C) 1998 Tsubai Masanari
@ -113,15 +113,11 @@ _rtld_relocate_nonplt_self(dynp, relocbase)
} }
int int
_rtld_relocate_nonplt_objects(obj, self) _rtld_relocate_nonplt_objects(obj)
const Obj_Entry *obj; const Obj_Entry *obj;
bool self;
{ {
const Elf_Rela *rela; const Elf_Rela *rela;
if (self)
return 0;
for (rela = obj->rela; rela < obj->relalim; rela++) { for (rela = obj->rela; rela < obj->relalim; rela++) {
Elf_Addr *where; Elf_Addr *where;
const Elf_Sym *def; const Elf_Sym *def;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mdreloc.c,v 1.12 2002/09/12 22:56:31 mycroft Exp $ */ /* $NetBSD: mdreloc.c,v 1.13 2002/09/26 20:42:12 mycroft Exp $ */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -16,9 +16,8 @@ _rtld_setup_pltgot(const Obj_Entry *obj)
} }
int int
_rtld_relocate_nonplt_objects(obj, self) _rtld_relocate_nonplt_objects(obj)
const Obj_Entry *obj; const Obj_Entry *obj;
bool self;
{ {
const Elf_Rela *rela; const Elf_Rela *rela;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mdreloc.c,v 1.31 2002/09/26 02:51:27 mycroft Exp $ */ /* $NetBSD: mdreloc.c,v 1.32 2002/09/26 20:42:12 mycroft Exp $ */
/*- /*-
* Copyright (c) 1999, 2002 The NetBSD Foundation, Inc. * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc.
@ -212,15 +212,11 @@ _rtld_relocate_nonplt_self(dynp, relocbase)
} }
int int
_rtld_relocate_nonplt_objects(obj, self) _rtld_relocate_nonplt_objects(obj)
const Obj_Entry *obj; const Obj_Entry *obj;
bool self;
{ {
const Elf_Rela *rela; const Elf_Rela *rela;
if (self)
return (0);
for (rela = obj->rela; rela < obj->relalim; rela++) { for (rela = obj->rela; rela < obj->relalim; rela++) {
Elf_Addr *where; Elf_Addr *where;
Elf_Word type, value, mask; Elf_Word type, value, mask;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mdreloc.c,v 1.30 2002/09/26 02:25:57 mycroft Exp $ */ /* $NetBSD: mdreloc.c,v 1.31 2002/09/26 20:42:12 mycroft Exp $ */
/*- /*-
* Copyright (c) 2000 Eduardo Horvath. * Copyright (c) 2000 Eduardo Horvath.
@ -301,15 +301,11 @@ _rtld_relocate_nonplt_self(dynp, relocbase)
} }
int int
_rtld_relocate_nonplt_objects(obj, self) _rtld_relocate_nonplt_objects(obj)
const Obj_Entry *obj; const Obj_Entry *obj;
bool self;
{ {
const Elf_Rela *rela; const Elf_Rela *rela;
if (self)
return (0);
for (rela = obj->rela; rela < obj->relalim; rela++) { for (rela = obj->rela; rela < obj->relalim; rela++) {
Elf_Addr *where; Elf_Addr *where;
Elf_Word type; Elf_Word type;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mdreloc.c,v 1.13 2002/09/25 07:27:55 mycroft Exp $ */ /* $NetBSD: mdreloc.c,v 1.14 2002/09/26 20:42:12 mycroft Exp $ */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -17,9 +17,8 @@ _rtld_setup_pltgot(const Obj_Entry *obj)
} }
int int
_rtld_relocate_nonplt_objects(obj, self) _rtld_relocate_nonplt_objects(obj)
const Obj_Entry *obj; const Obj_Entry *obj;
bool self;
{ {
const Elf_Rela *rela; const Elf_Rela *rela;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mdreloc.c,v 1.18 2002/09/25 08:37:57 mycroft Exp $ */ /* $NetBSD: mdreloc.c,v 1.19 2002/09/26 20:42:12 mycroft Exp $ */
/* /*
* Copyright (c) 2001 Wasabi Systems, Inc. * Copyright (c) 2001 Wasabi Systems, Inc.
@ -92,9 +92,8 @@ _rtld_setup_pltgot(const Obj_Entry *obj)
} }
int int
_rtld_relocate_nonplt_objects(obj, self) _rtld_relocate_nonplt_objects(obj)
const Obj_Entry *obj; const Obj_Entry *obj;
bool self;
{ {
const Elf_Rela *rela; const Elf_Rela *rela;

View File

@ -1,4 +1,4 @@
/* $NetBSD: reloc.c,v 1.73 2002/09/25 07:27:49 mycroft Exp $ */ /* $NetBSD: reloc.c,v 1.74 2002/09/26 20:42:10 mycroft Exp $ */
/* /*
* Copyright 1996 John D. Polstra. * Copyright 1996 John D. Polstra.
@ -148,10 +148,9 @@ _rtld_do_copy_relocations(dstobj)
* or -1 on failure. * or -1 on failure.
*/ */
int int
_rtld_relocate_objects(first, bind_now, self) _rtld_relocate_objects(first, bind_now)
Obj_Entry *first; Obj_Entry *first;
bool bind_now; bool bind_now;
bool self;
{ {
Obj_Entry *obj; Obj_Entry *obj;
int ok = 1; int ok = 1;
@ -184,7 +183,7 @@ _rtld_relocate_objects(first, bind_now, self)
} }
} }
dbg(("doing non-PLT relocations")); dbg(("doing non-PLT relocations"));
if (_rtld_relocate_nonplt_objects(obj, self) < 0) if (_rtld_relocate_nonplt_objects(obj) < 0)
ok = 0; ok = 0;
if (obj->textrel) { /* Re-protected the text segment. */ if (obj->textrel) { /* Re-protected the text segment. */
if (mprotect(obj->mapbase, obj->textsize, if (mprotect(obj->mapbase, obj->textsize,

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtld.c,v 1.80 2002/09/26 20:35:56 mycroft Exp $ */ /* $NetBSD: rtld.c,v 1.81 2002/09/26 20:42:10 mycroft Exp $ */
/* /*
* Copyright 1996 John D. Polstra. * Copyright 1996 John D. Polstra.
@ -164,7 +164,7 @@ _rtld_init(mapbase, relocbase)
#endif #endif
#ifdef __vax__ #ifdef __vax__
_rtld_relocate_nonplt_objects(&_rtld_objself, true); _rtld_relocate_nonplt_objects(&_rtld_objself);
#endif #endif
_rtld_add_paths(&_rtld_default_paths, RTLD_DEFAULT_LIBRARY_PATH); _rtld_add_paths(&_rtld_default_paths, RTLD_DEFAULT_LIBRARY_PATH);
@ -413,7 +413,7 @@ _rtld(sp, relocbase)
_rtld_objlist_add(&_rtld_list_main, obj); _rtld_objlist_add(&_rtld_list_main, obj);
dbg(("relocating objects")); dbg(("relocating objects"));
if (_rtld_relocate_objects(_rtld_objmain, bind_now, false) == -1) if (_rtld_relocate_objects(_rtld_objmain, bind_now) == -1)
_rtld_die(); _rtld_die();
dbg(("doing copy relocations")); dbg(("doing copy relocations"));
@ -626,7 +626,7 @@ _rtld_dlopen(name, mode)
if (_rtld_load_needed_objects(obj, mode) == -1 || if (_rtld_load_needed_objects(obj, mode) == -1 ||
(_rtld_init_dag(obj), (_rtld_init_dag(obj),
_rtld_relocate_objects(obj, _rtld_relocate_objects(obj,
((mode & 3) == RTLD_NOW), false)) == -1) { ((mode & 3) == RTLD_NOW))) == -1) {
_rtld_unload_object(obj, false); _rtld_unload_object(obj, false);
obj->dl_refcount--; obj->dl_refcount--;
obj = NULL; obj = NULL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtld.h,v 1.59 2002/09/25 07:27:50 mycroft Exp $ */ /* $NetBSD: rtld.h,v 1.60 2002/09/26 20:42:10 mycroft Exp $ */
/* /*
* Copyright 1996 John D. Polstra. * Copyright 1996 John D. Polstra.
@ -241,8 +241,8 @@ void _rtld_process_hints __P((Search_Path **, Library_Xform **, const char *));
/* reloc.c */ /* reloc.c */
int _rtld_do_copy_relocations __P((const Obj_Entry *)); int _rtld_do_copy_relocations __P((const Obj_Entry *));
int _rtld_relocate_objects __P((Obj_Entry *, bool, bool)); int _rtld_relocate_objects __P((Obj_Entry *, bool));
int _rtld_relocate_nonplt_objects __P((const Obj_Entry *, bool)); int _rtld_relocate_nonplt_objects __P((const Obj_Entry *));
int _rtld_relocate_plt_lazy __P((const Obj_Entry *)); int _rtld_relocate_plt_lazy __P((const Obj_Entry *));
int _rtld_relocate_plt_objects __P((const Obj_Entry *)); int _rtld_relocate_plt_objects __P((const Obj_Entry *));
void _rtld_setup_pltgot __P((const Obj_Entry *)); void _rtld_setup_pltgot __P((const Obj_Entry *));