Mon Mar 16 02:46:48 2009 UTC ()
Fix const issues (cast const pointers to "const uint8_t *" instead of "caddr_t")
NOTE: change based on ../i386/mdreloc.c 1.27
XXX: not compile tested
(lukem)
diff -r1.28 -r1.29 src/libexec/ld.elf_so/arch/arm/mdreloc.c
diff -r1.22 -r1.23 src/libexec/ld.elf_so/arch/m68k/mdreloc.c
diff -r1.24 -r1.25 src/libexec/ld.elf_so/arch/sh3/mdreloc.c
diff -r1.41 -r1.42 src/libexec/ld.elf_so/arch/sparc/mdreloc.c
diff -r1.43 -r1.44 src/libexec/ld.elf_so/arch/sparc64/mdreloc.c
diff -r1.23 -r1.24 src/libexec/ld.elf_so/arch/vax/mdreloc.c
--- src/libexec/ld.elf_so/arch/arm/mdreloc.c 2008/07/24 04:39:25 1.28
+++ src/libexec/ld.elf_so/arch/arm/mdreloc.c 2009/03/16 02:46:47 1.29
@@ -1,8 +1,8 @@
-/* $NetBSD: mdreloc.c,v 1.28 2008/07/24 04:39:25 matt Exp $ */
+/* $NetBSD: mdreloc.c,v 1.29 2009/03/16 02:46:47 lukem Exp $ */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.28 2008/07/24 04:39:25 matt Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.29 2009/03/16 02:46:47 lukem Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -41,7 +41,7 @@
break;
}
}
- rellim = (const Elf_Rel *)((caddr_t)rel + relsz);
+ rellim = (const Elf_Rel *)((const uint8_t *)rel + relsz);
for (; rel < rellim; rel++) {
where = (Elf_Addr *)(relocbase + rel->r_offset);
*where += (Elf_Addr)relocbase;
@@ -249,7 +249,7 @@
caddr_t
_rtld_bind(const Obj_Entry *obj, Elf_Word reloff)
{
- const Elf_Rel *rel = (const Elf_Rel *)((caddr_t)obj->pltrel + reloff);
+ const Elf_Rel *rel = (const Elf_Rel *)((const uint8_t *)obj->pltrel + reloff);
Elf_Addr new_value;
int err;
--- src/libexec/ld.elf_so/arch/m68k/mdreloc.c 2008/07/24 06:51:58 1.22
+++ src/libexec/ld.elf_so/arch/m68k/mdreloc.c 2009/03/16 02:46:47 1.23
@@ -1,13 +1,13 @@
-/* $NetBSD: mdreloc.c,v 1.22 2008/07/24 06:51:58 skrll Exp $ */
+/* $NetBSD: mdreloc.c,v 1.23 2009/03/16 02:46:47 lukem Exp $ */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.22 2008/07/24 06:51:58 skrll Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.23 2009/03/16 02:46:47 lukem Exp $");
#endif /* not lint */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.22 2008/07/24 06:51:58 skrll Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.23 2009/03/16 02:46:47 lukem Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -47,7 +47,7 @@
break;
}
}
- relalim = (const Elf_Rela *)((caddr_t)rela + relasz);
+ relalim = (const Elf_Rela *)((const uint8_t *)rela + relasz);
for (; rela < relalim; rela++) {
where = (Elf_Addr *)(relocbase + rela->r_offset);
*where += (Elf_Addr)relocbase;
@@ -195,7 +195,7 @@
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 = (const Elf_Rela *)((const uint8_t *)obj->pltrela + reloff);
Elf_Addr result;
int err;
--- src/libexec/ld.elf_so/arch/sh3/mdreloc.c 2008/07/24 06:51:58 1.24
+++ src/libexec/ld.elf_so/arch/sh3/mdreloc.c 2009/03/16 02:46:47 1.25
@@ -1,13 +1,13 @@
-/* $NetBSD: mdreloc.c,v 1.24 2008/07/24 06:51:58 skrll Exp $ */
+/* $NetBSD: mdreloc.c,v 1.25 2009/03/16 02:46:47 lukem Exp $ */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.24 2008/07/24 06:51:58 skrll Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.25 2009/03/16 02:46:47 lukem Exp $");
#endif /* not lint */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.24 2008/07/24 06:51:58 skrll Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.25 2009/03/16 02:46:47 lukem Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -46,7 +46,7 @@
break;
}
}
- relalim = (const Elf_Rela *)((caddr_t)rela + relasz);
+ relalim = (const Elf_Rela *)((const uint8_t *)rela + relasz);
for (; rela < relalim; rela++) {
where = (Elf_Addr *)(relocbase + rela->r_offset);
*where = (Elf_Addr)(relocbase + rela->r_addend);
@@ -195,7 +195,7 @@
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 = (const Elf_Rela *)((const uint8_t *)obj->pltrela + reloff);
Elf_Addr new_value;
int err;
--- src/libexec/ld.elf_so/arch/sparc/mdreloc.c 2008/07/24 04:39:25 1.41
+++ src/libexec/ld.elf_so/arch/sparc/mdreloc.c 2009/03/16 02:46:47 1.42
@@ -1,4 +1,4 @@
-/* $NetBSD: mdreloc.c,v 1.41 2008/07/24 04:39:25 matt Exp $ */
+/* $NetBSD: mdreloc.c,v 1.42 2009/03/16 02:46:47 lukem Exp $ */
/*-
* Copyright (c) 1999, 2002 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.41 2008/07/24 04:39:25 matt Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.42 2009/03/16 02:46:47 lukem Exp $");
#endif /* not lint */
#include <errno.h>
@@ -173,7 +173,7 @@
break;
}
}
- relalim = (const Elf_Rela *)((caddr_t)rela + relasz);
+ relalim = (const Elf_Rela *)((const uint8_t *)rela + relasz);
for (; rela < relalim; rela++) {
where = (Elf_Addr *)(relocbase + rela->r_offset);
*where += (Elf_Addr)(relocbase + rela->r_addend);
@@ -320,7 +320,7 @@
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 = (const Elf_Rela *)((const uint8_t *)obj->pltrela + reloff);
Elf_Addr value;
int err;
--- src/libexec/ld.elf_so/arch/sparc64/mdreloc.c 2008/07/24 04:39:25 1.43
+++ src/libexec/ld.elf_so/arch/sparc64/mdreloc.c 2009/03/16 02:46:48 1.44
@@ -1,4 +1,4 @@
-/* $NetBSD: mdreloc.c,v 1.43 2008/07/24 04:39:25 matt Exp $ */
+/* $NetBSD: mdreloc.c,v 1.44 2009/03/16 02:46:48 lukem Exp $ */
/*-
* Copyright (c) 2000 Eduardo Horvath.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.43 2008/07/24 04:39:25 matt Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.44 2009/03/16 02:46:48 lukem Exp $");
#endif /* not lint */
#include <errno.h>
@@ -289,7 +289,7 @@
break;
}
}
- relalim = (const Elf_Rela *)((caddr_t)rela + relasz);
+ relalim = (const Elf_Rela *)((const uint8_t *)rela + relasz);
for (; rela < relalim; rela++) {
where = (Elf_Addr *)(relocbase + rela->r_offset);
*where = (Elf_Addr)(relocbase + rela->r_addend);
--- src/libexec/ld.elf_so/arch/vax/mdreloc.c 2008/07/24 06:51:59 1.23
+++ src/libexec/ld.elf_so/arch/vax/mdreloc.c 2009/03/16 02:46:48 1.24
@@ -1,13 +1,13 @@
-/* $NetBSD: mdreloc.c,v 1.23 2008/07/24 06:51:59 skrll Exp $ */
+/* $NetBSD: mdreloc.c,v 1.24 2009/03/16 02:46:48 lukem Exp $ */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.23 2008/07/24 06:51:59 skrll Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.24 2009/03/16 02:46:48 lukem Exp $");
#endif /* not lint */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.23 2008/07/24 06:51:59 skrll Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.24 2009/03/16 02:46:48 lukem Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -46,7 +46,7 @@
break;
}
}
- relalim = (const Elf_Rela *)((caddr_t)rela + relasz);
+ relalim = (const Elf_Rela *)((const uint8_t *)rela + relasz);
for (; rela < relalim; rela++) {
where = (Elf_Addr *)(relocbase + rela->r_offset);
*where = (Elf_Addr)(relocbase + rela->r_addend);
@@ -179,7 +179,7 @@
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 = (const Elf_Rela *)((const uint8_t *)obj->pltrela + reloff);
Elf_Addr result;
int err;