aboutsummaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-addr.c8
-rw-r--r--elf/dl-debug.c4
-rw-r--r--elf/dl-deps.c4
-rw-r--r--elf/dl-error.c4
-rw-r--r--elf/dl-fini.c4
-rw-r--r--elf/dl-init.c6
-rw-r--r--elf/dl-load.c14
-rw-r--r--elf/dl-lookup.c4
-rw-r--r--elf/dl-minimal.c4
-rw-r--r--elf/dl-object.c4
-rw-r--r--elf/dl-open.c2
-rw-r--r--elf/dl-preinit.c4
-rw-r--r--elf/dl-profile.c4
-rw-r--r--elf/dl-profstub.c4
-rw-r--r--elf/dl-reloc.c6
-rw-r--r--elf/dl-runtime.c18
-rw-r--r--elf/dl-support.c4
-rw-r--r--elf/dl-symbol.c4
-rw-r--r--elf/dl-version.c10
-rw-r--r--elf/do-lookup.h6
-rw-r--r--elf/do-rel.h6
-rw-r--r--elf/dynamic-link.h31
-rw-r--r--elf/rtld.c6
-rw-r--r--elf/sprof.c4
24 files changed, 85 insertions, 80 deletions
diff --git a/elf/dl-addr.c b/elf/dl-addr.c
index 14bff06f13..b0b864fa57 100644
--- a/elf/dl-addr.c
+++ b/elf/dl-addr.c
@@ -1,5 +1,5 @@
/* Locate the shared object symbol nearest a given address.
- Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,7 +19,7 @@
#include <dlfcn.h>
#include <stddef.h>
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
int
@@ -62,8 +62,8 @@ _dl_addr (const void *address, Dl_info *info)
info->dli_fname = match->l_name;
info->dli_fbase = (void *) match->l_addr;
- symtab = (const void *) match->l_info[DT_SYMTAB]->d_un.d_ptr;
- strtab = (const void *) match->l_info[DT_STRTAB]->d_un.d_ptr;
+ symtab = (const void *) D_PTR (match, l_info[DT_SYMTAB]);
+ strtab = (const void *) D_PTR (match, l_info[DT_STRTAB]);
/* We assume that the string table follows the symbol table, because
there is no way in ELF to know the size of the dynamic symbol table!! */
diff --git a/elf/dl-debug.c b/elf/dl-debug.c
index e0bf1fbbc4..2d2b20bb2d 100644
--- a/elf/dl-debug.c
+++ b/elf/dl-debug.c
@@ -1,5 +1,5 @@
/* Communicate dynamic linker state to the debugger at runtime.
- Copyright (C) 1996, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,7 +17,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
/* This structure communicates dl state to the debugger. The debugger
normally finds it via the DT_DEBUG entry in the dynamic section, but in
diff --git a/elf/dl-deps.c b/elf/dl-deps.c
index 57d10567d1..26dd0f80a9 100644
--- a/elf/dl-deps.c
+++ b/elf/dl-deps.c
@@ -24,7 +24,7 @@
#include <string.h>
#include <unistd.h>
#include <sys/param.h>
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
#include <dl-dst.h>
@@ -195,7 +195,7 @@ _dl_map_object_deps (struct link_map *map,
if (l->l_info[DT_NEEDED] || l->l_info[AUXTAG] || l->l_info[FILTERTAG])
{
- const char *strtab = (const void *) l->l_info[DT_STRTAB]->d_un.d_ptr;
+ const char *strtab = (const void *) D_PTR (l, l_info[DT_STRTAB]);
struct openaux_args args;
struct list *orig;
const ElfW(Dyn) *d;
diff --git a/elf/dl-error.c b/elf/dl-error.c
index eda2725c5f..fbf5fce04f 100644
--- a/elf/dl-error.c
+++ b/elf/dl-error.c
@@ -1,5 +1,5 @@
/* Error handling for runtime dynamic linker.
- Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
#include <bits/libc-tsd.h>
/* This structure communicates state between _dl_catch_error and
diff --git a/elf/dl-fini.c b/elf/dl-fini.c
index 3f2d625652..41637c5977 100644
--- a/elf/dl-fini.c
+++ b/elf/dl-fini.c
@@ -1,5 +1,5 @@
/* Call the termination functions of loaded shared objects.
- Copyright (C) 1995, 1996, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,98,99,2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -17,7 +17,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
void
internal_function
diff --git a/elf/dl-init.c b/elf/dl-init.c
index c4b1e22152..c1e927180c 100644
--- a/elf/dl-init.c
+++ b/elf/dl-init.c
@@ -1,5 +1,5 @@
/* Return the next shared object initializer function not yet run.
- Copyright (C) 1995, 1996, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
Boston, MA 02111-1307, USA. */
#include <stddef.h>
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
/* Run initializers for MAP and its dependencies, in inverse dependency
@@ -88,7 +88,7 @@ _dl_init_next (struct r_scope_elem *searchlist)
l->l_name[0] ? l->l_name : _dl_argv[0],
"\n\n", NULL);
- array = (ElfW(Addr) *) l->l_info[DT_INIT_ARRAY]->d_un.d_ptr;
+ array = (ElfW(Addr) *) D_PTR (l, l_info[DT_INIT_ARRAY]);
return l->l_addr + array[l->l_runcount - 2];
/* NOTREACHED */
}
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 4651a45265..0ec215223c 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1,5 +1,5 @@
/* Map in a shared object's segments from the file.
- Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
#include <sys/mman.h>
#include <sys/param.h>
#include <sys/stat.h>
@@ -591,7 +591,7 @@ _dl_init_paths (const char *llp)
/* Allocate room for the search path and fill in information
from RUNPATH. */
l->l_runpath_dirs =
- decompose_rpath ((const void *) (l->l_info[DT_STRTAB]->d_un.d_ptr
+ decompose_rpath ((const void *) (D_PTR (l, l_info[DT_STRTAB])
+ l->l_info[DT_RUNPATH]->d_un.d_val),
l, "RUNPATH");
@@ -606,7 +606,7 @@ _dl_init_paths (const char *llp)
/* Allocate room for the search path and fill in information
from RPATH. */
l->l_rpath_dirs =
- decompose_rpath ((const void *) (l->l_info[DT_STRTAB]->d_un.d_ptr
+ decompose_rpath ((const void *) (D_PTR (l, l_info[DT_STRTAB])
+ l->l_info[DT_RPATH]->d_un.d_val),
l, "RPATH");
else
@@ -1300,7 +1300,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
if (l->l_info[DT_SONAME] == NULL)
continue;
- soname = (const void *) (l->l_info[DT_STRTAB]->d_un.d_ptr
+ soname = (const void *) (D_PTR (l, l_info[DT_STRTAB])
+ l->l_info[DT_SONAME]->d_un.d_val);
if (strcmp (name, soname) != 0)
continue;
@@ -1343,7 +1343,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
/* Make sure the cache information is available. */
if (l->l_rpath_dirs == NULL)
{
- size_t ptrval = (l->l_info[DT_STRTAB]->d_un.d_ptr
+ size_t ptrval = (D_PTR (l, l_info[DT_STRTAB])
+ l->l_info[DT_RPATH]->d_un.d_val);
l->l_rpath_dirs =
decompose_rpath ((const char *) ptrval, l, "RPATH");
@@ -1373,7 +1373,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
/* Make sure the cache information is available. */
if (loader->l_runpath_dirs == NULL)
{
- size_t ptrval = (loader->l_info[DT_STRTAB]->d_un.d_ptr
+ size_t ptrval = (D_PTR (loader, l_info[DT_STRTAB])
+ loader->l_info[DT_RUNPATH]->d_un.d_val);
loader->l_runpath_dirs =
decompose_rpath ((const char *) ptrval, loader, "RUNPATH");
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index bfe942cbb7..702fd3b824 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -1,5 +1,5 @@
/* Look up a symbol in the loaded objects.
- Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,7 +20,7 @@
#include <alloca.h>
#include <string.h>
#include <unistd.h>
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
#include "dl-hash.h"
#include <dl-machine.h>
diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c
index 249ff71225..7c9a612b88 100644
--- a/elf/dl-minimal.c
+++ b/elf/dl-minimal.c
@@ -1,5 +1,5 @@
/* Minimal replacements for basic facilities used in the dynamic linker.
- Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,97,98,2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
#include <stdio-common/_itoa.h>
#include <assert.h>
diff --git a/elf/dl-object.c b/elf/dl-object.c
index 4914bc2720..986929ce20 100644
--- a/elf/dl-object.c
+++ b/elf/dl-object.c
@@ -1,5 +1,5 @@
/* Storage management for the chain of loaded shared objects.
- Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,7 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
#include <assert.h>
diff --git a/elf/dl-open.c b/elf/dl-open.c
index 2a03921101..c497d2e34e 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -27,7 +27,7 @@
#include <sys/mman.h> /* Check whether MAP_COPY is defined. */
#include <sys/param.h>
#include <bits/libc-lock.h>
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
#include <dl-dst.h>
diff --git a/elf/dl-preinit.c b/elf/dl-preinit.c
index 67c5edb9f3..8ef4afc5b6 100644
--- a/elf/dl-preinit.c
+++ b/elf/dl-preinit.c
@@ -1,5 +1,5 @@
/* Return the next shared object pre-initializer function not yet run.
- Copyright (C) 1995, 1996, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,98,99,2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
Boston, MA 02111-1307, USA. */
#include <stddef.h>
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
/* Run initializers for MAP and its dependencies, in inverse dependency
diff --git a/elf/dl-profile.c b/elf/dl-profile.c
index 2ee2dd5aa3..1fbada6fb1 100644
--- a/elf/dl-profile.c
+++ b/elf/dl-profile.c
@@ -1,5 +1,5 @@
/* Profiling of shared libraries.
- Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
Based on the BSD mcount implementation.
@@ -27,7 +27,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
#include <sys/gmon.h>
#include <sys/gmon_out.h>
#include <sys/mman.h>
diff --git a/elf/dl-profstub.c b/elf/dl-profstub.c
index 55304a73df..db6693bdce 100644
--- a/elf/dl-profstub.c
+++ b/elf/dl-profstub.c
@@ -1,5 +1,5 @@
/* Helper definitions for profiling of shared libraries.
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,7 +20,7 @@
#include <dlfcn.h>
#include <elf.h>
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
/* This is the map for the shared object we profile. It is defined here
only because we test for this value being NULL or not. */
diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
index 7b7e7f1090..8d180732d6 100644
--- a/elf/dl-reloc.c
+++ b/elf/dl-reloc.c
@@ -1,5 +1,5 @@
/* Relocate a shared object and resolve its references to other loaded objects.
- Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,7 +20,7 @@
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
#include <sys/mman.h>
#include <sys/types.h>
#include "dynamic-link.h"
@@ -67,7 +67,7 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
/* Do the actual relocation of the object's GOT and other data. */
/* String table object symbols. */
- const char *strtab = (const void *) l->l_info[DT_STRTAB]->d_un.d_ptr;
+ const char *strtab = (const void *) D_PTR (l, l_info[DT_STRTAB]);
/* This macro is used as a callback from the ELF_DYNAMIC_RELOCATE code. */
#define RESOLVE(ref, version, flags) \
diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c
index 23f7587b53..ba81750c1a 100644
--- a/elf/dl-runtime.c
+++ b/elf/dl-runtime.c
@@ -20,7 +20,7 @@
#include <alloca.h>
#include <stdlib.h>
#include <unistd.h>
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
#include "dynamic-link.h"
#if !defined ELF_MACHINE_NO_RELA || ELF_MACHINE_NO_REL
@@ -50,11 +50,11 @@ fixup (
struct link_map *l, ElfW(Word) reloc_offset)
{
const ElfW(Sym) *const symtab
- = (const void *) l->l_info[DT_SYMTAB]->d_un.d_ptr;
- const char *strtab = (const void *) l->l_info[DT_STRTAB]->d_un.d_ptr;
+ = (const void *) D_PTR (l, l_info[DT_SYMTAB]);
+ const char *strtab = (const void *) D_PTR (l, l_info[DT_STRTAB]);
const PLTREL *const reloc
- = (const void *) (l->l_info[DT_JMPREL]->d_un.d_ptr + reloc_offset);
+ = (const void *) (D_PTR (l, l_info[DT_JMPREL]) + reloc_offset);
const ElfW(Sym) *sym = &symtab[ELFW(R_SYM) (reloc->r_info)];
void *const rel_addr = (void *)(l->l_addr + reloc->r_offset);
ElfW(Addr) value;
@@ -77,7 +77,7 @@ fixup (
default:
{
const ElfW(Half) *vernum =
- (const void *) l->l_info[VERSYMIDX (DT_VERSYM)]->d_un.d_ptr;
+ (const void *) D_PTR (l, l_info[VERSYMIDX (DT_VERSYM)]);
ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info)];
const struct r_found_version *version = &l->l_versions[ndx];
@@ -141,11 +141,11 @@ profile_fixup (
{
/* This is the first time we have to relocate this object. */
const ElfW(Sym) *const symtab
- = (const void *) l->l_info[DT_SYMTAB]->d_un.d_ptr;
- const char *strtab = (const void *) l->l_info[DT_STRTAB]->d_un.d_ptr;
+ = (const void *) D_PTR (l, l_info[DT_SYMTAB]);
+ const char *strtab = (const void *) D_PTR (l, l_info[DT_STRTAB]);
const PLTREL *const reloc
- = (const void *) (l->l_info[DT_JMPREL]->d_un.d_ptr + reloc_offset);
+ = (const void *) (D_PTR (l, l_info[DT_JMPREL]) + reloc_offset);
const ElfW(Sym) *sym = &symtab[ELFW(R_SYM) (reloc->r_info)];
/* Sanity check that we're really looking at a PLT relocation. */
@@ -160,7 +160,7 @@ profile_fixup (
default:
{
const ElfW(Half) *vernum =
- (const void *) l->l_info[VERSYMIDX (DT_VERSYM)]->d_un.d_ptr;
+ (const void *) D_PTR (l,l_info[VERSYMIDX (DT_VERSYM)]);
ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info)];
const struct r_found_version *version = &l->l_versions[ndx];
diff --git a/elf/dl-support.c b/elf/dl-support.c
index edf58742be..581c79c012 100644
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -1,5 +1,5 @@
/* Support for dynamic linking code in static libc.
- Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1996,97,98,99,2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
#include <dl-machine.h>
extern char *__progname;
diff --git a/elf/dl-symbol.c b/elf/dl-symbol.c
index 945f5446ae..136b10a2b5 100644
--- a/elf/dl-symbol.c
+++ b/elf/dl-symbol.c
@@ -1,5 +1,5 @@
/* Look up a symbol's run-time value in the scope of a loaded object.
- Copyright (C) 1995, 1996, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,98,99,2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
Boston, MA 02111-1307, USA. */
#include <stddef.h>
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
/* Look up symbol NAME in MAP's scope and return its run-time address. */
diff --git a/elf/dl-version.c b/elf/dl-version.c
index 8d59fe278f..59e8dd33c8 100644
--- a/elf/dl-version.c
+++ b/elf/dl-version.c
@@ -1,5 +1,5 @@
/* Handle symbol and library versioning.
- Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,7 +22,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
#include <stdio-common/_itoa.h>
#include <assert.h>
@@ -77,7 +77,7 @@ internal_function
match_symbol (const char *name, ElfW(Word) hash, const char *string,
struct link_map *map, int verbose, int weak)
{
- const char *strtab = (const void *) map->l_info[DT_STRTAB]->d_un.d_ptr;
+ const char *strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
ElfW(Addr) def_offset;
ElfW(Verdef) *def;
@@ -175,7 +175,7 @@ _dl_check_map_versions (struct link_map *map, int verbose)
/* If we don't have a string table, we must be ok. */
if (map->l_info[DT_STRTAB] == NULL)
return 0;
- strtab = (const void *) map->l_info[DT_STRTAB]->d_un.d_ptr;
+ strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
dyn = map->l_info[VERSYMIDX (DT_VERNEED)];
def = map->l_info[VERSYMIDX (DT_VERDEF)];
@@ -285,7 +285,7 @@ _dl_check_map_versions (struct link_map *map, int verbose)
/* Compute the pointer to the version symbols. */
map->l_versyms =
- (void *) map->l_info[VERSYMIDX (DT_VERSYM)]->d_un.d_ptr;
+ (void *) D_PTR (map, l_info[VERSYMIDX (DT_VERSYM)]);
if (dyn != NULL)
{
diff --git a/elf/do-lookup.h b/elf/do-lookup.h
index 03eb2c66c7..85f23417b2 100644
--- a/elf/do-lookup.h
+++ b/elf/do-lookup.h
@@ -1,5 +1,5 @@
/* Look up a symbol in the loaded objects.
- Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -67,8 +67,8 @@ FCT (const char *undef_name, struct link_map *undef_map,
map->l_name[0] ? map->l_name : _dl_argv[0],
"\n", NULL);
- symtab = (const void *) map->l_info[DT_SYMTAB]->d_un.d_ptr;
- strtab = (const void *) map->l_info[DT_STRTAB]->d_un.d_ptr;
+ symtab = (const void *) D_PTR (map, l_info[DT_SYMTAB]);
+ strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
verstab = map->l_versyms;
/* Search the appropriate hash bucket in this object's symbol table
diff --git a/elf/do-rel.h b/elf/do-rel.h
index 955acfef77..721390d4e6 100644
--- a/elf/do-rel.h
+++ b/elf/do-rel.h
@@ -1,5 +1,5 @@
/* Do relocations for ELF dynamic linking.
- Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -53,12 +53,12 @@ elf_dynamic_do_rel (struct link_map *map,
else
{
const ElfW(Sym) *const symtab =
- (const void *) map->l_info[DT_SYMTAB]->d_un.d_ptr;
+ (const void *) D_PTR (map, l_info[DT_SYMTAB]);
if (map->l_info[VERSYMIDX (DT_VERSYM)])
{
const ElfW(Half) *const version =
- (const void *) map->l_info[VERSYMIDX (DT_VERSYM)]->d_un.d_ptr;
+ (const void *) D_PTR (map, l_info[VERSYMIDX (DT_VERSYM)]);
for (; r < end; ++r)
{
diff --git a/elf/dynamic-link.h b/elf/dynamic-link.h
index 7edac41cc0..cd30656ff3 100644
--- a/elf/dynamic-link.h
+++ b/elf/dynamic-link.h
@@ -1,5 +1,5 @@
/* Inline functions for dynamic linking.
- Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -62,42 +62,45 @@ elf_get_dynamic_info (struct link_map *l)
assert (! "bad dynamic tag");
++dyn;
}
-
+#ifndef DL_RO_DYN_SECTION
if (info[DT_PLTGOT] != NULL)
info[DT_PLTGOT]->d_un.d_ptr += l_addr;
if (info[DT_STRTAB] != NULL)
info[DT_STRTAB]->d_un.d_ptr += l_addr;
if (info[DT_SYMTAB] != NULL)
info[DT_SYMTAB]->d_un.d_ptr += l_addr;
-#if ! ELF_MACHINE_NO_RELA
+# if ! ELF_MACHINE_NO_RELA
if (info[DT_RELA] != NULL)
{
assert (info[DT_RELAENT]->d_un.d_val == sizeof (ElfW(Rela)));
info[DT_RELA]->d_un.d_ptr += l_addr;
}
-#endif
-#if ! ELF_MACHINE_NO_REL
+# endif
+# if ! ELF_MACHINE_NO_REL
if (info[DT_REL] != NULL)
{
assert (info[DT_RELENT]->d_un.d_val == sizeof (ElfW(Rel)));
info[DT_REL]->d_un.d_ptr += l_addr;
}
+# endif
#endif
if (info[DT_PLTREL] != NULL)
{
-#if ELF_MACHINE_NO_RELA
+# if ELF_MACHINE_NO_RELA
assert (info[DT_PLTREL]->d_un.d_val == DT_REL);
-#elif ELF_MACHINE_NO_REL
+# elif ELF_MACHINE_NO_REL
assert (info[DT_PLTREL]->d_un.d_val == DT_RELA);
-#else
+# else
assert (info[DT_PLTREL]->d_un.d_val == DT_REL
|| info[DT_PLTREL]->d_un.d_val == DT_RELA);
-#endif
+# endif
}
+#ifndef DL_RO_DYN_SECTION
if (info[DT_JMPREL] != NULL)
info[DT_JMPREL]->d_un.d_ptr += l_addr;
if (info[VERSYMIDX (DT_VERSYM)] != NULL)
info[VERSYMIDX (DT_VERSYM)]->d_un.d_ptr += l_addr;
+#endif
if (info[DT_FLAGS] != NULL)
{
/* Flags are used. Translate to the old form where available.
@@ -111,9 +114,11 @@ elf_get_dynamic_info (struct link_map *l)
if (flags & DF_BIND_NOW)
info[DT_BIND_NOW] = info[DT_FLAGS];
}
+#ifndef DL_RO_DYN_SECTION
/* Determine how many constructors there are. */
if (info[DT_INIT_ARRAY] != NULL)
info[DT_INIT_ARRAY]->d_un.d_ptr += l_addr;
+#endif
l->l_initcount = 1 + (info[DT_INIT_ARRAY]
? (info[DT_INIT_ARRAYSZ]->d_un.d_val
/ sizeof (ElfW(Addr)))
@@ -151,7 +156,7 @@ elf_get_dynamic_info (struct link_map *l)
\
if ((map)->l_info[DT_##RELOC]) \
{ \
- ranges[0].start = (map)->l_info[DT_##RELOC]->d_un.d_ptr; \
+ ranges[0].start = D_PTR ((map), l_info[DT_##RELOC]); \
ranges[0].size = (map)->l_info[DT_##RELOC##SZ]->d_un.d_val; \
} \
\
@@ -159,7 +164,7 @@ elf_get_dynamic_info (struct link_map *l)
&& (map)->l_info[DT_PLTREL] \
&& (!test_rel || (map)->l_info[DT_PLTREL]->d_un.d_val == DT_##RELOC)) \
{ \
- ranges[1].start = (map)->l_info[DT_JMPREL]->d_un.d_ptr; \
+ ranges[1].start = D_PTR ((map), l_info[DT_JMPREL]); \
ranges[1].size = (map)->l_info[DT_PLTRELSZ]->d_un.d_val; \
ranges[2].start = ranges[1].start + ranges[1].size; \
ranges[2].size = ranges[0].start + ranges[0].size - ranges[2].start; \
@@ -183,13 +188,13 @@ elf_get_dynamic_info (struct link_map *l)
\
if ((map)->l_info[DT_##RELOC]) \
{ \
- ranges[0].start = (map)->l_info[DT_##RELOC]->d_un.d_ptr; \
+ ranges[0].start = D_PTR ((map), l_info[DT_##RELOC]); \
ranges[0].size = (map)->l_info[DT_##RELOC##SZ]->d_un.d_val; \
} \
if ((map)->l_info[DT_PLTREL] \
&& (!test_rel || (map)->l_info[DT_PLTREL]->d_un.d_val == DT_##RELOC)) \
{ \
- ElfW(Addr) start = (map)->l_info[DT_JMPREL]->d_un.d_ptr; \
+ ElfW(Addr) start = D_PTR ((map), l_info[DT_JMPREL]); \
\
if ((do_lazy) \
/* This test does not only detect whether the relocation \
diff --git a/elf/rtld.c b/elf/rtld.c
index 94b93862b6..562e44aec8 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -22,7 +22,7 @@
#include <string.h>
#include <unistd.h>
#include <sys/mman.h> /* Check if MAP_ANON is defined. */
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
#include <stdio-common/_itoa.h>
#include <entry.h>
#include <fpu_control.h>
@@ -317,7 +317,7 @@ find_needed (const char *name)
static int
match_version (const char *string, struct link_map *map)
{
- const char *strtab = (const void *) map->l_info[DT_STRTAB]->d_un.d_ptr;
+ const char *strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
ElfW(Verdef) *def;
#define VERDEFTAG (DT_NUM + DT_PROCNUM + DT_VERSIONTAGIDX (DT_VERDEF))
@@ -926,7 +926,7 @@ of this helper program; chances are you did not intend to run this program.\n\
if (dyn == NULL)
continue;
- strtab = (const void *) map->l_info[DT_STRTAB]->d_un.d_ptr;
+ strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
ent = (ElfW(Verneed) *) (map->l_addr + dyn->d_un.d_ptr);
if (first)
diff --git a/elf/sprof.c b/elf/sprof.c
index 79c315291d..bf4ce0efe6 100644
--- a/elf/sprof.c
+++ b/elf/sprof.c
@@ -1,5 +1,5 @@
/* Read and display shared object profiling data.
- Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -32,7 +32,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <elf/ldsodefs.h>
+#include <ldsodefs.h>
#include <sys/gmon.h>
#include <sys/gmon_out.h>
#include <sys/mman.h>