aboutsummaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-03-23 20:31:46 +0000
committerUlrich Drepper <drepper@redhat.com>2000-03-23 20:31:46 +0000
commita42195dbe4535234e3896f558dea8d7c839569f4 (patch)
tree2965f2ff1f3d43431cd5c297a58d6adf018488dd /elf
parent922809a2e3dbb92b6faae17523d055783295cbdc (diff)
downloadglibc-a42195dbe4535234e3896f558dea8d7c839569f4.zip
glibc-a42195dbe4535234e3896f558dea8d7c839569f4.tar.gz
glibc-a42195dbe4535234e3896f558dea8d7c839569f4.tar.bz2
Update.
2000-03-23 Andreas Jaeger <aj@suse.de> * elf/dl-addr.c: Adjust include paths for ldsodefs location change. * elf/dl-debug.c: Likewise. * elf/dl-deps.c: Likewise. * elf/dl-error.c: Likewise. * elf/dl-fini.c: Likewise. * elf/dl-init.c: Likewise. * elf/dl-load.c: Likewise. * elf/dl-lookup.c: Likewise. * elf/dl-minimal.c: Likewise. * elf/dl-object.c: Likewise. * elf/dl-open.c: Likewise. * elf/dl-preinit.c: Likewise. * elf/dl-profile.c: Likewise. * elf/dl-profstub.c: Likewise. * elf/dl-reloc.c: Likewise. * elf/dl-runtime.c: Likewise. * elf/dl-support.c: Likewise. * elf/dl-symbol.c: Likewise. * elf/dl-version.c: Likewise. * elf/rtld.c: Likewise. * elf/sprof.c: Likewise. * sysdeps/generic/dl-cache.c: Likewise. * sysdeps/generic/dl-origin.c: Likewise. * sysdeps/generic/dl-sysdep.c: Likewise. * sysdeps/generic/elf/backtracesyms.c: Likewise. * sysdeps/generic/elf/backtracesymsfd.c: Likewise. * sysdeps/generic/libc-start.c: Likewise. * sysdeps/mach/hurd/dl-sysdep.c: Likewise. * sysdeps/powerpc/dl-machine.c: Likewise. * sysdeps/powerpc/elf/libc-start.c: Likewise. * sysdeps/sparc/sparc32/dl-machine.h: Likewise. * sysdeps/sparc/sparc64/dl-machine.h: Likewise. * sysdeps/unix/sysv/linux/dl-origin.c: Likewise. * elf/ldsodefs.h: Move file to ... * sysdeps/generic/ldsodefs.h: ... here. * sysdeps/generic/ldsodefs.h: Add definition for D_PTR. * sysdeps/mips/elf/ldsodefs.h: New file. * elf/dl-version.c (match_symbol): Use D_PTR to access relocated entries in l_info. (_dl_check_map_versions): Likewise. * elf/dl-reloc.c (_dl_relocate_object): Likewise. * elf/dl-load.c (_dl_init_paths): Likewise. (_dl_map_object): Likewise. * elf/dynamic-link.h (_ELF_DYNAMIC_DO_RELOC): Likewise. (elf_get_dynamic_info): Likewise. * elf/do-lookup.h (FCT): Likewise. * elf/do-rel.h (elf_dynamic_do_rel): Likewise. * elf/dl-deps.c (_dl_map_object_deps): Likewise. * elf/dl-addr.c (_dl_addr): Likewise. * elf/dl-runtime.c (profile_fixup): Likewise. (fixup): Likewise. * elf/dl-init.c (_dl_init_next): Likewise. * sysdeps/generic/dl-machine.h (elf_machine_runtime_setup): Likewise. * sysdeps/unix/sysv/linux/i386/dl-librecon.h (DISTINGUISH_LIB_VERSIONS): Likewise. * sysdeps/i386/dl-machine.h (elf_machine_runtime_setup): Likewise. (elf_machine_rel): Likewise. * elf/dynamic-link.h (elf_get_dynamic_info): Only change l_info for writable dynamic section.
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 14bff06..b0b864f 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 e0bf1fb..2d2b20b 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 57d1056..26dd0f8 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 eda2725..fbf5fce 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 3f2d625..41637c5 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 c4b1e22..c1e9271 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 4651a45..0ec2152 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 bfe942c..702fd3b 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 249ff71..7c9a612 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 4914bc2..986929c 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 2a03921..c497d2e 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 67c5edb..8ef4afc 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 2ee2dd5..1fbada6 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 55304a7..db6693b 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 7b7e7f1..8d18073 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 23f7587..ba81750 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 edf5874..581c79c 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 945f544..136b10a 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 8d59fe2..59e8dd3 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 03eb2c6..85f2341 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 955acfe..721390d 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 7edac41..cd30656 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 94b9386..562e44a 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 79c3152..bf4ce0e 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>