diff options
author | Marco S Hyman <marc@cvs.openbsd.org> | 2002-09-07 01:25:35 +0000 |
---|---|---|
committer | Marco S Hyman <marc@cvs.openbsd.org> | 2002-09-07 01:25:35 +0000 |
commit | eeec70e61a5e3e1df45ac2336c12eef05ec1fac5 (patch) | |
tree | 8e2634e6bf3af3082560ff834c598e2689cf750c /gnu/usr.bin/ld/rtld | |
parent | 85adcb803528b6a6a9c464ce3537c1b99cd609a6 (diff) |
ansification of ld
* normalized the signatures of the functions passed to each_file()
and each_full_file(). In most cases that meant adding a void *dummy.
In one case it changed an int to a void*, but the arg was only checked
for zero/not-zero so the change was not significant.
* removes unused code and structures.
* makes sure printf args match their format.
* got rid of some of the gcc -Wall warnings
OK deraadt@
Diffstat (limited to 'gnu/usr.bin/ld/rtld')
-rw-r--r-- | gnu/usr.bin/ld/rtld/malloc.c | 11 | ||||
-rw-r--r-- | gnu/usr.bin/ld/rtld/rtld.c | 29 |
2 files changed, 11 insertions, 29 deletions
diff --git a/gnu/usr.bin/ld/rtld/malloc.c b/gnu/usr.bin/ld/rtld/malloc.c index 9d5869f3319..eb372e06090 100644 --- a/gnu/usr.bin/ld/rtld/malloc.c +++ b/gnu/usr.bin/ld/rtld/malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.c,v 1.5 2002/07/19 19:28:12 marc Exp $ */ +/* $OpenBSD: malloc.c,v 1.6 2002/09/07 01:25:34 marc Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -35,7 +35,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)malloc.c 5.11 (Berkeley) 2/23/91";*/ -static char *rcsid = "$OpenBSD: malloc.c,v 1.5 2002/07/19 19:28:12 marc Exp $"; +static char *rcsid = "$OpenBSD: malloc.c,v 1.6 2002/09/07 01:25:34 marc Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -56,6 +56,7 @@ static char *rcsid = "$OpenBSD: malloc.c,v 1.5 2002/07/19 19:28:12 marc Exp $"; #include <unistd.h> #include <sys/param.h> #include <sys/mman.h> + #ifndef BSD #define MAP_COPY MAP_PRIVATE #define MAP_FILE 0 @@ -73,7 +74,8 @@ static char *rcsid = "$OpenBSD: malloc.c,v 1.5 2002/07/19 19:28:12 marc Exp $"; */ #define NPOOLPAGES (32*1024/pagesz) static caddr_t pagepool_start, pagepool_end; -static int morepages(); +static int morepages(int); +extern void xprintf(char *, ...); /* * The overhead on a block is at least 4 bytes. When free, this space @@ -120,7 +122,6 @@ static int findbucket(union overhead *freep, int srchlen); */ #define NBUCKETS 30 static union overhead *nextf[NBUCKETS]; -extern char *sbrk(); static int pagesz; /* page size */ static int pagebucket; /* page size bucket */ @@ -387,7 +388,7 @@ realloc(void *cp, size_t nbytes) * header starts at ``freep''. If srchlen is -1 search the whole list. * Return bucket number, or -1 if not found. */ -static +static int findbucket(union overhead *freep, int srchlen) { union overhead *p; diff --git a/gnu/usr.bin/ld/rtld/rtld.c b/gnu/usr.bin/ld/rtld/rtld.c index aee02e4ccfa..0fb7e6184b8 100644 --- a/gnu/usr.bin/ld/rtld/rtld.c +++ b/gnu/usr.bin/ld/rtld/rtld.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld.c,v 1.28 2002/07/27 22:06:06 deraadt Exp $ */ +/* $OpenBSD: rtld.c,v 1.29 2002/09/07 01:25:34 marc Exp $ */ /* $NetBSD: rtld.c,v 1.43 1996/01/14 00:35:17 pk Exp $ */ /* * Copyright (c) 1993 Paul Kranenburg @@ -1096,7 +1096,7 @@ binder(jmpslot_t *jsp) } if (smp == NULL) - errx(1, "Call to binder from unknown location: %#x", jsp); + errx(1, "Call to binder from unknown location: %p", jsp); index = jsp->reloc_index & JMPSLOT_RELOC_MASK; @@ -1106,7 +1106,7 @@ binder(jmpslot_t *jsp) np = lookup(sym, &src_map, 1); if (np == NULL) - errx(1, "Undefined symbol \"%s\" called from %s:%s at %#x", + errx(1, "Undefined symbol \"%s\" called from %s:%s at %p", sym, main_progname, smp->som_path, jsp); /* Fixup jmpslot so future calls transfer directly to target */ @@ -1196,7 +1196,7 @@ unmaphints(void) } } -int +static int hinthash(char *cp, int vmajor, int vminor) { int k = 0; @@ -1354,31 +1354,12 @@ preload(char *paths) return; } -static struct somap_private dlmap_private = { - 0, - (struct so_map *)0, - 0, -#ifdef SUN_COMPAT - 0, -#endif -}; - -static struct so_map dlmap = { - (caddr_t)0, - "internal", - (struct so_map *)0, - (struct sod *)0, - (caddr_t)0, - (u_int)0, - (struct _dynamic *)0, - (caddr_t)&dlmap_private -}; static int dlerrno; /* * Populate sod struct for dlopen's call to map_object */ -void +static void build_sod(const char *name, struct sod *sodp) { unsigned int tuplet; |