Module Name:    src
Committed By:   mjf
Date:           Sat May 23 17:50:34 UTC 2009

Modified Files:
        src/libexec/ld.elf_so/arch/hppa: hppa_reloc.c

Log Message:
After a recent WARNS= bump on ld.elf_so it fails to build on hppa,
complaining that we're "discarding qualifier from pointer target
type".

Use const char * instead of caddr_t to avoid the warning and get
distribution building on hppa again.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c
diff -u src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c:1.27 src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c:1.28
--- src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c:1.27	Thu Jul 24 04:39:25 2008
+++ src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c	Sat May 23 17:50:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hppa_reloc.c,v 1.27 2008/07/24 04:39:25 matt Exp $	*/
+/*	$NetBSD: hppa_reloc.c,v 1.28 2009/05/23 17:50:34 mjf Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2004 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: hppa_reloc.c,v 1.27 2008/07/24 04:39:25 matt Exp $");
+__RCSID("$NetBSD: hppa_reloc.c,v 1.28 2009/05/23 17:50:34 mjf Exp $");
 #endif /* not lint */
 
 #include <stdlib.h>
@@ -183,7 +183,7 @@
                         break;
 		}
 	}
-	relalim = (const Elf_Rela *)((caddr_t)relafirst + relasz);
+	relalim = (const Elf_Rela *)((const char *)relafirst + relasz);
 
 	for (rela = relafirst; rela < relalim; rela++) {
 		symnum = ELF_R_SYM(rela->r_info);
@@ -525,7 +525,7 @@
 			 */
 			func_pc = ((Elf_Addr)(obj->pltgot)) - 16;
 			func_sl = (Elf_Addr)
-			    ((caddr_t)rela - (caddr_t)(obj->pltrela));
+			    ((const char *)rela - (const char *)(obj->pltrela));
 		}
 		rdbg(("lazy bind %s(%p) --> old=(%p,%p) new=(%p,%p)",
 		    obj->path,
@@ -585,10 +585,12 @@
 caddr_t
 _rtld_bind(const Obj_Entry *obj, Elf_Word reloff)
 {
-	const Elf_Rela *rela = (const Elf_Rela *)((caddr_t)obj->pltrela + reloff);
+	const Elf_Rela *rela;
 	Elf_Addr new_value;
 	int err;
 
+	rela = (const Elf_Rela *)((const char *)obj->pltrela + reloff);
+	
 	assert(ELF_R_SYM(rela->r_info) != 0);
 
 	err = _rtld_relocate_plt_object(obj, rela, &new_value); 

Reply via email to