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-