From 372fe2ff92795b47efdc6bd04f1c828a0c813ac8 Mon Sep 17 00:00:00 2001 From: scottr Date: Fri, 3 Jan 1997 22:37:58 +0000 Subject: [PATCH] Catch up with const changes to dlopen() and dlsym() prototypes in . Tested on i386 and hp300 for crt0.o and ld.so, verified other references by inspection. --- gnu/usr.bin/ld/rtld/link.h | 6 +++--- gnu/usr.bin/ld/rtld/rtld.c | 28 ++++++++++++++-------------- include/link_aout.h | 6 +++--- lib/csu/common.c | 6 +++--- lib/csu/common_aout/common.c | 6 +++--- libexec/ld.aout_so/link.h | 6 +++--- libexec/ld.aout_so/rtld.c | 28 ++++++++++++++-------------- 7 files changed, 43 insertions(+), 43 deletions(-) diff --git a/gnu/usr.bin/ld/rtld/link.h b/gnu/usr.bin/ld/rtld/link.h index 799d80ffc4df..8179034c81e6 100644 --- a/gnu/usr.bin/ld/rtld/link.h +++ b/gnu/usr.bin/ld/rtld/link.h @@ -1,4 +1,4 @@ -/* $NetBSD: link.h,v 1.10 1996/01/09 00:00:11 pk Exp $ */ +/* $NetBSD: link.h,v 1.11 1997/01/03 22:39:03 scottr Exp $ */ /* * Copyright (c) 1993 Paul Kranenburg @@ -166,9 +166,9 @@ struct so_debug { * Entry points into ld.so - user interface to the run-time linker. */ struct ld_entry { - void *(*dlopen) __P((char *, int)); + void *(*dlopen) __P((const char *, int)); int (*dlclose) __P((void *)); - void *(*dlsym) __P((void *, char *)); + void *(*dlsym) __P((void *, const char *)); int (*dlctl) __P((void *, int, void *)); void (*dlexit) __P((void)); void (*dlrsrvd[3]) __P((void)); diff --git a/gnu/usr.bin/ld/rtld/rtld.c b/gnu/usr.bin/ld/rtld/rtld.c index e88be48e0d00..04bb79f69339 100644 --- a/gnu/usr.bin/ld/rtld/rtld.c +++ b/gnu/usr.bin/ld/rtld/rtld.c @@ -1,4 +1,4 @@ -/* $NetBSD: rtld.c,v 1.46 1996/12/21 21:53:16 pk Exp $ */ +/* $NetBSD: rtld.c,v 1.47 1997/01/03 22:39:05 scottr Exp $ */ /* * Copyright (c) 1993 Paul Kranenburg * All rights reserved. @@ -172,9 +172,9 @@ static int ld_warn_non_pure_code; static int ld_tracing; -static void *__dlopen __P((char *, int)); +static void *__dlopen __P((const char *, int)); static int __dlclose __P((void *)); -static void *__dlsym __P((void *, char *)); +static void *__dlsym __P((void *, const char *)); static int __dlctl __P((void *, int, void *)); static void __dlexit __P((void)); @@ -199,9 +199,9 @@ static void reloc_map __P((struct so_map *)); static void reloc_copy __P((struct so_map *)); static void call_map __P((struct so_map *, char *)); static char *rtfindlib __P((char *, int, int, int *, char *)); -static struct nzlist *lookup __P((char *, struct so_map **, int)); -static inline struct rt_symbol *lookup_rts __P((char *)); -static struct rt_symbol *enter_rts __P((char *, long, int, caddr_t, +static struct nzlist *lookup __P((const char *, struct so_map **, int)); +static inline struct rt_symbol *lookup_rts __P((const char *)); +static struct rt_symbol *enter_rts __P((const char *, long, int, caddr_t, long, struct so_map *)); static void maphints __P((void)); static void unmaphints __P((void)); @@ -887,7 +887,7 @@ hash_string(key) static inline struct rt_symbol * lookup_rts(key) - char *key; + const char *key; { register int hashval; register struct rt_symbol *rtsp; @@ -907,7 +907,7 @@ lookup_rts(key) static struct rt_symbol * enter_rts(name, value, type, srcaddr, size, smp) - char *name; + const char *name; long value; int type; caddr_t srcaddr; @@ -953,7 +953,7 @@ enter_rts(name, value, type, srcaddr, size, smp) */ static struct nzlist * lookup(name, src_map, strong) - char *name; + const char *name; struct so_map **src_map; /* IN/OUT */ int strong; { @@ -994,7 +994,7 @@ restart: /* * Compute bucket in which the symbol might be found. */ - for (hashval = 0, cp = name; *cp; cp++) + for (hashval = 0, cp = (char *) name; *cp; cp++) hashval = (hashval << 1) + *cp; hashval = (hashval & 0x7fffffff) % buckets; @@ -1473,8 +1473,8 @@ backout: static void * __dlopen(name, mode) - char *name; - int mode; + const char *name; + int mode; { struct sod *sodp; struct so_map *smp; @@ -1539,8 +1539,8 @@ xprintf("dlclose(%s): refcount = %d\n", smp->som_path, LM_PRIVATE(smp)->spd_refc static void * __dlsym(fd, sym) - void *fd; - char *sym; + void *fd; + const char *sym; { struct so_map *smp = (struct so_map *)fd, *src_map = NULL; struct nzlist *np; diff --git a/include/link_aout.h b/include/link_aout.h index 9ab289ffbdeb..cf98886bfbbc 100644 --- a/include/link_aout.h +++ b/include/link_aout.h @@ -1,4 +1,4 @@ -/* $NetBSD: link_aout.h,v 1.10 1996/01/09 00:00:11 pk Exp $ */ +/* $NetBSD: link_aout.h,v 1.11 1997/01/03 22:39:03 scottr Exp $ */ /* * Copyright (c) 1993 Paul Kranenburg @@ -166,9 +166,9 @@ struct so_debug { * Entry points into ld.so - user interface to the run-time linker. */ struct ld_entry { - void *(*dlopen) __P((char *, int)); + void *(*dlopen) __P((const char *, int)); int (*dlclose) __P((void *)); - void *(*dlsym) __P((void *, char *)); + void *(*dlsym) __P((void *, const char *)); int (*dlctl) __P((void *, int, void *)); void (*dlexit) __P((void)); void (*dlrsrvd[3]) __P((void)); diff --git a/lib/csu/common.c b/lib/csu/common.c index 52c516d634a0..ca96505fe51b 100644 --- a/lib/csu/common.c +++ b/lib/csu/common.c @@ -1,4 +1,4 @@ -/* $NetBSD: common.c,v 1.5 1996/10/18 05:36:43 thorpej Exp $ */ +/* $NetBSD: common.c,v 1.6 1997/01/03 22:37:58 scottr Exp $ */ /* * Copyright (c) 1993,1995 Paul Kranenburg @@ -159,7 +159,7 @@ __load_rtld(dp) void * dlopen(name, mode) - char *name; + const char *name; int mode; { if (ld_entry == NULL) @@ -181,7 +181,7 @@ dlclose(fd) void * dlsym(fd, name) void *fd; - char *name; + const char *name; { if (ld_entry == NULL) return NULL; diff --git a/lib/csu/common_aout/common.c b/lib/csu/common_aout/common.c index 52c516d634a0..ca96505fe51b 100644 --- a/lib/csu/common_aout/common.c +++ b/lib/csu/common_aout/common.c @@ -1,4 +1,4 @@ -/* $NetBSD: common.c,v 1.5 1996/10/18 05:36:43 thorpej Exp $ */ +/* $NetBSD: common.c,v 1.6 1997/01/03 22:37:58 scottr Exp $ */ /* * Copyright (c) 1993,1995 Paul Kranenburg @@ -159,7 +159,7 @@ __load_rtld(dp) void * dlopen(name, mode) - char *name; + const char *name; int mode; { if (ld_entry == NULL) @@ -181,7 +181,7 @@ dlclose(fd) void * dlsym(fd, name) void *fd; - char *name; + const char *name; { if (ld_entry == NULL) return NULL; diff --git a/libexec/ld.aout_so/link.h b/libexec/ld.aout_so/link.h index 799d80ffc4df..8179034c81e6 100644 --- a/libexec/ld.aout_so/link.h +++ b/libexec/ld.aout_so/link.h @@ -1,4 +1,4 @@ -/* $NetBSD: link.h,v 1.10 1996/01/09 00:00:11 pk Exp $ */ +/* $NetBSD: link.h,v 1.11 1997/01/03 22:39:03 scottr Exp $ */ /* * Copyright (c) 1993 Paul Kranenburg @@ -166,9 +166,9 @@ struct so_debug { * Entry points into ld.so - user interface to the run-time linker. */ struct ld_entry { - void *(*dlopen) __P((char *, int)); + void *(*dlopen) __P((const char *, int)); int (*dlclose) __P((void *)); - void *(*dlsym) __P((void *, char *)); + void *(*dlsym) __P((void *, const char *)); int (*dlctl) __P((void *, int, void *)); void (*dlexit) __P((void)); void (*dlrsrvd[3]) __P((void)); diff --git a/libexec/ld.aout_so/rtld.c b/libexec/ld.aout_so/rtld.c index e88be48e0d00..04bb79f69339 100644 --- a/libexec/ld.aout_so/rtld.c +++ b/libexec/ld.aout_so/rtld.c @@ -1,4 +1,4 @@ -/* $NetBSD: rtld.c,v 1.46 1996/12/21 21:53:16 pk Exp $ */ +/* $NetBSD: rtld.c,v 1.47 1997/01/03 22:39:05 scottr Exp $ */ /* * Copyright (c) 1993 Paul Kranenburg * All rights reserved. @@ -172,9 +172,9 @@ static int ld_warn_non_pure_code; static int ld_tracing; -static void *__dlopen __P((char *, int)); +static void *__dlopen __P((const char *, int)); static int __dlclose __P((void *)); -static void *__dlsym __P((void *, char *)); +static void *__dlsym __P((void *, const char *)); static int __dlctl __P((void *, int, void *)); static void __dlexit __P((void)); @@ -199,9 +199,9 @@ static void reloc_map __P((struct so_map *)); static void reloc_copy __P((struct so_map *)); static void call_map __P((struct so_map *, char *)); static char *rtfindlib __P((char *, int, int, int *, char *)); -static struct nzlist *lookup __P((char *, struct so_map **, int)); -static inline struct rt_symbol *lookup_rts __P((char *)); -static struct rt_symbol *enter_rts __P((char *, long, int, caddr_t, +static struct nzlist *lookup __P((const char *, struct so_map **, int)); +static inline struct rt_symbol *lookup_rts __P((const char *)); +static struct rt_symbol *enter_rts __P((const char *, long, int, caddr_t, long, struct so_map *)); static void maphints __P((void)); static void unmaphints __P((void)); @@ -887,7 +887,7 @@ hash_string(key) static inline struct rt_symbol * lookup_rts(key) - char *key; + const char *key; { register int hashval; register struct rt_symbol *rtsp; @@ -907,7 +907,7 @@ lookup_rts(key) static struct rt_symbol * enter_rts(name, value, type, srcaddr, size, smp) - char *name; + const char *name; long value; int type; caddr_t srcaddr; @@ -953,7 +953,7 @@ enter_rts(name, value, type, srcaddr, size, smp) */ static struct nzlist * lookup(name, src_map, strong) - char *name; + const char *name; struct so_map **src_map; /* IN/OUT */ int strong; { @@ -994,7 +994,7 @@ restart: /* * Compute bucket in which the symbol might be found. */ - for (hashval = 0, cp = name; *cp; cp++) + for (hashval = 0, cp = (char *) name; *cp; cp++) hashval = (hashval << 1) + *cp; hashval = (hashval & 0x7fffffff) % buckets; @@ -1473,8 +1473,8 @@ backout: static void * __dlopen(name, mode) - char *name; - int mode; + const char *name; + int mode; { struct sod *sodp; struct so_map *smp; @@ -1539,8 +1539,8 @@ xprintf("dlclose(%s): refcount = %d\n", smp->som_path, LM_PRIVATE(smp)->spd_refc static void * __dlsym(fd, sym) - void *fd; - char *sym; + void *fd; + const char *sym; { struct so_map *smp = (struct so_map *)fd, *src_map = NULL; struct nzlist *np;