Trailing whitespace
This commit is contained in:
parent
5aa71ff59a
commit
b49eab8ee4
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: debug.h,v 1.5 2002/09/12 22:56:28 mycroft Exp $ */
|
||||
/* $NetBSD: debug.h,v 1.6 2013/05/06 08:02:20 skrll Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1996 John D. Polstra.
|
||||
|
@ -35,7 +35,7 @@
|
|||
* Support for printing debugging messages.
|
||||
*/
|
||||
|
||||
#ifndef DEBUG_H
|
||||
#ifndef DEBUG_H
|
||||
#define DEBUG_H
|
||||
|
||||
|
||||
|
@ -46,7 +46,7 @@ extern void debug_printf __P((const char *, ...))
|
|||
extern int debug;
|
||||
|
||||
# define dbg(a) debug_printf a
|
||||
#else
|
||||
#else
|
||||
# define dbg(a) ((void) 0)
|
||||
#endif
|
||||
#ifdef RTLD_DEBUG_RELOC
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: expand.c,v 1.5 2008/04/28 20:23:03 martin Exp $ */
|
||||
/* $NetBSD: expand.c,v 1.6 2013/05/06 08:02:20 skrll Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
|
@ -30,7 +30,7 @@
|
|||
*/
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: expand.c,v 1.5 2008/04/28 20:23:03 martin Exp $");
|
||||
__RCSID("$NetBSD: expand.c,v 1.6 2013/05/06 08:02:20 skrll Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <ctype.h>
|
||||
|
@ -91,7 +91,7 @@ expand(char *buf, const char *execname, int what, size_t bl)
|
|||
case 3: /* OSNAME */
|
||||
case 4: /* OSREL */
|
||||
case 5: /* PLATFORM */
|
||||
len = sizeof(name);
|
||||
len = sizeof(name);
|
||||
if (sysctl(mib[what - 3], 2, name, &len, NULL, 0) == -1) {
|
||||
xwarn("sysctl");
|
||||
return 0;
|
||||
|
@ -107,7 +107,7 @@ expand(char *buf, const char *execname, int what, size_t bl)
|
|||
|
||||
return bp - buf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
size_t
|
||||
_rtld_expand_path(char *buf, size_t bufsize, const char *execname,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: headers.c,v 1.49 2013/05/06 07:54:04 skrll Exp $ */
|
||||
/* $NetBSD: headers.c,v 1.50 2013/05/06 08:02:20 skrll Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1996 John D. Polstra.
|
||||
|
@ -40,7 +40,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: headers.c,v 1.49 2013/05/06 07:54:04 skrll Exp $");
|
||||
__RCSID("$NetBSD: headers.c,v 1.50 2013/05/06 08:02:20 skrll Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <err.h>
|
||||
|
@ -257,7 +257,7 @@ _rtld_digest_dynamic(const char *execname, Obj_Entry *obj)
|
|||
break;
|
||||
|
||||
case DT_FINI_ARRAYSZ:
|
||||
obj->fini_arraysz = dynp->d_un.d_val / sizeof(fptr_t);
|
||||
obj->fini_arraysz = dynp->d_un.d_val / sizeof(fptr_t);
|
||||
dbg(("headers: DT_FINI_ARRAYZ %zu",
|
||||
obj->fini_arraysz));
|
||||
break;
|
||||
|
@ -380,7 +380,7 @@ _rtld_digest_phdr(const Elf_Phdr *phdr, int phnum, caddr_t entry)
|
|||
for (ph = phdr; ph < phlimit; ++ph) {
|
||||
if (ph->p_type != PT_PHDR)
|
||||
continue;
|
||||
|
||||
|
||||
obj->phdr = (void *)(uintptr_t)ph->p_vaddr;
|
||||
obj->phsize = ph->p_memsz;
|
||||
obj->relocbase = (caddr_t)((uintptr_t)phdr - (uintptr_t)ph->p_vaddr);
|
||||
|
@ -388,7 +388,7 @@ _rtld_digest_phdr(const Elf_Phdr *phdr, int phnum, caddr_t entry)
|
|||
obj->phdr, phdr, obj->phsize, obj->relocbase));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
for (ph = phdr; ph < phlimit; ++ph) {
|
||||
vaddr = (Elf_Addr)(uintptr_t)(obj->relocbase + ph->p_vaddr);
|
||||
switch (ph->p_type) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: load.c,v 1.42 2010/12/24 12:41:43 skrll Exp $ */
|
||||
/* $NetBSD: load.c,v 1.43 2013/05/06 08:02:20 skrll Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1996 John D. Polstra.
|
||||
|
@ -40,7 +40,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: load.c,v 1.42 2010/12/24 12:41:43 skrll Exp $");
|
||||
__RCSID("$NetBSD: load.c,v 1.43 2013/05/06 08:02:20 skrll Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <err.h>
|
||||
|
@ -68,7 +68,7 @@ Objlist _rtld_list_main = /* Objects loaded at program startup */
|
|||
SIMPLEQ_HEAD_INITIALIZER(_rtld_list_main);
|
||||
Objlist _rtld_list_global = /* Objects dlopened with RTLD_GLOBAL */
|
||||
SIMPLEQ_HEAD_INITIALIZER(_rtld_list_global);
|
||||
|
||||
|
||||
void
|
||||
_rtld_objlist_push_head(Objlist *list, Obj_Entry *obj)
|
||||
{
|
||||
|
@ -117,7 +117,7 @@ _rtld_load_object(const char *filepath, int flags)
|
|||
size_t pathlen = strlen(filepath);
|
||||
|
||||
for (obj = _rtld_objlist->next; obj != NULL; obj = obj->next)
|
||||
if (pathlen == obj->pathlen && !strcmp(obj->path, filepath))
|
||||
if (pathlen == obj->pathlen && !strcmp(obj->path, filepath))
|
||||
break;
|
||||
|
||||
/*
|
||||
|
@ -271,9 +271,9 @@ _rtld_load_by_name(const char *name, Obj_Entry *obj, Needed_Entry **needed,
|
|||
(*needed)->next = ne;
|
||||
*needed = ne;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (got)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: map_object.c,v 1.47 2013/04/25 12:28:59 skrll Exp $ */
|
||||
/* $NetBSD: map_object.c,v 1.48 2013/05/06 08:02:20 skrll Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1996 John D. Polstra.
|
||||
|
@ -34,7 +34,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: map_object.c,v 1.47 2013/04/25 12:28:59 skrll Exp $");
|
||||
__RCSID("$NetBSD: map_object.c,v 1.48 2013/05/06 08:02:20 skrll Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <errno.h>
|
||||
|
@ -204,7 +204,7 @@ _rtld_map_object(const char *path, int fd, const struct stat *sb)
|
|||
dbg(("%s: %s %p phsize %" PRImemsz, obj->path, "PT_PHDR",
|
||||
(void *)(uintptr_t)phdr->p_vaddr, phdr->p_memsz));
|
||||
break;
|
||||
|
||||
|
||||
case PT_DYNAMIC:
|
||||
obj->dynamic = (void *)(uintptr_t)phdr->p_vaddr;
|
||||
dbg(("%s: %s %p phsize %" PRImemsz, obj->path, "PT_DYNAMIC",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: paths.c,v 1.40 2009/05/19 20:44:52 christos Exp $ */
|
||||
/* $NetBSD: paths.c,v 1.41 2013/05/06 08:02:20 skrll Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1996 Matt Thomas <matt@3am-software.com>
|
||||
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: paths.c,v 1.40 2009/05/19 20:44:52 christos Exp $");
|
||||
__RCSID("$NetBSD: paths.c,v 1.41 2013/05/06 08:02:20 skrll Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <err.h>
|
||||
|
@ -228,7 +228,7 @@ _rtld_add_paths(const char *execname, Search_Path **path_p, const char *pathstr)
|
|||
|
||||
/*
|
||||
* Process library mappings of the form:
|
||||
* <library_name> <machdep_variable> <value,...:library_name,...> ...
|
||||
* <library_name> <machdep_variable> <value,...:library_name,...> ...
|
||||
*/
|
||||
static void
|
||||
_rtld_process_mapping(Library_Xform **lib_p, const char *bp, const char *ep)
|
||||
|
@ -236,7 +236,7 @@ _rtld_process_mapping(Library_Xform **lib_p, const char *bp, const char *ep)
|
|||
Library_Xform *hwptr = NULL;
|
||||
const char *ptr, *key, *ekey, *lib, *elib, *l;
|
||||
int i, j;
|
||||
|
||||
|
||||
dbg((" processing mapping \"%.*s\"", (int)(ep - bp), bp));
|
||||
|
||||
if ((ptr = getword(&bp, ep, WS)) == NULL || ptr == bp)
|
||||
|
@ -309,7 +309,7 @@ no_more:
|
|||
if (i == RTLD_MAX_ENTRY)
|
||||
goto no_more;
|
||||
if (i != j)
|
||||
(void)memcpy(hwptr->entry[i].library,
|
||||
(void)memcpy(hwptr->entry[i].library,
|
||||
hwptr->entry[j].library,
|
||||
sizeof(hwptr->entry[j].library));
|
||||
hwptr->entry[i].value = exstrdup(l, key);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rtld.c,v 1.164 2013/05/06 07:58:43 skrll Exp $ */
|
||||
/* $NetBSD: rtld.c,v 1.165 2013/05/06 08:02:20 skrll Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1996 John D. Polstra.
|
||||
|
@ -40,7 +40,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: rtld.c,v 1.164 2013/05/06 07:58:43 skrll Exp $");
|
||||
__RCSID("$NetBSD: rtld.c,v 1.165 2013/05/06 08:02:20 skrll Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -153,7 +153,7 @@ _rtld_call_fini_function(Obj_Entry *obj, sigset_t *mask, u_int cur_objgen)
|
|||
dbg (("calling fini function %s at %p%s", obj->path,
|
||||
(void *)obj->fini,
|
||||
obj->z_initfirst ? " (DF_1_INITFIRST)" : ""));
|
||||
obj->fini_called = 1;
|
||||
obj->fini_called = 1;
|
||||
_rtld_call_initfini_function(obj->fini, mask);
|
||||
}
|
||||
#ifdef HAVE_INITFINI_ARRAY
|
||||
|
@ -633,7 +633,7 @@ _rtld(Elf_Addr *sp, Elf_Addr relocbase)
|
|||
}
|
||||
|
||||
_rtld_objmain->mainprog = true;
|
||||
|
||||
|
||||
/*
|
||||
* Get the actual dynamic linker pathname from the executable if
|
||||
* possible. (It should always be possible.) That ensures that
|
||||
|
@ -644,7 +644,7 @@ _rtld(Elf_Addr *sp, Elf_Addr relocbase)
|
|||
strcmp(_rtld_objmain->interp, _rtld_objself.path) != 0)
|
||||
_rtld_objself.path = xstrdup(_rtld_objmain->interp);
|
||||
dbg(("actual dynamic linker is %s", _rtld_objself.path));
|
||||
|
||||
|
||||
_rtld_digest_dynamic(execname, _rtld_objmain);
|
||||
|
||||
/* Link the main program into the list of objects. */
|
||||
|
@ -992,7 +992,7 @@ dlopen(const char *name, int mode)
|
|||
|
||||
flags |= (mode & RTLD_GLOBAL) ? _RTLD_GLOBAL : 0;
|
||||
flags |= (mode & RTLD_NOLOAD) ? _RTLD_NOLOAD : 0;
|
||||
|
||||
|
||||
nodelete = (mode & RTLD_NODELETE) ? true : false;
|
||||
now = ((mode & RTLD_MODEMASK) == RTLD_NOW) ? true : false;
|
||||
|
||||
|
@ -1103,7 +1103,7 @@ do_dlsym(void *handle, const char *name, const Ver_Entry *ventry, void *retaddr)
|
|||
hash = _rtld_elf_hash(name);
|
||||
def = NULL;
|
||||
defobj = NULL;
|
||||
|
||||
|
||||
switch ((intptr_t)handle) {
|
||||
case (intptr_t)NULL:
|
||||
case (intptr_t)RTLD_NEXT:
|
||||
|
@ -1173,7 +1173,7 @@ do_dlsym(void *handle, const char *name, const Ver_Entry *ventry, void *retaddr)
|
|||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (def != NULL) {
|
||||
void *p;
|
||||
#ifdef __HAVE_FUNCTION_DESCRIPTORS
|
||||
|
@ -1188,7 +1188,7 @@ do_dlsym(void *handle, const char *name, const Ver_Entry *ventry, void *retaddr)
|
|||
lookup_mutex_exit();
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
_rtld_error("Undefined symbol \"%s\"", name);
|
||||
lookup_mutex_exit();
|
||||
return NULL;
|
||||
|
@ -1265,7 +1265,7 @@ dladdr(const void *addr, Dl_info *info)
|
|||
info->dli_fbase = obj->mapbase;
|
||||
info->dli_saddr = (void *)0;
|
||||
info->dli_sname = NULL;
|
||||
|
||||
|
||||
/*
|
||||
* Walk the symbol list looking for the symbol whose address is
|
||||
* closest to the address sent in.
|
||||
|
@ -1302,7 +1302,7 @@ dladdr(const void *addr, Dl_info *info)
|
|||
|
||||
#ifdef __HAVE_FUNCTION_DESCRIPTORS
|
||||
if (best_def != NULL && ELF_ST_TYPE(best_def->st_info) == STT_FUNC)
|
||||
info->dli_saddr = (void *)_rtld_function_descriptor_alloc(obj,
|
||||
info->dli_saddr = (void *)_rtld_function_descriptor_alloc(obj,
|
||||
best_def, 0);
|
||||
#endif /* __HAVE_FUNCTION_DESCRIPTORS */
|
||||
|
||||
|
@ -1473,7 +1473,7 @@ static Obj_Entry *
|
|||
_rtld_obj_from_addr(const void *addr)
|
||||
{
|
||||
Obj_Entry *obj;
|
||||
|
||||
|
||||
for (obj = _rtld_objlist; obj != NULL; obj = obj->next) {
|
||||
if (addr < (void *) obj->mapbase)
|
||||
continue;
|
||||
|
@ -1497,7 +1497,7 @@ static void
|
|||
_rtld_objlist_remove(Objlist *list, Obj_Entry *obj)
|
||||
{
|
||||
Objlist_Entry *elm;
|
||||
|
||||
|
||||
if ((elm = _rtld_objlist_find(list, obj)) != NULL) {
|
||||
SIMPLEQ_REMOVE(list, elm, Struct_Objlist_Entry, link);
|
||||
xfree(elm);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rtld.h,v 1.113 2013/04/25 14:16:37 matt Exp $ */
|
||||
/* $NetBSD: rtld.h,v 1.114 2013/05/06 08:02:20 skrll Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1996 John D. Polstra.
|
||||
|
@ -219,9 +219,9 @@ typedef struct Struct_Obj_Entry {
|
|||
mainref:1, /* True if on _rtld_list_main */
|
||||
globalref:1, /* True if on _rtld_list_global */
|
||||
init_done:1, /* True if .init has been added */
|
||||
init_called:1, /* True if .init function has been
|
||||
init_called:1, /* True if .init function has been
|
||||
* called */
|
||||
fini_called:1, /* True if .fini function has been
|
||||
fini_called:1, /* True if .fini function has been
|
||||
* called */
|
||||
z_now:1, /* True if object's symbols should be
|
||||
bound immediately */
|
||||
|
@ -410,7 +410,7 @@ const Elf_Sym *_rtld_symlook_obj(const char *, unsigned long,
|
|||
const Obj_Entry *, u_int, const Ver_Entry *);
|
||||
const Elf_Sym *_rtld_find_symdef(unsigned long, const Obj_Entry *,
|
||||
const Obj_Entry **, u_int);
|
||||
const Elf_Sym *_rtld_find_plt_symdef(unsigned long, const Obj_Entry *,
|
||||
const Elf_Sym *_rtld_find_plt_symdef(unsigned long, const Obj_Entry *,
|
||||
const Obj_Entry **, bool);
|
||||
|
||||
const Elf_Sym *_rtld_symlook_list(const char *, unsigned long,
|
||||
|
@ -471,7 +471,7 @@ Obj_Entry *_rtld_obj_new(void);
|
|||
|
||||
/* function descriptors */
|
||||
#ifdef __HAVE_FUNCTION_DESCRIPTORS
|
||||
Elf_Addr _rtld_function_descriptor_alloc(const Obj_Entry *,
|
||||
Elf_Addr _rtld_function_descriptor_alloc(const Obj_Entry *,
|
||||
const Elf_Sym *, Elf_Addr);
|
||||
const void *_rtld_function_descriptor_function(const void *);
|
||||
#endif /* __HAVE_FUNCTION_DESCRIPTORS */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rtldenv.h,v 1.11 2011/12/11 11:05:11 joerg Exp $ */
|
||||
/* $NetBSD: rtldenv.h,v 1.12 2013/05/06 08:02:20 skrll Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1996 Matt Thomas <matt@3am-software.com>
|
||||
|
@ -70,7 +70,7 @@ int xunsetenv(const char *);
|
|||
# include <assert.h>
|
||||
# include <stdio.h>
|
||||
# include <err.h>
|
||||
|
||||
|
||||
# define xprintf printf
|
||||
# define xvprintf vprintf
|
||||
# define xsnprintf snprintf
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: search.c,v 1.23 2010/12/24 12:41:43 skrll Exp $ */
|
||||
/* $NetBSD: search.c,v 1.24 2013/05/06 08:02:20 skrll Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1996 Matt Thomas <matt@3am-software.com>
|
||||
|
@ -38,7 +38,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: search.c,v 1.23 2010/12/24 12:41:43 skrll Exp $");
|
||||
__RCSID("$NetBSD: search.c,v 1.24 2013/05/06 08:02:20 skrll Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <err.h>
|
||||
|
@ -140,7 +140,7 @@ _rtld_load_library(const char *name, const Obj_Entry *refobj, int flags)
|
|||
strncpy(tmperror, tmperrorp, sizeof tmperror);
|
||||
tmperrorp = tmperror;
|
||||
}
|
||||
|
||||
|
||||
namelen = strlen(name);
|
||||
|
||||
for (sp = _rtld_paths; sp != NULL; sp = sp->sp_next)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/* $NetBSD: sysident.h,v 1.14 2007/06/24 20:35:36 christos Exp $ */
|
||||
/* $NetBSD: sysident.h,v 1.15 2013/05/06 08:02:20 skrll Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Christopher G. Demetriou
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
|
@ -19,7 +19,7 @@
|
|||
* information about NetBSD.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
|
@ -30,7 +30,7 @@
|
|||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
|
||||
*/
|
||||
|
||||
|
|
Loading…
Reference in New Issue