From clkao@heaven.pamud.net  Fri Apr 17 08:03:31 1998
Received: from heaven.pamud.net (clkao@heaven.pamud.net [210.209.60.16])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA01991
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 17 Apr 1998 08:03:27 GMT
          (envelope-from clkao@heaven.pamud.net)
Received: (from clkao@localhost)
	by heaven.pamud.net (8.8.8/8.8.8) id EAA01204;
	Fri, 17 Apr 1998 04:05:23 +0800 (CST)
	(envelope-from clkao)
Message-Id: <199804162005.EAA01204@heaven.pamud.net>
Date: Fri, 17 Apr 1998 04:05:23 +0800 (CST)
From: clkao@cirx.org
Reply-To: clkao@heaven.pamud.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: gnu/usr.bin/ld/rtld code clean up
X-Send-Pr-Version: 3.2

>Number:         6328
>Category:       bin
>Synopsis:       gnu/usr.bin/ld/rtld code clean up
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jdp
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 17 01:10:03 PDT 1998
>Closed-Date:    Sun Apr 19 16:01:48 PDT 1998
>Last-Modified:  Sun Apr 19 16:02:16 PDT 1998
>Originator:     Chia-liang Kao
>Release:        FreeBSD 2.2.6-RELEASE i386
>Organization:
Panther Tech. Co.
>Environment:

	FreeBSD 2.2.6-RELEASE i386

>Description:

	clean up some warnings caused by imcompatiable types.

>How-To-Repeat:

	just make the rtld, you'll get 4 warnings.
>Fix:


--- rtld.c.orig	Fri Apr 17 03:41:13 1998
+++ rtld.c	Fri Apr 17 03:49:06 1998
@@ -199,26 +199,26 @@
 struct so_map		*link_map_tail;
 struct rt_symbol	*rt_symbol_head;
 
-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 char		*__dlerror __P((void));
+static void		*__dlsym __P((void *, const char *));
+static const char	*__dlerror __P((void));
 static void		__dlexit __P((void));
-static void		*__dlsym3 __P((void *, char *, void *));
+static void		*__dlsym3 __P((void *, const char *, void *));
 
 static struct ld_entry	ld_entry = {
 	__dlopen, __dlclose, __dlsym, __dlerror, __dlexit, __dlsym3
 };
 
        void		xprintf __P((char *, ...));
-static struct so_map	*map_object __P((	char *,
+static struct so_map	*map_object __P((	const char *,
 						struct sod *,
 						struct so_map *));
 static int		map_preload __P((void));
 static int		map_sods __P((struct so_map *));
 static int		reloc_and_init __P((struct so_map *, int));
 static void		unmap_object __P((struct so_map	*, int));
-static struct so_map	*alloc_link_map __P((	char *, struct sod *,
+static struct so_map	*alloc_link_map __P((	const char *, struct sod *,
 						struct so_map *, caddr_t,
 						struct _dynamic *));
 static void		free_link_map __P((struct so_map *));
@@ -515,7 +515,7 @@
  */
 	static struct so_map *
 alloc_link_map(path, sodp, parent, addr, dp)
-	char		*path;
+	const char	*path;
 	struct sod	*sodp;
 	struct so_map	*parent;
 	caddr_t		addr;
@@ -619,7 +619,7 @@
  */
 	static struct so_map *
 map_object(path, sodp, parent)
-	char		*path;
+	const char	*path;
 	struct sod	*sodp;
 	struct so_map	*parent;
 {
@@ -872,7 +872,7 @@
 			 */
 			(void)alloc_link_map(NULL, sodp, parent, 0, 0);
 		} else if (ld_ignore_missing_objects) {
-			char *msg;
+			const char *msg;
 			/*
 			 * Call __dlerror() even it we're not going to use
 			 * the message, in order to clear the saved message.
@@ -1841,7 +1841,7 @@
 
 	static void *
 __dlopen(path, mode)
-	char	*path;
+	const char	*path;
 	int	mode;
 {
 	struct so_map	*old_tail = link_map_tail;
@@ -1905,7 +1905,7 @@
 	static void *
 __dlsym(fd, sym)
 	void	*fd;
-	char	*sym;
+	const char	*sym;
 {
 	if (fd == RTLD_NEXT) {
 		generror("RTLD_NEXT not supported by this version of"
@@ -1978,7 +1978,7 @@
 	static void *
 __dlsym3(fd, sym, retaddr)
 	void	*fd;
-	char	*sym;
+	const char	*sym;
 	void	*retaddr;
 {
 	void *result;
@@ -2003,7 +2003,7 @@
 	return result;
 }
 
-	static char *
+	static const char *
 __dlerror __P((void))
 {
         char *err;
@@ -2030,7 +2030,7 @@
 static void
 die __P((void))
 {
-	char *msg;
+	const char *msg;
 
 	fprintf(stderr, "ld.so failed");
 	if ((msg = __dlerror()) != NULL)
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->jdp 
Responsible-Changed-By: phk 
Responsible-Changed-When: Fri Apr 17 01:50:28 PDT 1998 
Responsible-Changed-Why:  
This looks like a case for you Polstra... 
State-Changed-From-To: open->closed 
State-Changed-By: jdp 
State-Changed-When: Sun Apr 19 16:01:48 PDT 1998 
State-Changed-Why:  
Fixed in rtld.c revision 1.40.2.5. 
>Unformatted:
