diff options
| author | Ulrich Drepper <drepper@redhat.com> | 2004-03-06 08:19:29 +0000 |
|---|---|---|
| committer | Ulrich Drepper <drepper@redhat.com> | 2004-03-06 08:19:29 +0000 |
| commit | 154d10bdf1984f4fe28f898e07bc25c5367f443e (patch) | |
| tree | 10b4e36bf9d3fd223d680a054e744bf84bb66212 /elf | |
| parent | dd70526e8a07e95336ee87e1d968deafa8b5f34c (diff) | |
| download | glibc-154d10bdf1984f4fe28f898e07bc25c5367f443e.tar.xz glibc-154d10bdf1984f4fe28f898e07bc25c5367f443e.zip | |
Update.
* elf/Versions: Remove functions which are not exported anymore.
* dlfcn/dlerror.c: Call ld.so functions through GLSO.
* dlfcn/dlinfo.c: Likewise.
* elf/dl-close.c: Likewise.
* elf/dl-libc.c: Likewise.
* elf/dl-open.c: Likewise.
* elf/dl-sym.c: Likewise.
* sysdeps/generic/libc-start.c: Likewise.
* elf/dl-debug.c: Remove *_internal definition. Don't use INTUSE for
functions which are not exported anymore.
* elf/dl-deps.c: Likewise.
* elf/dl-dst.h: 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-misc.c: Likewise.
* elf/dl-profile.c: Likewise.
* elf/dl-profstub.c: Likewise.
* elf/dl-reloc.c: Likewise.
* elf/dl-runtime.c: Likewise.
* elf/dl-version.c: Likewise.
* elf/do-lookup.h: Likewise.
* include/dlfcn.h: Likewise.
* sysdeps/generic/dl-cache.c: Likewise.
* sysdeps/generic/dl-fptr.c: Likewise.
* sysdeps/generic/dl-origin.c: Likewise.
* sysdeps/generic/dl-sysdep.c: Likewise.
* sysdeps/generic/dl-tls.c: Likewise.
* sysdeps/generic/ldsodefs.h: Likewise.
* sysdeps/i386/dl-tls.h: Likewise.
* sysdeps/unix/sysv/linux/dl-origin.c: Likewise.
* elf/rtld.c: Likewise. Export function though _rtld_global_ro.
* generic/dl-fptr.c: Likewise.
* mach/hurd/dl-sysdep.c: Likewise.
* unix/sysv/linux/ia64/dl-static.c: Likewise.
* unix/sysv/linux/ia64/getpagesize.c: Likewise.
* unix/sysv/linux/m68k/getpagesize.c: Likewise.
* unix/sysv/linux/sparc/sparc32/getpagesize.c: Likewise.
Diffstat (limited to 'elf')
| -rw-r--r-- | elf/Versions | 14 | ||||
| -rw-r--r-- | elf/dl-close.c | 12 | ||||
| -rw-r--r-- | elf/dl-debug.c | 5 | ||||
| -rw-r--r-- | elf/dl-deps.c | 66 | ||||
| -rw-r--r-- | elf/dl-dst.h | 24 | ||||
| -rw-r--r-- | elf/dl-error.c | 8 | ||||
| -rw-r--r-- | elf/dl-fini.c | 15 | ||||
| -rw-r--r-- | elf/dl-init.c | 14 | ||||
| -rw-r--r-- | elf/dl-libc.c | 16 | ||||
| -rw-r--r-- | elf/dl-load.c | 45 | ||||
| -rw-r--r-- | elf/dl-lookup.c | 37 | ||||
| -rw-r--r-- | elf/dl-misc.c | 1 | ||||
| -rw-r--r-- | elf/dl-open.c | 59 | ||||
| -rw-r--r-- | elf/dl-profile.c | 1 | ||||
| -rw-r--r-- | elf/dl-profstub.c | 7 | ||||
| -rw-r--r-- | elf/dl-reloc.c | 44 | ||||
| -rw-r--r-- | elf/dl-runtime.c | 36 | ||||
| -rw-r--r-- | elf/dl-sym.c | 66 | ||||
| -rw-r--r-- | elf/dl-version.c | 14 | ||||
| -rw-r--r-- | elf/do-lookup.h | 6 | ||||
| -rw-r--r-- | elf/rtld.c | 101 |
21 files changed, 299 insertions, 292 deletions
diff --git a/elf/Versions b/elf/Versions index 709a657775..3797cc4eee 100644 --- a/elf/Versions +++ b/elf/Versions @@ -46,17 +46,13 @@ ld { GLIBC_PRIVATE { # Those are in the dynamic linker, but used by libc.so. __libc_enable_secure; - _dl_argv; _dl_catch_error; _dl_check_map_versions; - _dl_debug_printf; _dl_debug_state; _dl_dst_count; - _dl_dst_substitute; _dl_init; _dl_lookup_symbol; _dl_lookup_symbol_skip; - _dl_lookup_versioned_symbol; _dl_lookup_versioned_symbol_skip; - _dl_map_object; _dl_map_object_deps; _dl_out_of_memory; - _dl_relocate_object; _dl_signal_error; _dl_start_profile; _dl_starting_up; - _dl_unload_cache; + _dl_argv; + _dl_out_of_memory; + _dl_starting_up; _rtld_global; _rtld_global_ro; - _dl_tls_symaddr; _dl_allocate_tls; _dl_deallocate_tls; + _dl_allocate_tls; _dl_deallocate_tls; _dl_get_tls_static_info; _dl_allocate_tls_init; - _dl_get_origin; _dl_tls_setup; _dl_rtld_di_serinfo; + _dl_tls_setup; _dl_rtld_di_serinfo; _dl_make_stack_executable; } } diff --git a/elf/dl-close.c b/elf/dl-close.c index c63dabbfe1..62c257ce4f 100644 --- a/elf/dl-close.c +++ b/elf/dl-close.c @@ -125,7 +125,7 @@ _dl_close (void *_map) return; if (__builtin_expect (map->l_opencount, 1) == 0) - _dl_signal_error (0, map->l_name, NULL, N_("shared object not open")); + GLRO(dl_signal_error) (0, map->l_name, NULL, N_("shared object not open")); /* Acquire the lock. */ __rtld_lock_lock_recursive (GL(dl_load_lock)); @@ -135,8 +135,8 @@ _dl_close (void *_map) { /* There are still references to this object. Do nothing more. */ if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0)) - _dl_debug_printf ("\nclosing file=%s; opencount == %u\n", - map->l_name, map->l_opencount); + GLRO(dl_debug_printf) ("\nclosing file=%s; opencount == %u\n", + map->l_name, map->l_opencount); /* Decrement the object's reference counter, not the dependencies'. */ --map->l_opencount; @@ -225,7 +225,7 @@ _dl_close (void *_map) { /* When debugging print a message first. */ if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0)) - _dl_debug_printf ("\ncalling fini: %s\n\n", imap->l_name); + GLRO(dl_debug_printf) ("\ncalling fini: %s\n\n", imap->l_name); /* Call its termination function. Do not do it for half-cooked objects. */ @@ -318,7 +318,7 @@ _dl_close (void *_map) /* Notify the debugger we are about to remove some loaded objects. */ _r_debug.r_state = RT_DELETE; - _dl_debug_state (); + GLRO(dl_debug_state) (); #ifdef USE_TLS size_t tls_free_start; @@ -537,7 +537,7 @@ _dl_close (void *_map) /* Notify the debugger those objects are finalized and gone. */ _r_debug.r_state = RT_CONSISTENT; - _dl_debug_state (); + GLRO(dl_debug_state) (); /* Now we can perhaps also remove the modules for which we had dependencies because of symbol lookup. */ diff --git a/elf/dl-debug.c b/elf/dl-debug.c index e072b685f2..2feb0c5b96 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, 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 1996, 1998, 2000, 2002, 2004 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 @@ -40,7 +40,7 @@ _dl_debug_initialize (ElfW(Addr) ldbase) _r_debug.r_version = 1 /* R_DEBUG_VERSION XXX */; _r_debug.r_ldbase = ldbase; _r_debug.r_map = GL(dl_loaded); - _r_debug.r_brk = (ElfW(Addr)) &INTUSE(_dl_debug_state); + _r_debug.r_brk = (ElfW(Addr)) &_dl_debug_state; } return &_r_debug; @@ -55,4 +55,3 @@ void _dl_debug_state (void) { } -INTDEF (_dl_debug_state) diff --git a/elf/dl-deps.c b/elf/dl-deps.c index b2e6ec612b..1c383b7b98 100644 --- a/elf/dl-deps.c +++ b/elf/dl-deps.c @@ -60,10 +60,10 @@ openaux (void *a) { struct openaux_args *args = (struct openaux_args *) a; - args->aux = INTUSE(_dl_map_object) (args->map, args->name, 0, - (args->map->l_type == lt_executable - ? lt_library : args->map->l_type), - args->trace_mode, args->open_mode); + args->aux = _dl_map_object (args->map, args->name, 0, + (args->map->l_type == lt_executable + ? lt_library : args->map->l_type), + args->trace_mode, args->open_mode); } static ptrdiff_t @@ -108,26 +108,26 @@ struct list \ /* DST must not appear in SUID/SGID programs. */ \ if (INTUSE(__libc_enable_secure)) \ - INTUSE(_dl_signal_error) (0, __str, NULL, N_("\ + _dl_signal_error (0, __str, NULL, N_("\ DST not allowed in SUID/SGID programs")); \ \ __newp = (char *) alloca (DL_DST_REQUIRED (l, __str, strlen (__str), \ __cnt)); \ \ - __result = INTUSE(_dl_dst_substitute) (l, __str, __newp, 0); \ + __result = _dl_dst_substitute (l, __str, __newp, 0); \ \ if (*__result == '\0') \ { \ /* The replacement for the DST is not known. We can't \ processed. */ \ if (fatal) \ - INTUSE(_dl_signal_error) (0, __str, NULL, N_("\ + _dl_signal_error (0, __str, NULL, N_("\ empty dynamics string token substitution")); \ else \ { \ /* This is for DT_AUXILIARY. */ \ if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0))\ - INTUSE(_dl_debug_printf) (N_("\ + _dl_debug_printf (N_("\ cannot load auxiliary `%s' because of empty dynamic string token " \ "substitution\n"), __str); \ continue; \ @@ -241,8 +241,7 @@ _dl_map_object_deps (struct link_map *map, /* Store the tag in the argument structure. */ args.name = name; - err = INTUSE(_dl_catch_error) (&objname, &errstring, openaux, - &args); + err = _dl_catch_error (&objname, &errstring, openaux, &args); if (__builtin_expect (errstring != NULL, 0)) { if (err) @@ -293,16 +292,16 @@ _dl_map_object_deps (struct link_map *map, /* Say that we are about to load an auxiliary library. */ if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0)) - INTUSE(_dl_debug_printf) ("load auxiliary object=%s" - " requested by file=%s\n", - name, - l->l_name[0] - ? l->l_name : rtld_progname); + _dl_debug_printf ("load auxiliary object=%s" + " requested by file=%s\n", + name, + l->l_name[0] + ? l->l_name : rtld_progname); /* We must be prepared that the addressed shared object is not available. */ - err = INTUSE(_dl_catch_error) (&objname, &errstring, - openaux, &args); + err = _dl_catch_error (&objname, &errstring, openaux, + &args); if (__builtin_expect (errstring != NULL, 0)) { /* We are not interested in the error message. */ @@ -321,15 +320,15 @@ _dl_map_object_deps (struct link_map *map, /* Say that we are about to load an auxiliary library. */ if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0)) - INTUSE(_dl_debug_printf) ("load filtered object=%s" - " requested by file=%s\n", - name, - l->l_name[0] - ? l->l_name : rtld_progname); + _dl_debug_printf ("load filtered object=%s" + " requested by file=%s\n", + name, + l->l_name[0] + ? l->l_name : rtld_progname); /* For filter objects the dependency must be available. */ - err = INTUSE(_dl_catch_error) (&objname, &errstring, - openaux, &args); + err = _dl_catch_error (&objname, &errstring, openaux, + &args); if (__builtin_expect (errstring != NULL, 0)) { if (err) @@ -457,8 +456,8 @@ _dl_map_object_deps (struct link_map *map, l->l_initfini = (struct link_map **) malloc ((2 * nneeded + 1) * sizeof needed[0]); if (l->l_initfini == NULL) - INTUSE(_dl_signal_error) (ENOMEM, map->l_name, NULL, - N_("cannot allocate dependency list")); + _dl_signal_error (ENOMEM, map->l_name, NULL, + N_("cannot allocate dependency list")); l->l_initfini[0] = l; memcpy (&l->l_initfini[1], needed, nneeded * sizeof needed[0]); memcpy (&l->l_initfini[nneeded + 1], l->l_initfini, @@ -490,8 +489,8 @@ _dl_map_object_deps (struct link_map *map, (struct link_map **) malloc ((2 * nlist + 1) * sizeof (struct link_map *)); if (map->l_initfini == NULL) - INTUSE(_dl_signal_error) (ENOMEM, map->l_name, NULL, - N_("cannot allocate symbol search list")); + _dl_signal_error (ENOMEM, map->l_name, NULL, + N_("cannot allocate symbol search list")); map->l_searchlist.r_list = &map->l_initfini[nlist + 1]; @@ -531,7 +530,7 @@ _dl_map_object_deps (struct link_map *map, /* As current DT_AUXILIARY/DT_FILTER implementation needs to be rewritten, no need to bother with prelinking the old implementation. */ - INTUSE(_dl_signal_error) (EINVAL, l->l_name, NULL, N_("\ + _dl_signal_error (EINVAL, l->l_name, NULL, N_("\ Filters not supported with LD_TRACE_PRELINKING")); } @@ -545,8 +544,8 @@ Filters not supported with LD_TRACE_PRELINKING")); + (cnt * sizeof (struct link_map *))); if (l->l_local_scope[0] == NULL) - INTUSE(_dl_signal_error) (ENOMEM, map->l_name, NULL, - N_("cannot allocate symbol search list")); + _dl_signal_error (ENOMEM, map->l_name, NULL, + N_("cannot allocate symbol search list")); l->l_local_scope[0]->r_nlist = cnt; l->l_local_scope[0]->r_list = (struct link_map **) (l->l_local_scope[0] + 1); @@ -629,7 +628,6 @@ Filters not supported with LD_TRACE_PRELINKING")); map->l_initfini[nlist] = NULL; if (errno_reason) - INTUSE(_dl_signal_error) (errno_reason == -1 ? 0 : errno_reason, objname, - NULL, errstring); + _dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname, + NULL, errstring); } -INTDEF (_dl_map_object_deps) diff --git a/elf/dl-dst.h b/elf/dl-dst.h index b50d6735e3..42bd4185af 100644 --- a/elf/dl-dst.h +++ b/elf/dl-dst.h @@ -25,13 +25,12 @@ const char *__sf = strchr (name, '$'); \ \ if (__builtin_expect (__sf != NULL, 0)) \ - __cnt = INTUSE(_dl_dst_count) (__sf, is_path); \ + __cnt = _dl_dst_count (__sf, is_path); \ \ __cnt; }) - -/* Prototype for used function. */ -extern size_t _dl_dst_count (const char *name, int is_path); -extern size_t _dl_dst_count_internal (const char *name, int is_path); +#ifndef IS_IN_rtld +# define _dl_dst_count GLRO(dl_dst_count) +#endif /* Guess from the number of DSTs the length of the result string. */ @@ -67,16 +66,7 @@ extern size_t _dl_dst_count_internal (const char *name, int is_path); \ __len; }) -/* Find origin of the executable. */ -extern const char *_dl_get_origin (void); -extern const char *_dl_get_origin_internal (void); - -#ifdef IS_IN_rtld -# define _dl_get_origin INTUSE(_dl_get_origin) +#ifndef IS_IN_rtld +# define _dl_get_origin GLRO(dl_get_origin) +# define _dl_dst_substitute GLRO(dl_dst_substitute) #endif - -/* Prototype for used function. */ -extern char *_dl_dst_substitute (struct link_map *l, const char *name, - char *result, int is_path); -extern char *_dl_dst_substitute_internal (struct link_map *l, const char *name, - char *result, int is_path); diff --git a/elf/dl-error.c b/elf/dl-error.c index f234026701..0ef76c82ee 100644 --- a/elf/dl-error.c +++ b/elf/dl-error.c @@ -113,7 +113,6 @@ _dl_signal_error (int errcode, const char *objname, const char *occation, : "")); } } -INTDEF (_dl_signal_error) void @@ -123,8 +122,8 @@ _dl_signal_cerror (int errcode, const char *objname, const char *occation, { if (__builtin_expect (GLRO(dl_debug_mask) & ~(DL_DEBUG_STATISTICS|DL_DEBUG_PRELINK), 0)) - INTUSE(_dl_debug_printf) ("%s: error: %s: %s (%s)\n", objname, occation, - errstring, receiver ? "continued" : "fatal"); + _dl_debug_printf ("%s: error: %s: %s (%s)\n", objname, occation, + errstring, receiver ? "continued" : "fatal"); if (receiver) { @@ -134,7 +133,7 @@ _dl_signal_cerror (int errcode, const char *objname, const char *occation, (*receiver) (errcode, objname, errstring); } else - INTUSE(_dl_signal_error) (errcode, objname, occation, errstring); + _dl_signal_error (errcode, objname, occation, errstring); } @@ -172,7 +171,6 @@ _dl_catch_error (const char **objname, const char **errstring, *errstring = c.errstring; return errcode == -1 ? 0 : errcode; } -INTDEF (_dl_catch_error) void diff --git a/elf/dl-fini.c b/elf/dl-fini.c index 3dc1db16c9..a56722f6ce 100644 --- a/elf/dl-fini.c +++ b/elf/dl-fini.c @@ -147,9 +147,8 @@ _dl_fini (void) /* When debugging print a message first. */ if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0)) - INTUSE(_dl_debug_printf) ("\ncalling fini: %s\n\n", - l->l_name[0] - ? l->l_name : rtld_progname); + _dl_debug_printf ("\ncalling fini: %s\n\n", + l->l_name[0] ? l->l_name : rtld_progname); /* First see whether an array is given. */ if (l->l_info[DT_FINI_ARRAY] != NULL) @@ -176,12 +175,12 @@ _dl_fini (void) if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_STATISTICS, 0)) { - INTUSE(_dl_debug_printf) ("\nruntime linker statistics:\n"); - INTUSE(_dl_debug_printf) ("\ + _dl_debug_printf ("\nruntime linker statistics:\n"); + _dl_debug_printf ("\ final number of relocations: %lu\n", - GL(dl_num_relocations)); - INTUSE(_dl_debug_printf) ("\ + GL(dl_num_relocations)); + _dl_debug_printf ("\ final number of relocations from cache: %lu\n", - GL(dl_num_cache_relocations)); + GL(dl_num_cache_relocations)); } } diff --git a/elf/dl-init.c b/elf/dl-init.c index 37d5045d03..c06c71bbeb 100644 --- a/elf/dl-init.c +++ b/elf/dl-init.c @@ -52,8 +52,8 @@ call_init (struct link_map *l, int argc, char **argv, char **env) /* Print a debug message if wanted. */ if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0)) - INTUSE(_dl_debug_printf) ("\ncalling init: %s\n\n", - l->l_name[0] ? l->l_name : rtld_progname); + _dl_debug_printf ("\ncalling init: %s\n\n", + l->l_name[0] ? l->l_name : rtld_progname); /* Now run the local constructors. There are two forms of them: - the one named by DT_INIT @@ -109,9 +109,9 @@ _dl_init (struct link_map *main_map, int argc, char **argv, char **env) unsigned int cnt; if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0)) - INTUSE(_dl_debug_printf) ("\ncalling preinit: %s\n\n", - main_map->l_name[0] - ? main_map->l_name : rtld_progname); + _dl_debug_printf ("\ncalling preinit: %s\n\n", + main_map->l_name[0] + ? main_map->l_name : rtld_progname); addrs = (ElfW(Addr) *) (preinit_array->d_un.d_ptr + main_map->l_addr); for (cnt = 0; cnt < i; ++cnt) @@ -123,7 +123,7 @@ _dl_init (struct link_map *main_map, int argc, char **argv, char **env) not been used before. */ r = _dl_debug_initialize (0); r->r_state = RT_ADD; - INTUSE(_dl_debug_state) (); + _dl_debug_state (); /* Stupid users forced the ELF specification to be changed. It now says that the dynamic loader is responsible for determining the @@ -141,7 +141,7 @@ _dl_init (struct link_map *main_map, int argc, char **argv, char **env) /* Notify the debugger all new objects are now ready to go. */ r->r_state = RT_CONSISTENT; - INTUSE(_dl_debug_state) (); + _dl_debug_state (); /* Finished starting up. */ INTUSE(_dl_starting_up) = 0; diff --git a/elf/dl-libc.c b/elf/dl-libc.c index 557d2c3241..2b8cb0e15d 100644 --- a/elf/dl-libc.c +++ b/elf/dl-libc.c @@ -1,5 +1,5 @@ /* Handle loading and unloading shared objects for internal libc purposes. - Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Zack Weinberg <zack@rabi.columbia.edu>, 1999. @@ -39,7 +39,7 @@ dlerror_run (void (*operate) (void *), void *args) const char *last_errstring = NULL; int result; - (void) _dl_catch_error (&objname, &last_errstring, operate, args); + (void) GLRO(dl_catch_error) (&objname, &last_errstring, operate, args); result = last_errstring != NULL; if (result && last_errstring != _dl_out_of_memory) @@ -85,9 +85,9 @@ do_dlsym (void *ptr) { struct do_dlsym_args *args = (struct do_dlsym_args *) ptr; args->ref = NULL; - args->loadbase = _dl_lookup_symbol (args->name, args->map, &args->ref, - args->map->l_local_scope, 0, - DL_LOOKUP_RETURN_NEWEST); + args->loadbase = GLRO(dl_lookup_symbol) (args->name, args->map, &args->ref, + args->map->l_local_scope, 0, + DL_LOOKUP_RETURN_NEWEST); } static void @@ -126,9 +126,9 @@ do_dlsym_private (void *ptr) struct do_dlsym_args *args = (struct do_dlsym_args *) ptr; args->ref = NULL; - l = _dl_lookup_versioned_symbol (args->name, args->map, - &args->ref, args->map->l_scope, - &vers, 0, 0); + l = GLRO(dl_lookup_versioned_symbol) (args->name, args->map, + &args->ref, args->map->l_scope, + &vers, 0, 0); args->loadbase = l; } diff --git a/elf/dl-load.c b/elf/dl-load.c index f7449bce9c..1ff12836ec 100644 --- a/elf/dl-load.c +++ b/ |
