Reduce header pollution for mdreloc.c. Make Obj_Entry argument of

_rtld_relocate_nonplt_objects non-const in preparation for TLS support.
This commit is contained in:
joerg 2010-08-06 16:33:17 +00:00
parent 05ee96af0c
commit f40b256f09
13 changed files with 42 additions and 53 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: alpha_reloc.c,v 1.36 2010/01/14 11:58:31 skrll Exp $ */ /* $NetBSD: alpha_reloc.c,v 1.37 2010/08/06 16:33:17 joerg Exp $ */
/* /*
* Copyright (c) 2001 Wasabi Systems, Inc. * Copyright (c) 2001 Wasabi Systems, Inc.
@ -62,11 +62,10 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: alpha_reloc.c,v 1.36 2010/01/14 11:58:31 skrll Exp $"); __RCSID("$NetBSD: alpha_reloc.c,v 1.37 2010/08/06 16:33:17 joerg Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h>
#include <string.h> #include <string.h>
#include "rtld.h" #include "rtld.h"
@ -196,7 +195,7 @@ _rtld_relocate_nonplt_self(Elf_Dyn *dynp, Elf_Addr relocbase)
} }
int int
_rtld_relocate_nonplt_objects(const Obj_Entry *obj) _rtld_relocate_nonplt_objects(Obj_Entry *obj)
{ {
const Elf_Rela *rela; const Elf_Rela *rela;
Elf_Addr target = -1; Elf_Addr target = -1;

View File

@ -1,13 +1,11 @@
/* $NetBSD: mdreloc.c,v 1.33 2010/01/14 12:12:07 skrll Exp $ */ /* $NetBSD: mdreloc.c,v 1.34 2010/08/06 16:33:17 joerg Exp $ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: mdreloc.c,v 1.33 2010/01/14 12:12:07 skrll Exp $"); __RCSID("$NetBSD: mdreloc.c,v 1.34 2010/08/06 16:33:17 joerg Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h>
#include <string.h> #include <string.h>
#include "debug.h" #include "debug.h"
@ -73,7 +71,7 @@ store_ptr(void *where, Elf_Addr val)
} }
int int
_rtld_relocate_nonplt_objects(const Obj_Entry *obj) _rtld_relocate_nonplt_objects(Obj_Entry *obj)
{ {
const Elf_Rel *rel; const Elf_Rel *rel;

View File

@ -1,4 +1,4 @@
/* $NetBSD: hppa_reloc.c,v 1.32 2010/01/14 11:57:06 skrll Exp $ */ /* $NetBSD: hppa_reloc.c,v 1.33 2010/08/06 16:33:17 joerg Exp $ */
/*- /*-
* Copyright (c) 2002, 2004 The NetBSD Foundation, Inc. * Copyright (c) 2002, 2004 The NetBSD Foundation, Inc.
@ -31,12 +31,11 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: hppa_reloc.c,v 1.32 2010/01/14 11:57:06 skrll Exp $"); __RCSID("$NetBSD: hppa_reloc.c,v 1.33 2010/08/06 16:33:17 joerg Exp $");
#endif /* not lint */ #endif /* not lint */
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h>
#include <sys/queue.h> #include <sys/queue.h>
#include <string.h> #include <string.h>
@ -362,7 +361,7 @@ _rtld_setup_pltgot(const Obj_Entry *obj)
} }
int int
_rtld_relocate_nonplt_objects(const Obj_Entry *obj) _rtld_relocate_nonplt_objects(Obj_Entry *obj)
{ {
const Elf_Rela *rela; const Elf_Rela *rela;

View File

@ -1,12 +1,11 @@
/* $NetBSD: mdreloc.c,v 1.31 2010/01/14 11:58:32 skrll Exp $ */ /* $NetBSD: mdreloc.c,v 1.32 2010/08/06 16:33:18 joerg Exp $ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: mdreloc.c,v 1.31 2010/01/14 11:58:32 skrll Exp $"); __RCSID("$NetBSD: mdreloc.c,v 1.32 2010/08/06 16:33:18 joerg Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h>
#include "debug.h" #include "debug.h"
#include "rtld.h" #include "rtld.h"
@ -49,7 +48,7 @@ _rtld_relocate_nonplt_self(Elf_Dyn *dynp, Elf_Addr relocbase)
} }
int int
_rtld_relocate_nonplt_objects(const Obj_Entry *obj) _rtld_relocate_nonplt_objects(Obj_Entry *obj)
{ {
const Elf_Rel *rel; const Elf_Rel *rel;
Elf_Addr target = 0; Elf_Addr target = 0;

View File

@ -1,17 +1,16 @@
/* $NetBSD: mdreloc.c,v 1.26 2010/01/14 11:58:32 skrll Exp $ */ /* $NetBSD: mdreloc.c,v 1.27 2010/08/06 16:33:18 joerg Exp $ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: mdreloc.c,v 1.26 2010/01/14 11:58:32 skrll Exp $"); __RCSID("$NetBSD: mdreloc.c,v 1.27 2010/08/06 16:33:18 joerg Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: mdreloc.c,v 1.26 2010/01/14 11:58:32 skrll Exp $"); __RCSID("$NetBSD: mdreloc.c,v 1.27 2010/08/06 16:33:18 joerg Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h>
#include "debug.h" #include "debug.h"
#include "rtld.h" #include "rtld.h"
@ -55,7 +54,7 @@ _rtld_relocate_nonplt_self(Elf_Dyn *dynp, Elf_Addr relocbase)
} }
int int
_rtld_relocate_nonplt_objects(const Obj_Entry *obj) _rtld_relocate_nonplt_objects(Obj_Entry *obj)
{ {
const Elf_Rela *rela; const Elf_Rela *rela;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mips_reloc.c,v 1.58 2010/01/14 11:57:06 skrll Exp $ */ /* $NetBSD: mips_reloc.c,v 1.59 2010/08/06 16:33:18 joerg Exp $ */
/* /*
* Copyright 1997 Michael L. Hitch <mhitch@montana.edu> * Copyright 1997 Michael L. Hitch <mhitch@montana.edu>
@ -30,11 +30,10 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: mips_reloc.c,v 1.58 2010/01/14 11:57:06 skrll Exp $"); __RCSID("$NetBSD: mips_reloc.c,v 1.59 2010/08/06 16:33:18 joerg Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h>
#include <sys/endian.h> #include <sys/endian.h>
#include <stdlib.h> #include <stdlib.h>
@ -223,7 +222,7 @@ _rtld_relocate_nonplt_self(Elf_Dyn *dynp, Elf_Addr relocbase)
} }
int int
_rtld_relocate_nonplt_objects(const Obj_Entry *obj) _rtld_relocate_nonplt_objects(Obj_Entry *obj)
{ {
const Elf_Rel *rel; const Elf_Rel *rel;
Elf_Addr *got = obj->pltgot; Elf_Addr *got = obj->pltgot;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ppc_reloc.c,v 1.44 2010/01/13 20:17:22 christos Exp $ */ /* $NetBSD: ppc_reloc.c,v 1.45 2010/08/06 16:33:18 joerg Exp $ */
/*- /*-
* Copyright (C) 1998 Tsubai Masanari * Copyright (C) 1998 Tsubai Masanari
@ -30,7 +30,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: ppc_reloc.c,v 1.44 2010/01/13 20:17:22 christos Exp $"); __RCSID("$NetBSD: ppc_reloc.c,v 1.45 2010/08/06 16:33:18 joerg Exp $");
#endif /* not lint */ #endif /* not lint */
#include <stdarg.h> #include <stdarg.h>
@ -38,7 +38,6 @@ __RCSID("$NetBSD: ppc_reloc.c,v 1.44 2010/01/13 20:17:22 christos Exp $");
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h>
#include <machine/cpu.h> #include <machine/cpu.h>
#include "debug.h" #include "debug.h"
@ -131,7 +130,7 @@ _rtld_relocate_nonplt_self(Elf_Dyn *dynp, Elf_Addr relocbase)
} }
int int
_rtld_relocate_nonplt_objects(const Obj_Entry *obj) _rtld_relocate_nonplt_objects(Obj_Entry *obj)
{ {
const Elf_Rela *rela; const Elf_Rela *rela;

View File

@ -1,17 +1,16 @@
/* $NetBSD: mdreloc.c,v 1.27 2010/01/13 20:17:22 christos Exp $ */ /* $NetBSD: mdreloc.c,v 1.28 2010/08/06 16:33:18 joerg Exp $ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: mdreloc.c,v 1.27 2010/01/13 20:17:22 christos Exp $"); __RCSID("$NetBSD: mdreloc.c,v 1.28 2010/08/06 16:33:18 joerg Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: mdreloc.c,v 1.27 2010/01/13 20:17:22 christos Exp $"); __RCSID("$NetBSD: mdreloc.c,v 1.28 2010/08/06 16:33:18 joerg Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h>
#include "debug.h" #include "debug.h"
#include "rtld.h" #include "rtld.h"
@ -54,7 +53,7 @@ _rtld_relocate_nonplt_self(Elf_Dyn *dynp, Elf_Addr relocbase)
} }
int int
_rtld_relocate_nonplt_objects(const Obj_Entry *obj) _rtld_relocate_nonplt_objects(Obj_Entry *obj)
{ {
const Elf_Rela *rela; const Elf_Rela *rela;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mdreloc.c,v 1.43 2010/01/13 20:17:22 christos Exp $ */ /* $NetBSD: mdreloc.c,v 1.44 2010/08/06 16:33:18 joerg Exp $ */
/*- /*-
* Copyright (c) 1999, 2002 The NetBSD Foundation, Inc. * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: mdreloc.c,v 1.43 2010/01/13 20:17:22 christos Exp $"); __RCSID("$NetBSD: mdreloc.c,v 1.44 2010/08/06 16:33:18 joerg Exp $");
#endif /* not lint */ #endif /* not lint */
#include <errno.h> #include <errno.h>
@ -39,7 +39,6 @@ __RCSID("$NetBSD: mdreloc.c,v 1.43 2010/01/13 20:17:22 christos Exp $");
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h>
#include "rtldenv.h" #include "rtldenv.h"
#include "debug.h" #include "debug.h"
@ -181,7 +180,7 @@ _rtld_relocate_nonplt_self(Elf_Dyn *dynp, Elf_Addr relocbase)
} }
int int
_rtld_relocate_nonplt_objects(const Obj_Entry *obj) _rtld_relocate_nonplt_objects(Obj_Entry *obj)
{ {
const Elf_Rela *rela; const Elf_Rela *rela;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mdreloc.c,v 1.46 2010/01/13 20:17:22 christos Exp $ */ /* $NetBSD: mdreloc.c,v 1.47 2010/08/06 16:33:18 joerg Exp $ */
/*- /*-
* Copyright (c) 2000 Eduardo Horvath. * Copyright (c) 2000 Eduardo Horvath.
@ -32,7 +32,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: mdreloc.c,v 1.46 2010/01/13 20:17:22 christos Exp $"); __RCSID("$NetBSD: mdreloc.c,v 1.47 2010/08/06 16:33:18 joerg Exp $");
#endif /* not lint */ #endif /* not lint */
#include <errno.h> #include <errno.h>
@ -40,7 +40,6 @@ __RCSID("$NetBSD: mdreloc.c,v 1.46 2010/01/13 20:17:22 christos Exp $");
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h>
#include "rtldenv.h" #include "rtldenv.h"
#include "debug.h" #include "debug.h"
@ -297,7 +296,7 @@ _rtld_relocate_nonplt_self(Elf_Dyn *dynp, Elf_Addr relocbase)
} }
int int
_rtld_relocate_nonplt_objects(const Obj_Entry *obj) _rtld_relocate_nonplt_objects(Obj_Entry *obj)
{ {
const Elf_Rela *rela; const Elf_Rela *rela;
const Elf_Sym *def = NULL; const Elf_Sym *def = NULL;

View File

@ -1,17 +1,16 @@
/* $NetBSD: mdreloc.c,v 1.26 2010/01/13 20:17:23 christos Exp $ */ /* $NetBSD: mdreloc.c,v 1.27 2010/08/06 16:33:19 joerg Exp $ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: mdreloc.c,v 1.26 2010/01/13 20:17:23 christos Exp $"); __RCSID("$NetBSD: mdreloc.c,v 1.27 2010/08/06 16:33:19 joerg Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: mdreloc.c,v 1.26 2010/01/13 20:17:23 christos Exp $"); __RCSID("$NetBSD: mdreloc.c,v 1.27 2010/08/06 16:33:19 joerg Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h>
#include "debug.h" #include "debug.h"
#include "rtld.h" #include "rtld.h"
@ -54,7 +53,7 @@ _rtld_relocate_nonplt_self(Elf_Dyn *dynp, Elf_Addr relocbase)
} }
int int
_rtld_relocate_nonplt_objects(const Obj_Entry *obj) _rtld_relocate_nonplt_objects(Obj_Entry *obj)
{ {
const Elf_Rela *rela; const Elf_Rela *rela;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mdreloc.c,v 1.37 2010/01/14 12:14:49 skrll Exp $ */ /* $NetBSD: mdreloc.c,v 1.38 2010/08/06 16:33:19 joerg Exp $ */
/* /*
* Copyright (c) 2001 Wasabi Systems, Inc. * Copyright (c) 2001 Wasabi Systems, Inc.
@ -68,7 +68,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: mdreloc.c,v 1.37 2010/01/14 12:14:49 skrll Exp $"); __RCSID("$NetBSD: mdreloc.c,v 1.38 2010/08/06 16:33:19 joerg Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/types.h> #include <sys/types.h>
@ -127,7 +127,7 @@ _rtld_relocate_nonplt_self(Elf_Dyn *dynp, Elf_Addr relocbase)
} }
int int
_rtld_relocate_nonplt_objects(const Obj_Entry *obj) _rtld_relocate_nonplt_objects(Obj_Entry *obj)
{ {
const Elf_Rela *rela; const Elf_Rela *rela;
const Elf_Sym *def = NULL; const Elf_Sym *def = NULL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtld.h,v 1.91 2010/04/05 14:01:26 joerg Exp $ */ /* $NetBSD: rtld.h,v 1.92 2010/08/06 16:33:17 joerg Exp $ */
/* /*
* Copyright 1996 John D. Polstra. * Copyright 1996 John D. Polstra.
@ -280,7 +280,7 @@ int _rtld_sysctl(const char *, void *, size_t *);
/* reloc.c */ /* reloc.c */
int _rtld_do_copy_relocations(const Obj_Entry *); int _rtld_do_copy_relocations(const Obj_Entry *);
int _rtld_relocate_objects(Obj_Entry *, bool); int _rtld_relocate_objects(Obj_Entry *, bool);
int _rtld_relocate_nonplt_objects(const Obj_Entry *); int _rtld_relocate_nonplt_objects(Obj_Entry *);
int _rtld_relocate_plt_lazy(const Obj_Entry *); int _rtld_relocate_plt_lazy(const Obj_Entry *);
int _rtld_relocate_plt_objects(const Obj_Entry *); int _rtld_relocate_plt_objects(const Obj_Entry *);
void _rtld_setup_pltgot(const Obj_Entry *); void _rtld_setup_pltgot(const Obj_Entry *);
@ -309,6 +309,7 @@ void _rtld_combreloc_reset(const Obj_Entry *);
#endif #endif
/* map_object.c */ /* map_object.c */
struct stat;
Obj_Entry *_rtld_map_object(const char *, int, const struct stat *); Obj_Entry *_rtld_map_object(const char *, int, const struct stat *);
void _rtld_obj_free(Obj_Entry *); void _rtld_obj_free(Obj_Entry *);
Obj_Entry *_rtld_obj_new(void); Obj_Entry *_rtld_obj_new(void);