diff options
| author | matt <matt@NetBSD.org> | 2007-02-23 01:17:11 +0000 |
|---|---|---|
| committer | matt <matt@NetBSD.org> | 2007-02-23 01:17:11 +0000 |
| commit | ee98d74a6be27b09dfb480f75cf055b6503d710a (patch) | |
| tree | 04f085395676a636ae55db0378df5faa2152604e /libexec | |
| parent | 364993dede31ef09a3a2200cf3b944ec5e984c70 (diff) | |
Remove MD COMBRELOC support since it's now MI.
Enable COMBRELOC for all arches
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/ld.elf_so/Makefile | 3 | ||||
| -rw-r--r-- | libexec/ld.elf_so/arch/alpha/alpha_reloc.c | 26 | ||||
| -rw-r--r-- | libexec/ld.elf_so/arch/i386/mdreloc.c | 42 | ||||
| -rw-r--r-- | libexec/ld.elf_so/arch/sparc64/mdreloc.c | 23 | ||||
| -rw-r--r-- | libexec/ld.elf_so/arch/x86_64/mdreloc.c | 64 |
5 files changed, 39 insertions, 119 deletions
diff --git a/libexec/ld.elf_so/Makefile b/libexec/ld.elf_so/Makefile index 82a28bc57ca..d9d45b52231 100644 --- a/libexec/ld.elf_so/Makefile +++ b/libexec/ld.elf_so/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.75 2006/08/27 07:22:02 simonb Exp $ +# $NetBSD: Makefile,v 1.76 2007/02/23 01:17:11 matt Exp $ .include <bsd.own.mk> # for OBJECT_FMT definition .include <bsd.shlib.mk> # for SHLINKINSTALLDIR definition @@ -43,6 +43,7 @@ CPPFLAGS+= -DLIBDIR=\"${LIBDIR}\" -D_PATH_RTLD=\"${BINDIR}/${PROG}\" CPPFLAGS+= -I${.CURDIR} CPPFLAGS+= -DRTLD_LOADER CPPFLAGS+= -D_RTLD_SOURCE +CPPFLAGS+= -DCOMBRELOC #CPPFLAGS+= -DDEBUG #CPPFLAGS+= -DRTLD_DEBUG #CPPFLAGS+= -DRTLD_DEBUG_RELOC diff --git a/libexec/ld.elf_so/arch/alpha/alpha_reloc.c b/libexec/ld.elf_so/arch/alpha/alpha_reloc.c index 3b29105bcc8..c8f9f2e1225 100644 --- a/libexec/ld.elf_so/arch/alpha/alpha_reloc.c +++ b/libexec/ld.elf_so/arch/alpha/alpha_reloc.c @@ -1,4 +1,4 @@ -/* $NetBSD: alpha_reloc.c,v 1.29 2005/12/24 20:59:30 perry Exp $ */ +/* $NetBSD: alpha_reloc.c,v 1.30 2007/02/23 01:17:11 matt Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -62,7 +62,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: alpha_reloc.c,v 1.29 2005/12/24 20:59:30 perry Exp $"); +__RCSID("$NetBSD: alpha_reloc.c,v 1.30 2007/02/23 01:17:11 matt Exp $"); #endif /* not lint */ #include <sys/types.h> @@ -199,10 +199,6 @@ int _rtld_relocate_nonplt_objects(const Obj_Entry *obj) { const Elf_Rela *rela; -#define COMBRELOC -#ifdef COMBRELOC - unsigned long lastsym = -1; -#endif Elf_Addr target = -1; for (rela = obj->rela; rela < obj->relalim; rela++) { @@ -221,19 +217,11 @@ _rtld_relocate_nonplt_objects(const Obj_Entry *obj) case R_TYPE(REFQUAD): case R_TYPE(GLOB_DAT): -#ifdef COMBRELOC - if (symnum != lastsym) { -#endif - def = _rtld_find_symdef(symnum, obj, &defobj, - false); - if (def == NULL) - return -1; - target = (Elf_Addr)(defobj->relocbase + - def->st_value); -#ifdef COMBRELOC - lastsym = symnum; - } -#endif + def = _rtld_find_symdef(symnum, obj, &defobj, false); + if (def == NULL) + return -1; + target = (Elf_Addr)(defobj->relocbase + + def->st_value); tmp = target + rela->r_addend; if (__predict_true(RELOC_ALIGNED_P(where))) { diff --git a/libexec/ld.elf_so/arch/i386/mdreloc.c b/libexec/ld.elf_so/arch/i386/mdreloc.c index e3003dcc243..6d6c3ef3397 100644 --- a/libexec/ld.elf_so/arch/i386/mdreloc.c +++ b/libexec/ld.elf_so/arch/i386/mdreloc.c @@ -1,8 +1,8 @@ -/* $NetBSD: mdreloc.c,v 1.22 2006/03/18 23:09:34 christos Exp $ */ +/* $NetBSD: mdreloc.c,v 1.23 2007/02/23 01:17:11 matt Exp $ */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: mdreloc.c,v 1.22 2006/03/18 23:09:34 christos Exp $"); +__RCSID("$NetBSD: mdreloc.c,v 1.23 2007/02/23 01:17:11 matt Exp $"); #endif /* not lint */ #include <sys/types.h> @@ -52,10 +52,6 @@ int _rtld_relocate_nonplt_objects(const Obj_Entry *obj) { const Elf_Rel *rel; -#define COMBRELOC -#ifdef COMBRELOC - unsigned long lastsym = -1; -#endif Elf_Addr target = 0; for (rel = obj->rel; rel < obj->rellim; rel++) { @@ -74,19 +70,10 @@ _rtld_relocate_nonplt_objects(const Obj_Entry *obj) #if 1 /* XXX should not occur */ case R_TYPE(PC32): -#ifdef COMBRELOC - if (symnum != lastsym) { -#endif - def = _rtld_find_symdef(symnum, obj, &defobj, - false); - if (def == NULL) - return -1; - target = (Elf_Addr)(defobj->relocbase + - def->st_value); -#ifdef COMBRELOC - lastsym = symnum; - } -#endif + def = _rtld_find_symdef(symnum, obj, &defobj, false); + if (def == NULL) + return -1; + target = (Elf_Addr)(defobj->relocbase + def->st_value); *where += target - (Elf_Addr)where; rdbg(("PC32 %s in %s --> %p in %s", @@ -98,19 +85,10 @@ _rtld_relocate_nonplt_objects(const Obj_Entry *obj) #endif case R_TYPE(32): case R_TYPE(GLOB_DAT): -#ifdef COMBRELOC - if (symnum != lastsym) { -#endif - def = _rtld_find_symdef(symnum, obj, &defobj, - false); - if (def == NULL) - return -1; - target = (Elf_Addr)(defobj->relocbase + - def->st_value); -#ifdef COMBRELOC - lastsym = symnum; - } -#endif + def = _rtld_find_symdef(symnum, obj, &defobj, false); + if (def == NULL) + return -1; + target = (Elf_Addr)(defobj->relocbase + def->st_value); tmp = target + *where; if (*where != tmp) diff --git a/libexec/ld.elf_so/arch/sparc64/mdreloc.c b/libexec/ld.elf_so/arch/sparc64/mdreloc.c index 21368d71874..1667ba2d7de 100644 --- a/libexec/ld.elf_so/arch/sparc64/mdreloc.c +++ b/libexec/ld.elf_so/arch/sparc64/mdreloc.c @@ -1,4 +1,4 @@ -/* $NetBSD: mdreloc.c,v 1.40 2007/02/15 19:42:13 martin Exp $ */ +/* $NetBSD: mdreloc.c,v 1.41 2007/02/23 01:17:11 matt Exp $ */ /*- * Copyright (c) 2000 Eduardo Horvath. @@ -39,7 +39,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: mdreloc.c,v 1.40 2007/02/15 19:42:13 martin Exp $"); +__RCSID("$NetBSD: mdreloc.c,v 1.41 2007/02/23 01:17:11 matt Exp $"); #endif /* not lint */ #include <errno.h> @@ -307,10 +307,6 @@ int _rtld_relocate_nonplt_objects(const Obj_Entry *obj) { const Elf_Rela *rela; -#define COMBRELOC -#ifdef COMBRELOC - unsigned long lastsym = -1; -#endif const Elf_Sym *def = NULL; const Obj_Entry *defobj = NULL; @@ -357,17 +353,10 @@ _rtld_relocate_nonplt_objects(const Obj_Entry *obj) if (RELOC_RESOLVE_SYMBOL(type)) { /* Find the symbol */ -#ifdef COMBRELOC - if (symnum != lastsym) { -#endif - def = _rtld_find_symdef(symnum, obj, &defobj, - false); - if (def == NULL) - return -1; -#ifdef COMBRELOC - lastsym = symnum; - } -#endif + def = _rtld_find_symdef(symnum, obj, &defobj, + false); + if (def == NULL) + return -1; /* Add in the symbol's absolute address */ value += (Elf_Addr)(defobj->relocbase + def->st_value); diff --git a/libexec/ld.elf_so/arch/x86_64/mdreloc.c b/libexec/ld.elf_so/arch/x86_64/mdreloc.c index 289e15798fe..356106982a7 100644 --- a/libexec/ld.elf_so/arch/x86_64/mdreloc.c +++ b/libexec/ld.elf_so/arch/x86_64/mdreloc.c @@ -1,4 +1,4 @@ -/* $NetBSD: mdreloc.c,v 1.28 2007/02/15 15:44:28 skrll Exp $ */ +/* $NetBSD: mdreloc.c,v 1.29 2007/02/23 01:17:11 matt Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -68,7 +68,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: mdreloc.c,v 1.28 2007/02/15 15:44:28 skrll Exp $"); +__RCSID("$NetBSD: mdreloc.c,v 1.29 2007/02/23 01:17:11 matt Exp $"); #endif /* not lint */ #include <sys/types.h> @@ -131,10 +131,6 @@ int _rtld_relocate_nonplt_objects(const Obj_Entry *obj) { const Elf_Rela *rela; -#define COMBRELOC -#ifdef COMBRELOC - unsigned long lastsym = -1; -#endif const Elf_Sym *def = NULL; const Obj_Entry *defobj =NULL; @@ -156,17 +152,9 @@ _rtld_relocate_nonplt_objects(const Obj_Entry *obj) case R_TYPE(32): /* word32 S + A, truncate */ case R_TYPE(32S): /* word32 S + A, signed truncate */ case R_TYPE(GOT32): /* word32 G + A (XXX can we see these?) */ -#ifdef COMBRELOC - if (symnum != lastsym) { -#endif - def = _rtld_find_symdef(symnum, obj, &defobj, - false); - if (def == NULL) - return -1; -#ifdef COMBRELOC - lastsym = symnum; - } -#endif + def = _rtld_find_symdef(symnum, obj, &defobj, false); + if (def == NULL) + return -1; tmp32 = (Elf32_Addr)(u_long)(defobj->relocbase + def->st_value + rela->r_addend); @@ -178,17 +166,9 @@ _rtld_relocate_nonplt_objects(const Obj_Entry *obj) defobj->path)); break; case R_TYPE(64): /* word64 S + A */ -#ifdef COMBRELOC - if (symnum != lastsym) { -#endif - def = _rtld_find_symdef(symnum, obj, &defobj, - false); - if (def == NULL) - return -1; -#ifdef COMBRELOC - lastsym = symnum; - } -#endif + def = _rtld_find_symdef(symnum, obj, &defobj, false); + if (def == NULL) + return -1; tmp64 = (Elf64_Addr)(defobj->relocbase + def->st_value + rela->r_addend); @@ -199,17 +179,9 @@ _rtld_relocate_nonplt_objects(const Obj_Entry *obj) obj->path, (void *)*where64, defobj->path)); break; case R_TYPE(PC32): /* word32 S + A - P */ -#ifdef COMBRELOC - if (symnum != lastsym) { -#endif - def = _rtld_find_symdef(symnum, obj, &defobj, - false); - if (def == NULL) - return -1; -#ifdef COMBRELOC - lastsym = symnum; - } -#endif + def = _rtld_find_symdef(symnum, obj, &defobj, false); + if (def == NULL) + return -1; tmp32 = (Elf32_Addr)(u_long)(defobj->relocbase + def->st_value + rela->r_addend - (Elf64_Addr)where64); @@ -221,17 +193,9 @@ _rtld_relocate_nonplt_objects(const Obj_Entry *obj) defobj->path)); break; case R_TYPE(GLOB_DAT): /* word64 S */ -#ifdef COMBRELOC - if (symnum != lastsym) { -#endif - def = _rtld_find_symdef(symnum, obj, &defobj, - false); - if (def == NULL) - return -1; -#ifdef COMBRELOC - lastsym = symnum; - } -#endif + def = _rtld_find_symdef(symnum, obj, &defobj, false); + if (def == NULL) + return -1; tmp64 = (Elf64_Addr)(defobj->relocbase + def->st_value); if (*where64 != tmp64) |
