mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
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.
This commit is contained in:
41
ChangeLog
41
ChangeLog
@ -1,5 +1,40 @@
|
|||||||
2004-03-05 Ulrich Drepper <drepper@redhat.com>
|
2004-03-05 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
* sysdeps/generic/ldsodefs.h (struct rtld_global): Move
|
* sysdeps/generic/ldsodefs.h (struct rtld_global): Move
|
||||||
dl_debug_fd to rtld_global_ro.
|
dl_debug_fd to rtld_global_ro.
|
||||||
* elf/rtld.c: Use GLRO instead of GL for dl_debug_fd.
|
* elf/rtld.c: Use GLRO instead of GL for dl_debug_fd.
|
||||||
@ -79,6 +114,12 @@
|
|||||||
* sysdeps/ia64/dl-machine.h: Likewise.
|
* sysdeps/ia64/dl-machine.h: Likewise.
|
||||||
* sysdeps/arm/dl-machine.h: Likewise.
|
* sysdeps/arm/dl-machine.h: Likewise.
|
||||||
* sysdeps/alpha/dl-machine.h: Likewise.
|
* sysdeps/alpha/dl-machine.h: Likewise.
|
||||||
|
* 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.
|
||||||
|
|
||||||
2004-03-04 Ulrich Drepper <drepper@redhat.com>
|
2004-03-04 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/* Return error detail for failing <dlfcn.h> functions.
|
/* Return error detail for failing <dlfcn.h> functions.
|
||||||
Copyright (C) 1995,1996,1997,1998,1999,2000,2002,2003
|
Copyright (C) 1995-2000,2002,2003,2004 Free Software Foundation, Inc.
|
||||||
Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -24,6 +23,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <bits/libc-lock.h>
|
#include <bits/libc-lock.h>
|
||||||
|
#include <ldsodefs.h>
|
||||||
|
|
||||||
/* Type for storing results of dynamic loading actions. */
|
/* Type for storing results of dynamic loading actions. */
|
||||||
struct dl_action_result
|
struct dl_action_result
|
||||||
@ -141,8 +141,8 @@ _dlerror_run (void (*operate) (void *), void *args)
|
|||||||
result->errstring = NULL;
|
result->errstring = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
result->errcode = _dl_catch_error (&result->objname, &result->errstring,
|
result->errcode = GLRO(dl_catch_error) (&result->objname, &result->errstring,
|
||||||
operate, args);
|
operate, args);
|
||||||
|
|
||||||
/* If no error we mark that no error string is available. */
|
/* If no error we mark that no error string is available. */
|
||||||
result->returned = result->errstring == NULL;
|
result->returned = result->errstring == NULL;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* dlinfo -- Get information from the dynamic linker.
|
/* dlinfo -- Get information from the dynamic linker.
|
||||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -48,7 +48,7 @@ dlinfo_doit (void *argsblock)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
if (l == NULL)
|
if (l == NULL)
|
||||||
_dl_signal_error (0, NULL, NULL, N_("\
|
GLRO(dl_signal_error) (0, NULL, NULL, N_("\
|
||||||
RTLD_SELF used in code not dynamically loaded"));
|
RTLD_SELF used in code not dynamically loaded"));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -58,7 +58,7 @@ RTLD_SELF used in code not dynamically loaded"));
|
|||||||
case RTLD_DI_LMID:
|
case RTLD_DI_LMID:
|
||||||
case RTLD_DI_CONFIGADDR:
|
case RTLD_DI_CONFIGADDR:
|
||||||
default:
|
default:
|
||||||
_dl_signal_error (0, NULL, NULL, N_("unsupported dlinfo request"));
|
GLRO(dl_signal_error) (0, NULL, NULL, N_("unsupported dlinfo request"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RTLD_DI_LINKMAP:
|
case RTLD_DI_LINKMAP:
|
||||||
|
14
elf/Versions
14
elf/Versions
@ -46,17 +46,13 @@ ld {
|
|||||||
GLIBC_PRIVATE {
|
GLIBC_PRIVATE {
|
||||||
# Those are in the dynamic linker, but used by libc.so.
|
# Those are in the dynamic linker, but used by libc.so.
|
||||||
__libc_enable_secure;
|
__libc_enable_secure;
|
||||||
_dl_argv; _dl_catch_error; _dl_check_map_versions;
|
_dl_argv;
|
||||||
_dl_debug_printf; _dl_debug_state; _dl_dst_count;
|
_dl_out_of_memory;
|
||||||
_dl_dst_substitute; _dl_init; _dl_lookup_symbol; _dl_lookup_symbol_skip;
|
_dl_starting_up;
|
||||||
_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;
|
|
||||||
_rtld_global; _rtld_global_ro;
|
_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_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;
|
_dl_make_stack_executable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ _dl_close (void *_map)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (__builtin_expect (map->l_opencount, 1) == 0)
|
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. */
|
/* Acquire the lock. */
|
||||||
__rtld_lock_lock_recursive (GL(dl_load_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. */
|
/* There are still references to this object. Do nothing more. */
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
||||||
_dl_debug_printf ("\nclosing file=%s; opencount == %u\n",
|
GLRO(dl_debug_printf) ("\nclosing file=%s; opencount == %u\n",
|
||||||
map->l_name, map->l_opencount);
|
map->l_name, map->l_opencount);
|
||||||
|
|
||||||
/* Decrement the object's reference counter, not the dependencies'. */
|
/* Decrement the object's reference counter, not the dependencies'. */
|
||||||
--map->l_opencount;
|
--map->l_opencount;
|
||||||
@ -225,7 +225,7 @@ _dl_close (void *_map)
|
|||||||
{
|
{
|
||||||
/* When debugging print a message first. */
|
/* When debugging print a message first. */
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
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
|
/* Call its termination function. Do not do it for
|
||||||
half-cooked objects. */
|
half-cooked objects. */
|
||||||
@ -318,7 +318,7 @@ _dl_close (void *_map)
|
|||||||
|
|
||||||
/* Notify the debugger we are about to remove some loaded objects. */
|
/* Notify the debugger we are about to remove some loaded objects. */
|
||||||
_r_debug.r_state = RT_DELETE;
|
_r_debug.r_state = RT_DELETE;
|
||||||
_dl_debug_state ();
|
GLRO(dl_debug_state) ();
|
||||||
|
|
||||||
#ifdef USE_TLS
|
#ifdef USE_TLS
|
||||||
size_t tls_free_start;
|
size_t tls_free_start;
|
||||||
@ -537,7 +537,7 @@ _dl_close (void *_map)
|
|||||||
|
|
||||||
/* Notify the debugger those objects are finalized and gone. */
|
/* Notify the debugger those objects are finalized and gone. */
|
||||||
_r_debug.r_state = RT_CONSISTENT;
|
_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
|
/* Now we can perhaps also remove the modules for which we had
|
||||||
dependencies because of symbol lookup. */
|
dependencies because of symbol lookup. */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Communicate dynamic linker state to the debugger at runtime.
|
/* 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.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
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_version = 1 /* R_DEBUG_VERSION XXX */;
|
||||||
_r_debug.r_ldbase = ldbase;
|
_r_debug.r_ldbase = ldbase;
|
||||||
_r_debug.r_map = GL(dl_loaded);
|
_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;
|
return &_r_debug;
|
||||||
@ -55,4 +55,3 @@ void
|
|||||||
_dl_debug_state (void)
|
_dl_debug_state (void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
INTDEF (_dl_debug_state)
|
|
||||||
|
@ -60,10 +60,10 @@ openaux (void *a)
|
|||||||
{
|
{
|
||||||
struct openaux_args *args = (struct openaux_args *) a;
|
struct openaux_args *args = (struct openaux_args *) a;
|
||||||
|
|
||||||
args->aux = INTUSE(_dl_map_object) (args->map, args->name, 0,
|
args->aux = _dl_map_object (args->map, args->name, 0,
|
||||||
(args->map->l_type == lt_executable
|
(args->map->l_type == lt_executable
|
||||||
? lt_library : args->map->l_type),
|
? lt_library : args->map->l_type),
|
||||||
args->trace_mode, args->open_mode);
|
args->trace_mode, args->open_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ptrdiff_t
|
static ptrdiff_t
|
||||||
@ -108,26 +108,26 @@ struct list
|
|||||||
\
|
\
|
||||||
/* DST must not appear in SUID/SGID programs. */ \
|
/* DST must not appear in SUID/SGID programs. */ \
|
||||||
if (INTUSE(__libc_enable_secure)) \
|
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")); \
|
DST not allowed in SUID/SGID programs")); \
|
||||||
\
|
\
|
||||||
__newp = (char *) alloca (DL_DST_REQUIRED (l, __str, strlen (__str), \
|
__newp = (char *) alloca (DL_DST_REQUIRED (l, __str, strlen (__str), \
|
||||||
__cnt)); \
|
__cnt)); \
|
||||||
\
|
\
|
||||||
__result = INTUSE(_dl_dst_substitute) (l, __str, __newp, 0); \
|
__result = _dl_dst_substitute (l, __str, __newp, 0); \
|
||||||
\
|
\
|
||||||
if (*__result == '\0') \
|
if (*__result == '\0') \
|
||||||
{ \
|
{ \
|
||||||
/* The replacement for the DST is not known. We can't \
|
/* The replacement for the DST is not known. We can't \
|
||||||
processed. */ \
|
processed. */ \
|
||||||
if (fatal) \
|
if (fatal) \
|
||||||
INTUSE(_dl_signal_error) (0, __str, NULL, N_("\
|
_dl_signal_error (0, __str, NULL, N_("\
|
||||||
empty dynamics string token substitution")); \
|
empty dynamics string token substitution")); \
|
||||||
else \
|
else \
|
||||||
{ \
|
{ \
|
||||||
/* This is for DT_AUXILIARY. */ \
|
/* This is for DT_AUXILIARY. */ \
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0))\
|
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 " \
|
cannot load auxiliary `%s' because of empty dynamic string token " \
|
||||||
"substitution\n"), __str); \
|
"substitution\n"), __str); \
|
||||||
continue; \
|
continue; \
|
||||||
@ -241,8 +241,7 @@ _dl_map_object_deps (struct link_map *map,
|
|||||||
/* Store the tag in the argument structure. */
|
/* Store the tag in the argument structure. */
|
||||||
args.name = name;
|
args.name = name;
|
||||||
|
|
||||||
err = INTUSE(_dl_catch_error) (&objname, &errstring, openaux,
|
err = _dl_catch_error (&objname, &errstring, openaux, &args);
|
||||||
&args);
|
|
||||||
if (__builtin_expect (errstring != NULL, 0))
|
if (__builtin_expect (errstring != NULL, 0))
|
||||||
{
|
{
|
||||||
if (err)
|
if (err)
|
||||||
@ -293,16 +292,16 @@ _dl_map_object_deps (struct link_map *map,
|
|||||||
/* Say that we are about to load an auxiliary library. */
|
/* Say that we are about to load an auxiliary library. */
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS,
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS,
|
||||||
0))
|
0))
|
||||||
INTUSE(_dl_debug_printf) ("load auxiliary object=%s"
|
_dl_debug_printf ("load auxiliary object=%s"
|
||||||
" requested by file=%s\n",
|
" requested by file=%s\n",
|
||||||
name,
|
name,
|
||||||
l->l_name[0]
|
l->l_name[0]
|
||||||
? l->l_name : rtld_progname);
|
? l->l_name : rtld_progname);
|
||||||
|
|
||||||
/* We must be prepared that the addressed shared
|
/* We must be prepared that the addressed shared
|
||||||
object is not available. */
|
object is not available. */
|
||||||
err = INTUSE(_dl_catch_error) (&objname, &errstring,
|
err = _dl_catch_error (&objname, &errstring, openaux,
|
||||||
openaux, &args);
|
&args);
|
||||||
if (__builtin_expect (errstring != NULL, 0))
|
if (__builtin_expect (errstring != NULL, 0))
|
||||||
{
|
{
|
||||||
/* We are not interested in the error message. */
|
/* 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. */
|
/* Say that we are about to load an auxiliary library. */
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS,
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS,
|
||||||
0))
|
0))
|
||||||
INTUSE(_dl_debug_printf) ("load filtered object=%s"
|
_dl_debug_printf ("load filtered object=%s"
|
||||||
" requested by file=%s\n",
|
" requested by file=%s\n",
|
||||||
name,
|
name,
|
||||||
l->l_name[0]
|
l->l_name[0]
|
||||||
? l->l_name : rtld_progname);
|
? l->l_name : rtld_progname);
|
||||||
|
|
||||||
/* For filter objects the dependency must be available. */
|
/* For filter objects the dependency must be available. */
|
||||||
err = INTUSE(_dl_catch_error) (&objname, &errstring,
|
err = _dl_catch_error (&objname, &errstring, openaux,
|
||||||
openaux, &args);
|
&args);
|
||||||
if (__builtin_expect (errstring != NULL, 0))
|
if (__builtin_expect (errstring != NULL, 0))
|
||||||
{
|
{
|
||||||
if (err)
|
if (err)
|
||||||
@ -457,8 +456,8 @@ _dl_map_object_deps (struct link_map *map,
|
|||||||
l->l_initfini = (struct link_map **)
|
l->l_initfini = (struct link_map **)
|
||||||
malloc ((2 * nneeded + 1) * sizeof needed[0]);
|
malloc ((2 * nneeded + 1) * sizeof needed[0]);
|
||||||
if (l->l_initfini == NULL)
|
if (l->l_initfini == NULL)
|
||||||
INTUSE(_dl_signal_error) (ENOMEM, map->l_name, NULL,
|
_dl_signal_error (ENOMEM, map->l_name, NULL,
|
||||||
N_("cannot allocate dependency list"));
|
N_("cannot allocate dependency list"));
|
||||||
l->l_initfini[0] = l;
|
l->l_initfini[0] = l;
|
||||||
memcpy (&l->l_initfini[1], needed, nneeded * sizeof needed[0]);
|
memcpy (&l->l_initfini[1], needed, nneeded * sizeof needed[0]);
|
||||||
memcpy (&l->l_initfini[nneeded + 1], l->l_initfini,
|
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)
|
(struct link_map **) malloc ((2 * nlist + 1)
|
||||||
* sizeof (struct link_map *));
|
* sizeof (struct link_map *));
|
||||||
if (map->l_initfini == NULL)
|
if (map->l_initfini == NULL)
|
||||||
INTUSE(_dl_signal_error) (ENOMEM, map->l_name, NULL,
|
_dl_signal_error (ENOMEM, map->l_name, NULL,
|
||||||
N_("cannot allocate symbol search list"));
|
N_("cannot allocate symbol search list"));
|
||||||
|
|
||||||
|
|
||||||
map->l_searchlist.r_list = &map->l_initfini[nlist + 1];
|
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
|
/* As current DT_AUXILIARY/DT_FILTER implementation needs to be
|
||||||
rewritten, no need to bother with prelinking the old
|
rewritten, no need to bother with prelinking the old
|
||||||
implementation. */
|
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"));
|
Filters not supported with LD_TRACE_PRELINKING"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -545,8 +544,8 @@ Filters not supported with LD_TRACE_PRELINKING"));
|
|||||||
+ (cnt
|
+ (cnt
|
||||||
* sizeof (struct link_map *)));
|
* sizeof (struct link_map *)));
|
||||||
if (l->l_local_scope[0] == NULL)
|
if (l->l_local_scope[0] == NULL)
|
||||||
INTUSE(_dl_signal_error) (ENOMEM, map->l_name, NULL,
|
_dl_signal_error (ENOMEM, map->l_name, NULL,
|
||||||
N_("cannot allocate symbol search list"));
|
N_("cannot allocate symbol search list"));
|
||||||
l->l_local_scope[0]->r_nlist = cnt;
|
l->l_local_scope[0]->r_nlist = cnt;
|
||||||
l->l_local_scope[0]->r_list =
|
l->l_local_scope[0]->r_list =
|
||||||
(struct link_map **) (l->l_local_scope[0] + 1);
|
(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;
|
map->l_initfini[nlist] = NULL;
|
||||||
|
|
||||||
if (errno_reason)
|
if (errno_reason)
|
||||||
INTUSE(_dl_signal_error) (errno_reason == -1 ? 0 : errno_reason, objname,
|
_dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname,
|
||||||
NULL, errstring);
|
NULL, errstring);
|
||||||
}
|
}
|
||||||
INTDEF (_dl_map_object_deps)
|
|
||||||
|
24
elf/dl-dst.h
24
elf/dl-dst.h
@ -25,13 +25,12 @@
|
|||||||
const char *__sf = strchr (name, '$'); \
|
const char *__sf = strchr (name, '$'); \
|
||||||
\
|
\
|
||||||
if (__builtin_expect (__sf != NULL, 0)) \
|
if (__builtin_expect (__sf != NULL, 0)) \
|
||||||
__cnt = INTUSE(_dl_dst_count) (__sf, is_path); \
|
__cnt = _dl_dst_count (__sf, is_path); \
|
||||||
\
|
\
|
||||||
__cnt; })
|
__cnt; })
|
||||||
|
#ifndef IS_IN_rtld
|
||||||
/* Prototype for used function. */
|
# define _dl_dst_count GLRO(dl_dst_count)
|
||||||
extern size_t _dl_dst_count (const char *name, int is_path);
|
#endif
|
||||||
extern size_t _dl_dst_count_internal (const char *name, int is_path);
|
|
||||||
|
|
||||||
|
|
||||||
/* Guess from the number of DSTs the length of the result string. */
|
/* 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; })
|
__len; })
|
||||||
|
|
||||||
/* Find origin of the executable. */
|
#ifndef IS_IN_rtld
|
||||||
extern const char *_dl_get_origin (void);
|
# define _dl_get_origin GLRO(dl_get_origin)
|
||||||
extern const char *_dl_get_origin_internal (void);
|
# define _dl_dst_substitute GLRO(dl_dst_substitute)
|
||||||
|
|
||||||
#ifdef IS_IN_rtld
|
|
||||||
# define _dl_get_origin INTUSE(_dl_get_origin)
|
|
||||||
#endif
|
#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);
|
|
||||||
|
@ -113,7 +113,6 @@ _dl_signal_error (int errcode, const char *objname, const char *occation,
|
|||||||
: ""));
|
: ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
INTDEF (_dl_signal_error)
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -123,8 +122,8 @@ _dl_signal_cerror (int errcode, const char *objname, const char *occation,
|
|||||||
{
|
{
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask)
|
if (__builtin_expect (GLRO(dl_debug_mask)
|
||||||
& ~(DL_DEBUG_STATISTICS|DL_DEBUG_PRELINK), 0))
|
& ~(DL_DEBUG_STATISTICS|DL_DEBUG_PRELINK), 0))
|
||||||
INTUSE(_dl_debug_printf) ("%s: error: %s: %s (%s)\n", objname, occation,
|
_dl_debug_printf ("%s: error: %s: %s (%s)\n", objname, occation,
|
||||||
errstring, receiver ? "continued" : "fatal");
|
errstring, receiver ? "continued" : "fatal");
|
||||||
|
|
||||||
if (receiver)
|
if (receiver)
|
||||||
{
|
{
|
||||||
@ -134,7 +133,7 @@ _dl_signal_cerror (int errcode, const char *objname, const char *occation,
|
|||||||
(*receiver) (errcode, objname, errstring);
|
(*receiver) (errcode, objname, errstring);
|
||||||
}
|
}
|
||||||
else
|
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;
|
*errstring = c.errstring;
|
||||||
return errcode == -1 ? 0 : errcode;
|
return errcode == -1 ? 0 : errcode;
|
||||||
}
|
}
|
||||||
INTDEF (_dl_catch_error)
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -147,9 +147,8 @@ _dl_fini (void)
|
|||||||
|
|
||||||
/* When debugging print a message first. */
|
/* When debugging print a message first. */
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
||||||
INTUSE(_dl_debug_printf) ("\ncalling fini: %s\n\n",
|
_dl_debug_printf ("\ncalling fini: %s\n\n",
|
||||||
l->l_name[0]
|
l->l_name[0] ? l->l_name : rtld_progname);
|
||||||
? l->l_name : rtld_progname);
|
|
||||||
|
|
||||||
/* First see whether an array is given. */
|
/* First see whether an array is given. */
|
||||||
if (l->l_info[DT_FINI_ARRAY] != NULL)
|
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))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_STATISTICS, 0))
|
||||||
{
|
{
|
||||||
INTUSE(_dl_debug_printf) ("\nruntime linker statistics:\n");
|
_dl_debug_printf ("\nruntime linker statistics:\n");
|
||||||
INTUSE(_dl_debug_printf) ("\
|
_dl_debug_printf ("\
|
||||||
final number of relocations: %lu\n",
|
final number of relocations: %lu\n",
|
||||||
GL(dl_num_relocations));
|
GL(dl_num_relocations));
|
||||||
INTUSE(_dl_debug_printf) ("\
|
_dl_debug_printf ("\
|
||||||
final number of relocations from cache: %lu\n",
|
final number of relocations from cache: %lu\n",
|
||||||
GL(dl_num_cache_relocations));
|
GL(dl_num_cache_relocations));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,8 +52,8 @@ call_init (struct link_map *l, int argc, char **argv, char **env)
|
|||||||
|
|
||||||
/* Print a debug message if wanted. */
|
/* Print a debug message if wanted. */
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
||||||
INTUSE(_dl_debug_printf) ("\ncalling init: %s\n\n",
|
_dl_debug_printf ("\ncalling init: %s\n\n",
|
||||||
l->l_name[0] ? l->l_name : rtld_progname);
|
l->l_name[0] ? l->l_name : rtld_progname);
|
||||||
|
|
||||||
/* Now run the local constructors. There are two forms of them:
|
/* Now run the local constructors. There are two forms of them:
|
||||||
- the one named by DT_INIT
|
- 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;
|
unsigned int cnt;
|
||||||
|
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
||||||
INTUSE(_dl_debug_printf) ("\ncalling preinit: %s\n\n",
|
_dl_debug_printf ("\ncalling preinit: %s\n\n",
|
||||||
main_map->l_name[0]
|
main_map->l_name[0]
|
||||||
? main_map->l_name : rtld_progname);
|
? main_map->l_name : rtld_progname);
|
||||||
|
|
||||||
addrs = (ElfW(Addr) *) (preinit_array->d_un.d_ptr + main_map->l_addr);
|
addrs = (ElfW(Addr) *) (preinit_array->d_un.d_ptr + main_map->l_addr);
|
||||||
for (cnt = 0; cnt < i; ++cnt)
|
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. */
|
not been used before. */
|
||||||
r = _dl_debug_initialize (0);
|
r = _dl_debug_initialize (0);
|
||||||
r->r_state = RT_ADD;
|
r->r_state = RT_ADD;
|
||||||
INTUSE(_dl_debug_state) ();
|
_dl_debug_state ();
|
||||||
|
|
||||||
/* Stupid users forced the ELF specification to be changed. It now
|
/* Stupid users forced the ELF specification to be changed. It now
|
||||||
says that the dynamic loader is responsible for determining the
|
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. */
|
/* Notify the debugger all new objects are now ready to go. */
|
||||||
r->r_state = RT_CONSISTENT;
|
r->r_state = RT_CONSISTENT;
|
||||||
INTUSE(_dl_debug_state) ();
|
_dl_debug_state ();
|
||||||
|
|
||||||
/* Finished starting up. */
|
/* Finished starting up. */
|
||||||
INTUSE(_dl_starting_up) = 0;
|
INTUSE(_dl_starting_up) = 0;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Handle loading and unloading shared objects for internal libc purposes.
|
/* 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.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Zack Weinberg <zack@rabi.columbia.edu>, 1999.
|
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;
|
const char *last_errstring = NULL;
|
||||||
int result;
|
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;
|
result = last_errstring != NULL;
|
||||||
if (result && last_errstring != _dl_out_of_memory)
|
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;
|
struct do_dlsym_args *args = (struct do_dlsym_args *) ptr;
|
||||||
args->ref = NULL;
|
args->ref = NULL;
|
||||||
args->loadbase = _dl_lookup_symbol (args->name, args->map, &args->ref,
|
args->loadbase = GLRO(dl_lookup_symbol) (args->name, args->map, &args->ref,
|
||||||
args->map->l_local_scope, 0,
|
args->map->l_local_scope, 0,
|
||||||
DL_LOOKUP_RETURN_NEWEST);
|
DL_LOOKUP_RETURN_NEWEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -126,9 +126,9 @@ do_dlsym_private (void *ptr)
|
|||||||
|
|
||||||
struct do_dlsym_args *args = (struct do_dlsym_args *) ptr;
|
struct do_dlsym_args *args = (struct do_dlsym_args *) ptr;
|
||||||
args->ref = NULL;
|
args->ref = NULL;
|
||||||
l = _dl_lookup_versioned_symbol (args->name, args->map,
|
l = GLRO(dl_lookup_versioned_symbol) (args->name, args->map,
|
||||||
&args->ref, args->map->l_scope,
|
&args->ref, args->map->l_scope,
|
||||||
&vers, 0, 0);
|
&vers, 0, 0);
|
||||||
args->loadbase = l;
|
args->loadbase = l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,7 +220,6 @@ _dl_dst_count (const char *name, int is_path)
|
|||||||
|
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
INTDEF (_dl_dst_count)
|
|
||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
@ -283,7 +282,6 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
INTDEF (_dl_dst_substitute)
|
|
||||||
|
|
||||||
|
|
||||||
/* Return copy of argument with all recognized dynamic string tokens
|
/* Return copy of argument with all recognized dynamic string tokens
|
||||||
@ -317,7 +315,7 @@ expand_dynamic_string_token (struct link_map *l, const char *s)
|
|||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return INTUSE(_dl_dst_substitute) (l, s, result, 1);
|
return _dl_dst_substitute (l, s, result, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -343,8 +341,7 @@ add_name_to_object (struct link_map *l, const char *name)
|
|||||||
if (newname == NULL)
|
if (newname == NULL)
|
||||||
{
|
{
|
||||||
/* No more memory. */
|
/* No more memory. */
|
||||||
INTUSE(_dl_signal_error) (ENOMEM, name, NULL,
|
_dl_signal_error (ENOMEM, name, NULL, N_("cannot allocate name record"));
|
||||||
N_("cannot allocate name record"));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* The object should have a libname set from _dl_new_object. */
|
/* The object should have a libname set from _dl_new_object. */
|
||||||
@ -445,8 +442,8 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep,
|
|||||||
malloc (sizeof (*dirp) + ncapstr * sizeof (enum r_dir_status)
|
malloc (sizeof (*dirp) + ncapstr * sizeof (enum r_dir_status)
|
||||||
+ where_len + len + 1);
|
+ where_len + len + 1);
|
||||||
if (dirp == NULL)
|
if (dirp == NULL)
|
||||||
INTUSE(_dl_signal_error) (ENOMEM, NULL, NULL,
|
_dl_signal_error (ENOMEM, NULL, NULL,
|
||||||
N_("cannot create cache for search path"));
|
N_("cannot create cache for search path"));
|
||||||
|
|
||||||
dirp->dirname = ((char *) dirp + sizeof (*dirp)
|
dirp->dirname = ((char *) dirp + sizeof (*dirp)
|
||||||
+ ncapstr * sizeof (enum r_dir_status));
|
+ ncapstr * sizeof (enum r_dir_status));
|
||||||
@ -527,7 +524,7 @@ decompose_rpath (struct r_search_path_struct *sps,
|
|||||||
signal_error_cache:
|
signal_error_cache:
|
||||||
errstring = N_("cannot create cache for search path");
|
errstring = N_("cannot create cache for search path");
|
||||||
signal_error:
|
signal_error:
|
||||||
INTUSE(_dl_signal_error) (ENOMEM, NULL, NULL, errstring);
|
_dl_signal_error (ENOMEM, NULL, NULL, errstring);
|
||||||
}
|
}
|
||||||
|
|
||||||
sps->dirs = result;
|
sps->dirs = result;
|
||||||
@ -633,7 +630,7 @@ _dl_init_paths (const char *llp)
|
|||||||
{
|
{
|
||||||
errstring = N_("cannot create search path array");
|
errstring = N_("cannot create search path array");
|
||||||
signal_error:
|
signal_error:
|
||||||
INTUSE(_dl_signal_error) (ENOMEM, NULL, NULL, errstring);
|
_dl_signal_error (ENOMEM, NULL, NULL, errstring);
|
||||||
}
|
}
|
||||||
|
|
||||||
round_size = ((2 * sizeof (struct r_search_path_elem) - 1
|
round_size = ((2 * sizeof (struct r_search_path_elem) - 1
|
||||||
@ -786,7 +783,7 @@ lose (int code, int fd, const char *name, char *realname, struct link_map *l,
|
|||||||
free (l);
|
free (l);
|
||||||
}
|
}
|
||||||
free (realname);
|
free (realname);
|
||||||
INTUSE(_dl_signal_error) (code, name, NULL, msg);
|
_dl_signal_error (code, name, NULL, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -845,7 +842,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
|
|||||||
|
|
||||||
/* Print debugging message. */
|
/* Print debugging message. */
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
||||||
INTUSE(_dl_debug_printf) ("file=%s; generating link map\n", name);
|
_dl_debug_printf ("file=%s; generating link map\n", name);
|
||||||
|
|
||||||
/* This is the ELF header. We read it in `open_verify'. */
|
/* This is the ELF header. We read it in `open_verify'. */
|
||||||
header = (void *) fbp->buf;
|
header = (void *) fbp->buf;
|
||||||
@ -858,8 +855,8 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
|
|||||||
if (_dl_zerofd == -1)
|
if (_dl_zerofd == -1)
|
||||||
{
|
{
|
||||||
__close (fd);
|
__close (fd);
|
||||||
INTUSE(_dl_signal_error) (errno, NULL, NULL,
|
_dl_signal_error (errno, NULL, NULL,
|
||||||
N_("cannot open zero fill device"));
|
N_("cannot open zero fill device"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1260,7 +1257,7 @@ cannot allocate TLS data structures for initial thread");
|
|||||||
l->l_entry += l->l_addr;
|
l->l_entry += l->l_addr;
|
||||||
|
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
||||||
INTUSE(_dl_debug_printf) ("\
|
_dl_debug_printf ("\
|
||||||
dynamic: 0x%0*lx base: 0x%0*lx size: 0x%0*Zx\n\
|
dynamic: 0x%0*lx base: 0x%0*lx size: 0x%0*Zx\n\
|
||||||
entry: 0x%0*lx phdr: 0x%0*lx phnum: %*u\n\n",
|
entry: 0x%0*lx phdr: 0x%0*lx phnum: %*u\n\n",
|
||||||
(int) sizeof (void *) * 2,
|
(int) sizeof (void *) * 2,
|
||||||
@ -1367,7 +1364,7 @@ print_search_path (struct r_search_path_elem **list,
|
|||||||
char buf[max_dirnamelen + max_capstrlen];
|
char buf[max_dirnamelen + max_capstrlen];
|
||||||
int first = 1;
|
int first = 1;
|
||||||
|
|
||||||
INTUSE(_dl_debug_printf) (" search path=");
|
_dl_debug_printf (" search path=");
|
||||||
|
|
||||||
while (*list != NULL && (*list)->what == what) /* Yes, ==. */
|
while (*list != NULL && (*list)->what == what) /* Yes, ==. */
|
||||||
{
|
{
|
||||||
@ -1638,7 +1635,7 @@ open_path (const char *name, size_t namelen, int preloaded,
|
|||||||
|
|
||||||
/* Print name we try if this is wanted. */
|
/* Print name we try if this is wanted. */
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0))
|
||||||
INTUSE(_dl_debug_printf) (" trying file=%s\n", buf);
|
_dl_debug_printf (" trying file=%s\n", buf);
|
||||||
|
|
||||||
fd = open_verify (buf, fbp);
|
fd = open_verify (buf, fbp);
|
||||||
if (this_dir->status[cnt] == unknown)
|
if (this_dir->status[cnt] == unknown)
|
||||||
@ -1772,7 +1769,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
|
|||||||
/* Display information if we are debugging. */
|
/* Display information if we are debugging. */
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0)
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0)
|
||||||
&& loader != NULL)
|
&& loader != NULL)
|
||||||
INTUSE(_dl_debug_printf) ("\nfile=%s; needed by %s\n", name,
|
_dl_debug_printf ("\nfile=%s; needed by %s\n", name,
|
||||||
loader->l_name[0]
|
loader->l_name[0]
|
||||||
? loader->l_name : rtld_progname);
|
? loader->l_name : rtld_progname);
|
||||||
|
|
||||||
@ -1783,7 +1780,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
|
|||||||
size_t namelen = strlen (name) + 1;
|
size_t namelen = strlen (name) + 1;
|
||||||
|
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0))
|
||||||
INTUSE(_dl_debug_printf) ("find library=%s; searching\n", name);
|
_dl_debug_printf ("find library=%s; searching\n", name);
|
||||||
|
|
||||||
fd = -1;
|
fd = -1;
|
||||||
|
|
||||||
@ -1888,7 +1885,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
|
|||||||
|
|
||||||
/* Add another newline when we are tracing the library loading. */
|
/* Add another newline when we are tracing the library loading. */
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0))
|
||||||
INTUSE(_dl_debug_printf) ("\n");
|
_dl_debug_printf ("\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1920,8 +1917,8 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
|
|||||||
/* Enter the new object in the list of loaded objects. */
|
/* Enter the new object in the list of loaded objects. */
|
||||||
if ((name_copy = local_strdup (name)) == NULL
|
if ((name_copy = local_strdup (name)) == NULL
|
||||||
|| (l = _dl_new_object (name_copy, name, type, loader)) == NULL)
|
|| (l = _dl_new_object (name_copy, name, type, loader)) == NULL)
|
||||||
INTUSE(_dl_signal_error) (ENOMEM, name, NULL, N_("\
|
_dl_signal_error (ENOMEM, name, NULL,
|
||||||
cannot create shared object descriptor"));
|
N_("cannot create shared object descriptor"));
|
||||||
/* Signal that this is a faked entry. */
|
/* Signal that this is a faked entry. */
|
||||||
l->l_faked = 1;
|
l->l_faked = 1;
|
||||||
/* Since the descriptor is initialized with zero we do not
|
/* Since the descriptor is initialized with zero we do not
|
||||||
@ -1934,15 +1931,15 @@ cannot create shared object descriptor"));
|
|||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
INTUSE(_dl_signal_error) (errno, name, NULL,
|
_dl_signal_error (errno, name, NULL,
|
||||||
N_("cannot open shared object file"));
|
N_("cannot open shared object file"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void *stack_end = __libc_stack_end;
|
void *stack_end = __libc_stack_end;
|
||||||
return _dl_map_object_from_fd (name, fd, &fb, realname, loader, type, mode,
|
return _dl_map_object_from_fd (name, fd, &fb, realname, loader, type, mode,
|
||||||
&stack_end);
|
&stack_end);
|
||||||
}
|
}
|
||||||
INTDEF (_dl_map_object)
|
|
||||||
|
|
||||||
void
|
void
|
||||||
internal_function
|
internal_function
|
||||||
|
@ -191,11 +191,11 @@ add_dependency (struct link_map *undef_map, struct link_map *map)
|
|||||||
|
|
||||||
/* Display information if we are debugging. */
|
/* Display information if we are debugging. */
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
||||||
INTUSE(_dl_debug_printf) ("\
|
_dl_debug_printf ("\
|
||||||
\nfile=%s; needed by %s (relocation dependency)\n\n",
|
\nfile=%s; needed by %s (relocation dependency)\n\n",
|
||||||
map->l_name[0] ? map->l_name : rtld_progname,
|
map->l_name[0] ? map->l_name : rtld_progname,
|
||||||
undef_map->l_name[0]
|
undef_map->l_name[0]
|
||||||
? undef_map->l_name : rtld_progname);
|
? undef_map->l_name : rtld_progname);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
/* Whoa, that was bad luck. We have to search again. */
|
/* Whoa, that was bad luck. We have to search again. */
|
||||||
@ -312,8 +312,8 @@ _dl_lookup_symbol (const char *undef_name, struct link_map *undef_map,
|
|||||||
&& add_dependency (undef_map, current_value.m) < 0)
|
&& add_dependency (undef_map, current_value.m) < 0)
|
||||||
/* Something went wrong. Perhaps the object we tried to reference
|
/* Something went wrong. Perhaps the object we tried to reference
|
||||||
was just removed. Try finding another definition. */
|
was just removed. Try finding another definition. */
|
||||||
return INTUSE(_dl_lookup_symbol) (undef_name, undef_map, ref,
|
return _dl_lookup_symbol (undef_name, undef_map, ref, symbol_scope,
|
||||||
symbol_scope, type_class, flags);
|
type_class, flags);
|
||||||
|
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask)
|
if (__builtin_expect (GLRO(dl_debug_mask)
|
||||||
& (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0))
|
& (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0))
|
||||||
@ -323,7 +323,6 @@ _dl_lookup_symbol (const char *undef_name, struct link_map *undef_map,
|
|||||||
*ref = current_value.s;
|
*ref = current_value.s;
|
||||||
return LOOKUP_VALUE (current_value.m);
|
return LOOKUP_VALUE (current_value.m);
|
||||||
}
|
}
|
||||||
INTDEF (_dl_lookup_symbol)
|
|
||||||
|
|
||||||
|
|
||||||
/* This function is nearly the same as `_dl_lookup_symbol' but it
|
/* This function is nearly the same as `_dl_lookup_symbol' but it
|
||||||
@ -400,8 +399,7 @@ _dl_lookup_symbol_skip (const char *undef_name,
|
|||||||
|
|
||||||
|
|
||||||
/* This function works like _dl_lookup_symbol but it takes an
|
/* This function works like _dl_lookup_symbol but it takes an
|
||||||
additional arguement with the version number of the requested
|
additional argument with the version number of the requested symbol.
|
||||||
symbol.
|
|
||||||
|
|
||||||
XXX We'll see whether we need this separate function. */
|
XXX We'll see whether we need this separate function. */
|
||||||
lookup_t
|
lookup_t
|
||||||
@ -518,9 +516,9 @@ _dl_lookup_versioned_symbol (const char *undef_name,
|
|||||||
&& add_dependency (undef_map, current_value.m) < 0)
|
&& add_dependency (undef_map, current_value.m) < 0)
|
||||||
/* Something went wrong. Perhaps the object we tried to reference
|
/* Something went wrong. Perhaps the object we tried to reference
|
||||||
was just removed. Try finding another definition. */
|
was just removed. Try finding another definition. */
|
||||||
return INTUSE(_dl_lookup_versioned_symbol) (undef_name, undef_map,
|
return _dl_lookup_versioned_symbol (undef_name, undef_map, ref,
|
||||||
ref, symbol_scope,
|
symbol_scope, version, type_class,
|
||||||
version, type_class, flags);
|
flags);
|
||||||
|
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask)
|
if (__builtin_expect (GLRO(dl_debug_mask)
|
||||||
& (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0))
|
& (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0))
|
||||||
@ -530,7 +528,6 @@ _dl_lookup_versioned_symbol (const char *undef_name,
|
|||||||
*ref = current_value.s;
|
*ref = current_value.s;
|
||||||
return LOOKUP_VALUE (current_value.m);
|
return LOOKUP_VALUE (current_value.m);
|
||||||
}
|
}
|
||||||
INTDEF (_dl_lookup_versioned_symbol)
|
|
||||||
|
|
||||||
|
|
||||||
/* Similar to _dl_lookup_symbol_skip but takes an additional argument
|
/* Similar to _dl_lookup_symbol_skip but takes an additional argument
|
||||||
@ -652,14 +649,12 @@ _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
|
|||||||
|
|
||||||
if (GLRO(dl_debug_mask) & DL_DEBUG_BINDINGS)
|
if (GLRO(dl_debug_mask) & DL_DEBUG_BINDINGS)
|
||||||
{
|
{
|
||||||
INTUSE(_dl_debug_printf) ("binding file %s to %s: %s symbol `%s'",
|
_dl_debug_printf ("binding file %s to %s: %s symbol `%s'",
|
||||||
(reference_name[0]
|
(reference_name[0]
|
||||||
? reference_name
|
? reference_name
|
||||||
: (rtld_progname ?: "<main program>")),
|
: (rtld_progname ?: "<main program>")),
|
||||||
value->m->l_name[0]
|
value->m->l_name[0] ? value->m->l_name : rtld_progname,
|
||||||
? value->m->l_name : rtld_progname,
|
protected ? "protected" : "normal", undef_name);
|
||||||
protected ? "protected" : "normal",
|
|
||||||
undef_name);
|
|
||||||
if (version)
|
if (version)
|
||||||
_dl_debug_printf_c (" [%s]\n", version->name);
|
_dl_debug_printf_c (" [%s]\n", version->name);
|
||||||
else
|
else
|
||||||
|
@ -279,7 +279,6 @@ _dl_debug_printf (const char *fmt, ...)
|
|||||||
_dl_debug_vdprintf (GLRO(dl_debug_fd), 1, fmt, arg);
|
_dl_debug_vdprintf (GLRO(dl_debug_fd), 1, fmt, arg);
|
||||||
va_end (arg);
|
va_end (arg);
|
||||||
}
|
}
|
||||||
INTDEF(_dl_debug_printf)
|
|
||||||
|
|
||||||
|
|
||||||
/* Write to debug file but don't start with a tag. */
|
/* Write to debug file but don't start with a tag. */
|
||||||
|
@ -111,8 +111,8 @@ add_to_global (struct link_map *new)
|
|||||||
{
|
{
|
||||||
GL(dl_global_scope_alloc) = 0;
|
GL(dl_global_scope_alloc) = 0;
|
||||||
nomem:
|
nomem:
|
||||||
_dl_signal_error (ENOMEM, new->l_libname->name, NULL,
|
GLRO(dl_signal_error) (ENOMEM, new->l_libname->name, NULL,
|
||||||
N_("cannot extend global scope"));
|
N_("cannot extend global scope"));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ dl_open_worker (void *a)
|
|||||||
#ifdef SHARED
|
#ifdef SHARED
|
||||||
/* Check whether _dl_open() has been called from a valid DSO. */
|
/* Check whether _dl_open() has been called from a valid DSO. */
|
||||||
if (check_libc_caller (args->caller_dl_open) != 0)
|
if (check_libc_caller (args->caller_dl_open) != 0)
|
||||||
_dl_signal_error (0, "dlopen", NULL, N_("invalid caller"));
|
GLRO(dl_signal_error) (0, "dlopen", NULL, N_("invalid caller"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Maybe we have to expand a DST. */
|
/* Maybe we have to expand a DST. */
|
||||||
@ -251,8 +251,8 @@ dl_open_worker (void *a)
|
|||||||
/* DSTs must not appear in SUID/SGID programs. */
|
/* DSTs must not appear in SUID/SGID programs. */
|
||||||
if (__libc_enable_secure)
|
if (__libc_enable_secure)
|
||||||
/* This is an error. */
|
/* This is an error. */
|
||||||
_dl_signal_error (0, "dlopen", NULL,
|
GLRO(dl_signal_error) (0, "dlopen", NULL,
|
||||||
N_("DST not allowed in SUID/SGID programs"));
|
N_("DST not allowed in SUID/SGID programs"));
|
||||||
|
|
||||||
/* We have to find out from which object the caller is calling. */
|
/* We have to find out from which object the caller is calling. */
|
||||||
call_map = NULL;
|
call_map = NULL;
|
||||||
@ -282,15 +282,15 @@ dl_open_worker (void *a)
|
|||||||
|
|
||||||
/* If the substitution failed don't try to load. */
|
/* If the substitution failed don't try to load. */
|
||||||
if (*new_file == '\0')
|
if (*new_file == '\0')
|
||||||
_dl_signal_error (0, "dlopen", NULL,
|
GLRO(dl_signal_error) (0, "dlopen", NULL,
|
||||||
N_("empty dynamic string token substitution"));
|
N_("empty dynamic string token substitution"));
|
||||||
|
|
||||||
/* Now we have a new file name. */
|
/* Now we have a new file name. */
|
||||||
file = new_file;
|
file = new_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Load the named object. */
|
/* Load the named object. */
|
||||||
args->map = new = _dl_map_object (NULL, file, 0, lt_loaded, 0, mode);
|
args->map = new = GLRO(dl_map_object) (NULL, file, 0, lt_loaded, 0, mode);
|
||||||
|
|
||||||
/* If the pointer returned is NULL this means the RTLD_NOLOAD flag is
|
/* If the pointer returned is NULL this means the RTLD_NOLOAD flag is
|
||||||
set and the object is not already loaded. */
|
set and the object is not already loaded. */
|
||||||
@ -309,8 +309,8 @@ dl_open_worker (void *a)
|
|||||||
{
|
{
|
||||||
/* Let the user know about the opencount. */
|
/* Let the user know about the opencount. */
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
||||||
_dl_debug_printf ("opening file=%s; opencount == %u\n\n",
|
GLRO(dl_debug_printf) ("opening file=%s; opencount == %u\n\n",
|
||||||
new->l_name, new->l_opencount);
|
new->l_name, new->l_opencount);
|
||||||
|
|
||||||
/* If the user requested the object to be in the global namespace
|
/* If the user requested the object to be in the global namespace
|
||||||
but it is not so far, add it now. */
|
but it is not so far, add it now. */
|
||||||
@ -324,12 +324,12 @@ dl_open_worker (void *a)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Load that object's dependencies. */
|
/* Load that object's dependencies. */
|
||||||
_dl_map_object_deps (new, NULL, 0, 0, mode & __RTLD_DLOPEN);
|
GLRO(dl_map_object_deps) (new, NULL, 0, 0, mode & __RTLD_DLOPEN);
|
||||||
|
|
||||||
/* So far, so good. Now check the versions. */
|
/* So far, so good. Now check the versions. */
|
||||||
for (i = 0; i < new->l_searchlist.r_nlist; ++i)
|
for (i = 0; i < new->l_searchlist.r_nlist; ++i)
|
||||||
if (new->l_searchlist.r_list[i]->l_versions == NULL)
|
if (new->l_searchlist.r_list[i]->l_versions == NULL)
|
||||||
(void) _dl_check_map_versions (new->l_searchlist.r_list[i], 0, 0);
|
(void) GLRO(dl_check_map_versions) (new->l_searchlist.r_list[i], 0, 0);
|
||||||
|
|
||||||
#ifdef SCOPE_DEBUG
|
#ifdef SCOPE_DEBUG
|
||||||
show_scope (new);
|
show_scope (new);
|
||||||
@ -358,16 +358,16 @@ dl_open_worker (void *a)
|
|||||||
start the profiling. */
|
start the profiling. */
|
||||||
struct link_map *old_profile_map = GL(dl_profile_map);
|
struct link_map *old_profile_map = GL(dl_profile_map);
|
||||||
|
|
||||||
_dl_relocate_object (l, l->l_scope, 1, 1);
|
GLRO(dl_relocate_object) (l, l->l_scope, 1, 1);
|
||||||
|
|
||||||
if (old_profile_map == NULL && GL(dl_profile_map) != NULL)
|
if (old_profile_map == NULL && GL(dl_profile_map) != NULL)
|
||||||
/* We must prepare the profiling. */
|
/* We must prepare the profiling. */
|
||||||
_dl_start_profile (GL(dl_profile_map),
|
GLRO(dl_start_profile) (GL(dl_profile_map),
|
||||||
GLRO(dl_profile_output));
|
GLRO(dl_profile_output));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
_dl_relocate_object (l, l->l_scope, lazy, 0);
|
GLRO(dl_relocate_object) (l, l->l_scope, lazy, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (l == new)
|
if (l == new)
|
||||||
@ -430,8 +430,8 @@ dl_open_worker (void *a)
|
|||||||
newp = (struct r_scope_elem **)
|
newp = (struct r_scope_elem **)
|
||||||
malloc (new_size * sizeof (struct r_scope_elem *));
|
malloc (new_size * sizeof (struct r_scope_elem *));
|
||||||
if (newp == NULL)
|
if (newp == NULL)
|
||||||
_dl_signal_error (ENOMEM, "dlopen", NULL,
|
GLRO(dl_signal_error) (ENOMEM, "dlopen", NULL,
|
||||||
N_("cannot create scope list"));
|
N_("cannot create scope list"));
|
||||||
imap->l_scope = memcpy (newp, imap->l_scope,
|
imap->l_scope = memcpy (newp, imap->l_scope,
|
||||||
cnt * sizeof (imap->l_scope[0]));
|
cnt * sizeof (imap->l_scope[0]));
|
||||||
}
|
}
|
||||||
@ -441,8 +441,8 @@ dl_open_worker (void *a)
|
|||||||
realloc (imap->l_scope,
|
realloc (imap->l_scope,
|
||||||
new_size * sizeof (struct r_scope_elem *));
|
new_size * sizeof (struct r_scope_elem *));
|
||||||
if (newp == NULL)
|
if (newp == NULL)
|
||||||
_dl_signal_error (ENOMEM, "dlopen", NULL,
|
GLRO(dl_signal_error) (ENOMEM, "dlopen", NULL,
|
||||||
N_("cannot create scope list"));
|
N_("cannot create scope list"));
|
||||||
imap->l_scope = newp;
|
imap->l_scope = newp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -503,8 +503,8 @@ dl_open_worker (void *a)
|
|||||||
generation. */
|
generation. */
|
||||||
++GL(dl_tls_generation);
|
++GL(dl_tls_generation);
|
||||||
|
|
||||||
_dl_signal_error (ENOMEM, "dlopen", NULL,
|
GLRO(dl_signal_error) (ENOMEM, "dlopen", NULL, N_("\
|
||||||
N_("cannot create TLS data structures"));
|
cannot create TLS data structures"));
|
||||||
}
|
}
|
||||||
|
|
||||||
listp->len = TLS_SLOTINFO_SURPLUS;
|
listp->len = TLS_SLOTINFO_SURPLUS;
|
||||||
@ -528,7 +528,7 @@ dl_open_worker (void *a)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Run the initializer functions of new objects. */
|
/* Run the initializer functions of new objects. */
|
||||||
_dl_init (new, __libc_argc, __libc_argv, __environ);
|
GLRO(dl_init) (new, __libc_argc, __libc_argv, __environ);
|
||||||
|
|
||||||
/* Now we can make the new map available in the global scope. */
|
/* Now we can make the new map available in the global scope. */
|
||||||
if (mode & RTLD_GLOBAL)
|
if (mode & RTLD_GLOBAL)
|
||||||
@ -550,8 +550,8 @@ dl_open_worker (void *a)
|
|||||||
|
|
||||||
/* Let the user know about the opencount. */
|
/* Let the user know about the opencount. */
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
||||||
_dl_debug_printf ("opening file=%s; opencount == %u\n\n",
|
GLRO(dl_debug_printf) ("opening file=%s; opencount == %u\n\n",
|
||||||
new->l_name, new->l_opencount);
|
new->l_name, new->l_opencount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -566,7 +566,8 @@ _dl_open (const char *file, int mode, const void *caller_dlopen)
|
|||||||
|
|
||||||
if ((mode & RTLD_BINDING_MASK) == 0)
|
if ((mode & RTLD_BINDING_MASK) == 0)
|
||||||
/* One of the flags must be set. */
|
/* One of the flags must be set. */
|
||||||
_dl_signal_error (EINVAL, file, NULL, N_("invalid mode for dlopen()"));
|
GLRO(dl_signal_error) (EINVAL, file, NULL,
|
||||||
|
N_("invalid mode for dlopen()"));
|
||||||
|
|
||||||
/* Make sure we are alone. */
|
/* Make sure we are alone. */
|
||||||
__rtld_lock_lock_recursive (GL(dl_load_lock));
|
__rtld_lock_lock_recursive (GL(dl_load_lock));
|
||||||
@ -576,11 +577,11 @@ _dl_open (const char *file, int mode, const void *caller_dlopen)
|
|||||||
args.caller_dlopen = caller_dlopen;
|
args.caller_dlopen = caller_dlopen;
|
||||||
args.caller_dl_open = RETURN_ADDRESS (0);
|
args.caller_dl_open = RETURN_ADDRESS (0);
|
||||||
args.map = NULL;
|
args.map = NULL;
|
||||||
errcode = _dl_catch_error (&objname, &errstring, dl_open_worker, &args);
|
errcode = GLRO(dl_catch_error) (&objname, &errstring, dl_open_worker, &args);
|
||||||
|
|
||||||
#ifndef MAP_COPY
|
#ifndef MAP_COPY
|
||||||
/* We must munmap() the cache file. */
|
/* We must munmap() the cache file. */
|
||||||
_dl_unload_cache ();
|
GLRO(dl_unload_cache) ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Release the lock. */
|
/* Release the lock. */
|
||||||
@ -636,7 +637,7 @@ _dl_open (const char *file, int mode, const void *caller_dlopen)
|
|||||||
free ((char *) errstring);
|
free ((char *) errstring);
|
||||||
|
|
||||||
/* Reraise the error. */
|
/* Reraise the error. */
|
||||||
_dl_signal_error (errcode, objname, NULL, local_errstring);
|
GLRO(dl_signal_error) (errcode, objname, NULL, local_errstring);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SHARED
|
#ifndef SHARED
|
||||||
|
@ -450,7 +450,6 @@ _dl_start_profile (struct link_map *map, const char *output_dir)
|
|||||||
/* Turn on profiling. */
|
/* Turn on profiling. */
|
||||||
running = 1;
|
running = 1;
|
||||||
}
|
}
|
||||||
INTDEF (_dl_start_profile)
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Helper definitions for profiling of shared libraries.
|
/* Helper definitions for profiling of shared libraries.
|
||||||
Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc.
|
Copyright (C) 1998, 2000, 2002, 2004 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||||
|
|
||||||
@ -24,13 +24,12 @@
|
|||||||
|
|
||||||
/* This is the map for the shared object we profile. It is defined here
|
/* 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. */
|
only because we test for this value being NULL or not. */
|
||||||
//Xextern struct link_map *_dl_profile_map;
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_dl_mcount_wrapper (void *selfpc)
|
_dl_mcount_wrapper (void *selfpc)
|
||||||
{
|
{
|
||||||
_dl_mcount ((ElfW(Addr)) RETURN_ADDRESS (0), (ElfW(Addr)) selfpc);
|
GLRO(dl_mcount) ((ElfW(Addr)) RETURN_ADDRESS (0), (ElfW(Addr)) selfpc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -38,6 +37,6 @@ void
|
|||||||
_dl_mcount_wrapper_check (void *selfpc)
|
_dl_mcount_wrapper_check (void *selfpc)
|
||||||
{
|
{
|
||||||
if (GL(dl_profile_map) != NULL)
|
if (GL(dl_profile_map) != NULL)
|
||||||
_dl_mcount ((ElfW(Addr)) RETURN_ADDRESS (0), (ElfW(Addr)) selfpc);
|
GLRO(dl_mcount) ((ElfW(Addr)) RETURN_ADDRESS (0), (ElfW(Addr)) selfpc);
|
||||||
}
|
}
|
||||||
libc_hidden_def (_dl_mcount_wrapper_check)
|
libc_hidden_def (_dl_mcount_wrapper_check)
|
||||||
|
@ -54,7 +54,7 @@ _dl_allocate_static_tls (struct link_map *map)
|
|||||||
if (map->l_tls_align > GL(dl_tls_static_align))
|
if (map->l_tls_align > GL(dl_tls_static_align))
|
||||||
{
|
{
|
||||||
fail:
|
fail:
|
||||||
INTUSE(_dl_signal_error) (0, map->l_name, NULL, N_("\
|
_dl_signal_error (0, map->l_name, NULL, N_("\
|
||||||
cannot allocate memory in static TLS block"));
|
cannot allocate memory in static TLS block"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,9 +147,9 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
|
|||||||
lazy = 0;
|
lazy = 0;
|
||||||
|
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_RELOC, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_RELOC, 0))
|
||||||
INTUSE(_dl_debug_printf) ("\nrelocation processing: %s%s\n",
|
_dl_debug_printf ("\nrelocation processing: %s%s\n",
|
||||||
l->l_name[0] ? l->l_name : rtld_progname,
|
l->l_name[0] ? l->l_name : rtld_progname,
|
||||||
lazy ? " (lazy)" : "");
|
lazy ? " (lazy)" : "");
|
||||||
|
|
||||||
/* DT_TEXTREL is now in level 2 and might phase out at some time.
|
/* DT_TEXTREL is now in level 2 and might phase out at some time.
|
||||||
But we rewrite the DT_FLAGS entry to a DT_TEXTREL entry to make
|
But we rewrite the DT_FLAGS entry to a DT_TEXTREL entry to make
|
||||||
@ -175,7 +175,7 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
|
|||||||
{
|
{
|
||||||
errstring = N_("cannot make segment writable for relocation");
|
errstring = N_("cannot make segment writable for relocation");
|
||||||
call_error:
|
call_error:
|
||||||
INTUSE(_dl_signal_error) (errno, l->l_name, NULL, errstring);
|
_dl_signal_error (errno, l->l_name, NULL, errstring);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (PF_R | PF_W | PF_X) == 7 && (PROT_READ | PROT_WRITE | PROT_EXEC) == 7
|
#if (PF_R | PF_W | PF_X) == 7 && (PROT_READ | PROT_WRITE | PROT_EXEC) == 7
|
||||||
@ -214,13 +214,12 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
|
|||||||
l->l_lookup_cache.type_class = _tc; \
|
l->l_lookup_cache.type_class = _tc; \
|
||||||
l->l_lookup_cache.sym = (*ref); \
|
l->l_lookup_cache.sym = (*ref); \
|
||||||
_lr = ((version) != NULL && (version)->hash != 0 \
|
_lr = ((version) != NULL && (version)->hash != 0 \
|
||||||
? INTUSE(_dl_lookup_versioned_symbol) (strtab \
|
? _dl_lookup_versioned_symbol (strtab + (*ref)->st_name, \
|
||||||
+ (*ref)->st_name, \
|
l, (ref), scope, (version),\
|
||||||
l, (ref), scope, \
|
_tc, 0) \
|
||||||
(version), _tc, 0) \
|
: _dl_lookup_symbol (strtab + (*ref)->st_name, l, (ref), \
|
||||||
: INTUSE(_dl_lookup_symbol) (strtab + (*ref)->st_name, l, \
|
scope, _tc, \
|
||||||
(ref), scope, _tc, \
|
DL_LOOKUP_ADD_DEPENDENCY)); \
|
||||||
DL_LOOKUP_ADD_DEPENDENCY)); \
|
|
||||||
l->l_lookup_cache.ret = (*ref); \
|
l->l_lookup_cache.ret = (*ref); \
|
||||||
l->l_lookup_cache.value = _lr; })) \
|
l->l_lookup_cache.value = _lr; })) \
|
||||||
: l)
|
: l)
|
||||||
@ -236,13 +235,12 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
|
|||||||
l->l_lookup_cache.type_class = _tc; \
|
l->l_lookup_cache.type_class = _tc; \
|
||||||
l->l_lookup_cache.sym = (*ref); \
|
l->l_lookup_cache.sym = (*ref); \
|
||||||
_lr = ((version) != NULL && (version)->hash != 0 \
|
_lr = ((version) != NULL && (version)->hash != 0 \
|
||||||
? INTUSE(_dl_lookup_versioned_symbol) (strtab \
|
? _dl_lookup_versioned_symbol (strtab + (*ref)->st_name, \
|
||||||
+ (*ref)->st_name, \
|
l, (ref), scope, \
|
||||||
l, (ref), scope, \
|
(version), _tc, 0) \
|
||||||
(version), _tc, 0) \
|
: _dl_lookup_symbol (strtab + (*ref)->st_name, l, (ref), \
|
||||||
: INTUSE(_dl_lookup_symbol) (strtab + (*ref)->st_name, l, \
|
scope, _tc, \
|
||||||
(ref), scope, _tc, \
|
DL_LOOKUP_ADD_DEPENDENCY)); \
|
||||||
DL_LOOKUP_ADD_DEPENDENCY)); \
|
|
||||||
l->l_lookup_cache.ret = (*ref); \
|
l->l_lookup_cache.ret = (*ref); \
|
||||||
l->l_lookup_cache.value = _lr; })) \
|
l->l_lookup_cache.value = _lr; })) \
|
||||||
: l->l_addr)
|
: l->l_addr)
|
||||||
@ -313,7 +311,7 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
|
|||||||
if (l->l_relro_size != 0)
|
if (l->l_relro_size != 0)
|
||||||
_dl_protect_relro (l);
|
_dl_protect_relro (l);
|
||||||
}
|
}
|
||||||
INTDEF (_dl_relocate_object)
|
|
||||||
|
|
||||||
void internal_function
|
void internal_function
|
||||||
_dl_protect_relro (struct link_map *l)
|
_dl_protect_relro (struct link_map *l)
|
||||||
@ -326,9 +324,9 @@ _dl_protect_relro (struct link_map *l)
|
|||||||
if (start != end
|
if (start != end
|
||||||
&& __mprotect ((void *) start, end - start, PROT_READ) < 0)
|
&& __mprotect ((void *) start, end - start, PROT_READ) < 0)
|
||||||
{
|
{
|
||||||
const char *errstring = N_("\
|
static const char errstring[] = N_("\
|
||||||
cannot apply additional memory protection after relocation");
|
cannot apply additional memory protection after relocation");
|
||||||
INTUSE(_dl_signal_error) (errno, l->l_name, NULL, errstring);
|
_dl_signal_error (errno, l->l_name, NULL, errstring);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -365,5 +363,5 @@ _dl_reloc_bad_type (struct link_map *map, unsigned int type, int plt)
|
|||||||
*cp++ = DIGIT (type);
|
*cp++ = DIGIT (type);
|
||||||
*cp = '\0';
|
*cp = '\0';
|
||||||
|
|
||||||
INTUSE(_dl_signal_error) (0, map->l_name, NULL, msgbuf);
|
_dl_signal_error (0, map->l_name, NULL, msgbuf);
|
||||||
}
|
}
|
||||||
|
@ -84,19 +84,17 @@ fixup (
|
|||||||
|
|
||||||
if (version->hash != 0)
|
if (version->hash != 0)
|
||||||
{
|
{
|
||||||
result = INTUSE(_dl_lookup_versioned_symbol) (strtab
|
result = _dl_lookup_versioned_symbol (strtab + sym->st_name,
|
||||||
+ sym->st_name,
|
l, &sym, l->l_scope,
|
||||||
l, &sym, l->l_scope,
|
version,
|
||||||
version,
|
ELF_RTYPE_CLASS_PLT, 0);
|
||||||
ELF_RTYPE_CLASS_PLT,
|
|
||||||
0);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case 0:
|
case 0:
|
||||||
result = INTUSE(_dl_lookup_symbol) (strtab + sym->st_name, l, &sym,
|
result = _dl_lookup_symbol (strtab + sym->st_name, l, &sym,
|
||||||
l->l_scope, ELF_RTYPE_CLASS_PLT,
|
l->l_scope, ELF_RTYPE_CLASS_PLT,
|
||||||
DL_LOOKUP_ADD_DEPENDENCY);
|
DL_LOOKUP_ADD_DEPENDENCY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Currently result contains the base load address (or link map)
|
/* Currently result contains the base load address (or link map)
|
||||||
@ -174,21 +172,19 @@ profile_fixup (
|
|||||||
|
|
||||||
if (version->hash != 0)
|
if (version->hash != 0)
|
||||||
{
|
{
|
||||||
result = INTUSE(_dl_lookup_versioned_symbol) (strtab
|
result = _dl_lookup_versioned_symbol (strtab
|
||||||
+ sym->st_name,
|
+ sym->st_name,
|
||||||
l, &sym,
|
l, &sym, l->l_scope,
|
||||||
l->l_scope,
|
version,
|
||||||
version,
|
ELF_RTYPE_CLASS_PLT,
|
||||||
ELF_RTYPE_CLASS_PLT,
|
0);
|
||||||
0);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case 0:
|
case 0:
|
||||||
result = INTUSE(_dl_lookup_symbol) (strtab + sym->st_name, l,
|
result = _dl_lookup_symbol (strtab + sym->st_name, l, &sym,
|
||||||
&sym, l->l_scope,
|
l->l_scope, ELF_RTYPE_CLASS_PLT,
|
||||||
ELF_RTYPE_CLASS_PLT,
|
DL_LOOKUP_ADD_DEPENDENCY);
|
||||||
DL_LOOKUP_ADD_DEPENDENCY);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Currently result contains the base load address (or link map)
|
/* Currently result contains the base load address (or link map)
|
||||||
|
66
elf/dl-sym.c
66
elf/dl-sym.c
@ -24,6 +24,37 @@
|
|||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <ldsodefs.h>
|
#include <ldsodefs.h>
|
||||||
#include <dl-hash.h>
|
#include <dl-hash.h>
|
||||||
|
#include <dl-tls.h>
|
||||||
|
|
||||||
|
|
||||||
|
#if defined USE_TLS && defined SHARED
|
||||||
|
/* Systems which do not have tls_index also probably have to define
|
||||||
|
DONT_USE_TLS_INDEX. */
|
||||||
|
|
||||||
|
# ifndef __TLS_GET_ADDR
|
||||||
|
# define __TLS_GET_ADDR __tls_get_addr
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/* Return the symbol address given the map of the module it is in and
|
||||||
|
the symbol record. This is used in dl-sym.c. */
|
||||||
|
static void *
|
||||||
|
internal_function
|
||||||
|
_dl_tls_symaddr (struct link_map *map, const ElfW(Sym) *ref)
|
||||||
|
{
|
||||||
|
# ifndef DONT_USE_TLS_INDEX
|
||||||
|
tls_index tmp =
|
||||||
|
{
|
||||||
|
.ti_module = map->l_tls_modid,
|
||||||
|
.ti_offset = ref->st_value
|
||||||
|
};
|
||||||
|
|
||||||
|
return __TLS_GET_ADDR (&tmp);
|
||||||
|
# else
|
||||||
|
return __TLS_GET_ADDR (map->l_tls_modid, ref->st_value);
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void *
|
void *
|
||||||
internal_function
|
internal_function
|
||||||
@ -51,9 +82,9 @@ _dl_sym (void *handle, const char *name, void *who)
|
|||||||
|
|
||||||
if (handle == RTLD_DEFAULT)
|
if (handle == RTLD_DEFAULT)
|
||||||
/* Search the global scope as seen in the caller object. */
|
/* Search the global scope as seen in the caller object. */
|
||||||
result = _dl_lookup_symbol (name, match, &ref, match->l_scope, 0,
|
result = GLRO(dl_lookup_symbol) (name, match, &ref, match->l_scope, 0,
|
||||||
DL_LOOKUP_RETURN_NEWEST
|
DL_LOOKUP_RETURN_NEWEST
|
||||||
| DL_LOOKUP_ADD_DEPENDENCY);
|
| DL_LOOKUP_ADD_DEPENDENCY);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (handle != RTLD_NEXT)
|
if (handle != RTLD_NEXT)
|
||||||
@ -61,8 +92,9 @@ _dl_sym (void *handle, const char *name, void *who)
|
|||||||
/* Search the scope of the given object. */
|
/* Search the scope of the given object. */
|
||||||
struct link_map *map = handle;
|
struct link_map *map = handle;
|
||||||
|
|
||||||
result = _dl_lookup_symbol (name, match, &ref, map->l_local_scope,
|
result = GLRO(dl_lookup_symbol) (name, match, &ref,
|
||||||
0, DL_LOOKUP_RETURN_NEWEST);
|
map->l_local_scope, 0,
|
||||||
|
DL_LOOKUP_RETURN_NEWEST);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -71,7 +103,7 @@ _dl_sym (void *handle, const char *name, void *who)
|
|||||||
if (! GL(dl_loaded)
|
if (! GL(dl_loaded)
|
||||||
|| caller < GL(dl_loaded)->l_map_start
|
|| caller < GL(dl_loaded)->l_map_start
|
||||||
|| caller >= GL(dl_loaded)->l_map_end)
|
|| caller >= GL(dl_loaded)->l_map_end)
|
||||||
_dl_signal_error (0, NULL, NULL, N_("\
|
GLRO(dl_signal_error) (0, NULL, NULL, N_("\
|
||||||
RTLD_NEXT used in code not dynamically loaded"));
|
RTLD_NEXT used in code not dynamically loaded"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,8 +111,8 @@ RTLD_NEXT used in code not dynamically loaded"));
|
|||||||
while (l->l_loader != NULL)
|
while (l->l_loader != NULL)
|
||||||
l = l->l_loader;
|
l = l->l_loader;
|
||||||
|
|
||||||
result = _dl_lookup_symbol_skip (name, l, &ref, l->l_local_scope,
|
result = GLRO(dl_lookup_symbol_skip) (name, l, &ref,
|
||||||
match);
|
l->l_local_scope, match);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,8 +165,9 @@ _dl_vsym (void *handle, const char *name, const char *version, void *who)
|
|||||||
|
|
||||||
if (handle == RTLD_DEFAULT)
|
if (handle == RTLD_DEFAULT)
|
||||||
/* Search the global scope. */
|
/* Search the global scope. */
|
||||||
result = _dl_lookup_versioned_symbol (name, match, &ref, match->l_scope,
|
result = GLRO(dl_lookup_versioned_symbol) (name, match, &ref,
|
||||||
&vers, 0, DL_LOOKUP_ADD_DEPENDENCY);
|
match->l_scope, &vers, 0,
|
||||||
|
DL_LOOKUP_ADD_DEPENDENCY);
|
||||||
else if (handle == RTLD_NEXT)
|
else if (handle == RTLD_NEXT)
|
||||||
{
|
{
|
||||||
if (__builtin_expect (match == GL(dl_loaded), 0))
|
if (__builtin_expect (match == GL(dl_loaded), 0))
|
||||||
@ -142,7 +175,7 @@ _dl_vsym (void *handle, const char *name, const char *version, void *who)
|
|||||||
if (! GL(dl_loaded)
|
if (! GL(dl_loaded)
|
||||||
|| caller < GL(dl_loaded)->l_map_start
|
|| caller < GL(dl_loaded)->l_map_start
|
||||||
|| caller >= GL(dl_loaded)->l_map_end)
|
|| caller >= GL(dl_loaded)->l_map_end)
|
||||||
_dl_signal_error (0, NULL, NULL, N_("\
|
GLRO(dl_signal_error) (0, NULL, NULL, N_("\
|
||||||
RTLD_NEXT used in code not dynamically loaded"));
|
RTLD_NEXT used in code not dynamically loaded"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,16 +183,17 @@ RTLD_NEXT used in code not dynamically loaded"));
|
|||||||
while (l->l_loader != NULL)
|
while (l->l_loader != NULL)
|
||||||
l = l->l_loader;
|
l = l->l_loader;
|
||||||
|
|
||||||
result = _dl_lookup_versioned_symbol_skip (name, l, &ref,
|
result = GLRO(dl_lookup_versioned_symbol_skip) (name, l, &ref,
|
||||||
l->l_local_scope,
|
l->l_local_scope,
|
||||||
&vers, match);
|
&vers, match);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Search the scope of the given object. */
|
/* Search the scope of the given object. */
|
||||||
struct link_map *map = handle;
|
struct link_map *map = handle;
|
||||||
result = _dl_lookup_versioned_symbol (name, map, &ref,
|
result = GLRO(dl_lookup_versioned_symbol) (name, map, &ref,
|
||||||
map->l_local_scope, &vers, 0, 0);
|
map->l_local_scope, &vers,
|
||||||
|
0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ref != NULL)
|
if (ref != NULL)
|
||||||
|
@ -88,10 +88,10 @@ match_symbol (const char *name, ElfW(Word) hash, const char *string,
|
|||||||
|
|
||||||
/* Display information about what we are doing while debugging. */
|
/* Display information about what we are doing while debugging. */
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_VERSIONS, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_VERSIONS, 0))
|
||||||
INTUSE(_dl_debug_printf) ("\
|
_dl_debug_printf ("\
|
||||||
checking for version `%s' in file %s required by file %s\n",
|
checking for version `%s' in file %s required by file %s\n",
|
||||||
string, map->l_name[0]
|
string, map->l_name[0] ? map->l_name : rtld_progname,
|
||||||
? map->l_name : rtld_progname, name);
|
name);
|
||||||
|
|
||||||
if (__builtin_expect (map->l_info[VERSYMIDX (DT_VERDEF)] == NULL, 0))
|
if (__builtin_expect (map->l_info[VERSYMIDX (DT_VERDEF)] == NULL, 0))
|
||||||
{
|
{
|
||||||
@ -215,9 +215,8 @@ _dl_check_map_versions (struct link_map *map, int verbose, int trace_mode)
|
|||||||
&buf[sizeof (buf) - 1], 10, 0),
|
&buf[sizeof (buf) - 1], 10, 0),
|
||||||
" of Verneed record\n");
|
" of Verneed record\n");
|
||||||
call_error:
|
call_error:
|
||||||
INTUSE(_dl_signal_error) (errval, (*map->l_name
|
_dl_signal_error (errval, *map->l_name ? map->l_name : rtld_progname,
|
||||||
? map->l_name : rtld_progname),
|
NULL, errstring);
|
||||||
NULL, errstring);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
@ -375,7 +374,6 @@ _dl_check_map_versions (struct link_map *map, int verbose, int trace_mode)
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
INTDEF (_dl_check_map_versions)
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -387,7 +385,7 @@ _dl_check_all_versions (struct link_map *map, int verbose, int trace_mode)
|
|||||||
|
|
||||||
for (l = map; l != NULL; l = l->l_next)
|
for (l = map; l != NULL; l = l->l_next)
|
||||||
result |= (! l->l_faked
|
result |= (! l->l_faked
|
||||||
&& INTUSE(_dl_check_map_versions) (l, verbose, trace_mode));
|
&& _dl_check_map_versions (l, verbose, trace_mode));
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -61,9 +61,9 @@ FCT (const char *undef_name, unsigned long int hash, const ElfW(Sym) *ref,
|
|||||||
|
|
||||||
/* Print some debugging info if wanted. */
|
/* Print some debugging info if wanted. */
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SYMBOLS, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SYMBOLS, 0))
|
||||||
INTUSE(_dl_debug_printf) ("symbol=%s; lookup in file=%s\n",
|
_dl_debug_printf ("symbol=%s; lookup in file=%s\n",
|
||||||
undef_name, (map->l_name[0]
|
undef_name,
|
||||||
? map->l_name : rtld_progname));
|
map->l_name[0] ? map->l_name : rtld_progname);
|
||||||
|
|
||||||
symtab = (const void *) D_PTR (map, l_info[DT_SYMTAB]);
|
symtab = (const void *) D_PTR (map, l_info[DT_SYMTAB]);
|
||||||
strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
|
strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
|
||||||
|
101
elf/rtld.c
101
elf/rtld.c
@ -18,6 +18,7 @@
|
|||||||
02111-1307 USA. */
|
02111-1307 USA. */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <dlfcn.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -121,6 +122,27 @@ struct rtld_global_ro _rtld_global_ro attribute_relro =
|
|||||||
._dl_hwcap_mask = HWCAP_IMPORTANT,
|
._dl_hwcap_mask = HWCAP_IMPORTANT,
|
||||||
._dl_lazy = 1,
|
._dl_lazy = 1,
|
||||||
._dl_fpu_control = _FPU_DEFAULT,
|
._dl_fpu_control = _FPU_DEFAULT,
|
||||||
|
|
||||||
|
/* Function pointers. */
|
||||||
|
._dl_get_origin = _dl_get_origin,
|
||||||
|
._dl_dst_count = _dl_dst_count,
|
||||||
|
._dl_dst_substitute = _dl_dst_substitute,
|
||||||
|
._dl_map_object = _dl_map_object,
|
||||||
|
._dl_map_object_deps = _dl_map_object_deps,
|
||||||
|
._dl_relocate_object = _dl_relocate_object,
|
||||||
|
._dl_check_map_versions = _dl_check_map_versions,
|
||||||
|
._dl_init = _dl_init,
|
||||||
|
._dl_debug_state = _dl_debug_state,
|
||||||
|
._dl_unload_cache = _dl_unload_cache,
|
||||||
|
._dl_debug_printf = _dl_debug_printf,
|
||||||
|
._dl_catch_error = _dl_catch_error,
|
||||||
|
._dl_signal_error = _dl_signal_error,
|
||||||
|
._dl_start_profile = _dl_start_profile,
|
||||||
|
._dl_mcount = _dl_mcount_internal,
|
||||||
|
._dl_lookup_symbol = _dl_lookup_symbol,
|
||||||
|
._dl_lookup_versioned_symbol = _dl_lookup_versioned_symbol,
|
||||||
|
._dl_lookup_symbol_skip = _dl_lookup_symbol_skip,
|
||||||
|
._dl_lookup_versioned_symbol_skip = _dl_lookup_versioned_symbol_skip,
|
||||||
};
|
};
|
||||||
/* If we would use strong_alias here the compiler would see a
|
/* If we would use strong_alias here the compiler would see a
|
||||||
non-hidden definition. This would undo the effect of the previous
|
non-hidden definition. This would undo the effect of the previous
|
||||||
@ -551,16 +573,15 @@ relocate_doit (void *a)
|
|||||||
{
|
{
|
||||||
struct relocate_args *args = (struct relocate_args *) a;
|
struct relocate_args *args = (struct relocate_args *) a;
|
||||||
|
|
||||||
INTUSE(_dl_relocate_object) (args->l, args->l->l_scope, args->lazy, 0);
|
_dl_relocate_object (args->l, args->l->l_scope, args->lazy, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
map_doit (void *a)
|
map_doit (void *a)
|
||||||
{
|
{
|
||||||
struct map_args *args = (struct map_args *) a;
|
struct map_args *args = (struct map_args *) a;
|
||||||
args->map = INTUSE(_dl_map_object) (args->loader, args->str,
|
args->map = _dl_map_object (args->loader, args->str,
|
||||||
args->is_preloaded, lt_library, 0,
|
args->is_preloaded, lt_library, 0, args->mode);
|
||||||
args->mode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -823,7 +844,7 @@ of this helper program; chances are you did not intend to run this program.\n\
|
|||||||
args.loader = NULL;
|
args.loader = NULL;
|
||||||
args.is_preloaded = 0;
|
args.is_preloaded = 0;
|
||||||
args.mode = __RTLD_OPENEXEC;
|
args.mode = __RTLD_OPENEXEC;
|
||||||
(void) INTUSE(_dl_catch_error) (&objname, &err_str, map_doit, &args);
|
(void) _dl_catch_error (&objname, &err_str, map_doit, &args);
|
||||||
if (__builtin_expect (err_str != NULL, 0))
|
if (__builtin_expect (err_str != NULL, 0))
|
||||||
/* We don't free the returned string, the programs stops
|
/* We don't free the returned string, the programs stops
|
||||||
anyway. */
|
anyway. */
|
||||||
@ -832,8 +853,8 @@ of this helper program; chances are you did not intend to run this program.\n\
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
HP_TIMING_NOW (start);
|
HP_TIMING_NOW (start);
|
||||||
INTUSE(_dl_map_object) (NULL, rtld_progname, 0, lt_library, 0,
|
_dl_map_object (NULL, rtld_progname, 0, lt_library, 0,
|
||||||
__RTLD_OPENEXEC);
|
__RTLD_OPENEXEC);
|
||||||
HP_TIMING_NOW (stop);
|
HP_TIMING_NOW (stop);
|
||||||
|
|
||||||
HP_TIMING_DIFF (load_time, start, stop);
|
HP_TIMING_DIFF (load_time, start, stop);
|
||||||
@ -1094,10 +1115,8 @@ of this helper program; chances are you did not intend to run this program.\n\
|
|||||||
&& (__builtin_expect (! INTUSE(__libc_enable_secure), 1)
|
&& (__builtin_expect (! INTUSE(__libc_enable_secure), 1)
|
||||||
|| strchr (p, '/') == NULL))
|
|| strchr (p, '/') == NULL))
|
||||||
{
|
{
|
||||||
struct link_map *new_map = INTUSE(_dl_map_object) (GL(dl_loaded),
|
struct link_map *new_map = _dl_map_object (GL(dl_loaded), p, 1,
|
||||||
p, 1,
|
lt_library, 0, 0);
|
||||||
lt_library,
|
|
||||||
0, 0);
|
|
||||||
if (++new_map->l_opencount == 1)
|
if (++new_map->l_opencount == 1)
|
||||||
/* It is no duplicate. */
|
/* It is no duplicate. */
|
||||||
++npreloads;
|
++npreloads;
|
||||||
@ -1174,8 +1193,7 @@ of this helper program; chances are you did not intend to run this program.\n\
|
|||||||
args.is_preloaded = 1;
|
args.is_preloaded = 1;
|
||||||
args.mode = 0;
|
args.mode = 0;
|
||||||
|
|
||||||
(void) INTUSE(_dl_catch_error) (&objname, &err_str, map_doit,
|
(void) _dl_catch_error (&objname, &err_str, map_doit, &args);
|
||||||
&args);
|
|
||||||
if (__builtin_expect (err_str != NULL, 0))
|
if (__builtin_expect (err_str != NULL, 0))
|
||||||
{
|
{
|
||||||
_dl_error_printf ("\
|
_dl_error_printf ("\
|
||||||
@ -1193,9 +1211,8 @@ ERROR: ld.so: object '%s' from %s cannot be preloaded: ignored.\n",
|
|||||||
if (problem != NULL)
|
if (problem != NULL)
|
||||||
{
|
{
|
||||||
char *p = strndupa (problem, file_size - (problem - file));
|
char *p = strndupa (problem, file_size - (problem - file));
|
||||||
struct link_map *new_map = INTUSE(_dl_map_object) (GL(dl_loaded), p,
|
struct link_map *new_map = _dl_map_object (GL(dl_loaded), p, 1,
|
||||||
1, lt_library,
|
lt_library, 0, 0);
|
||||||
0, 0);
|
|
||||||
if (++new_map->l_opencount == 1)
|
if (++new_map->l_opencount == 1)
|
||||||
/* It is no duplicate. */
|
/* It is no duplicate. */
|
||||||
++npreloads;
|
++npreloads;
|
||||||
@ -1294,8 +1311,7 @@ ERROR: ld.so: object '%s' from %s cannot be preloaded: ignored.\n",
|
|||||||
specified some libraries to load, these are inserted before the actual
|
specified some libraries to load, these are inserted before the actual
|
||||||
dependencies in the executable's searchlist for symbol resolution. */
|
dependencies in the executable's searchlist for symbol resolution. */
|
||||||
HP_TIMING_NOW (start);
|
HP_TIMING_NOW (start);
|
||||||
INTUSE(_dl_map_object_deps) (GL(dl_loaded), preloads, npreloads,
|
_dl_map_object_deps (GL(dl_loaded), preloads, npreloads, mode == trace, 0);
|
||||||
mode == trace, 0);
|
|
||||||
HP_TIMING_NOW (stop);
|
HP_TIMING_NOW (stop);
|
||||||
HP_TIMING_DIFF (diff, start, stop);
|
HP_TIMING_DIFF (diff, start, stop);
|
||||||
HP_TIMING_ACCUM_NT (load_time, diff);
|
HP_TIMING_ACCUM_NT (load_time, diff);
|
||||||
@ -1505,10 +1521,9 @@ cannot allocate TLS data structures for initial thread");
|
|||||||
ElfW(Addr) loadbase;
|
ElfW(Addr) loadbase;
|
||||||
lookup_t result;
|
lookup_t result;
|
||||||
|
|
||||||
result = INTUSE(_dl_lookup_symbol) (INTUSE(_dl_argv)[i],
|
result = _dl_lookup_symbol (INTUSE(_dl_argv)[i], GL(dl_loaded),
|
||||||
GL(dl_loaded),
|
&ref, GL(dl_loaded)->l_scope,
|
||||||
&ref, GL(dl_loaded)->l_scope,
|
ELF_RTYPE_CLASS_PLT, 1);
|
||||||
ELF_RTYPE_CLASS_PLT, 1);
|
|
||||||
|
|
||||||
loadbase = LOOKUP_VALUE_ADDRESS (result);
|
loadbase = LOOKUP_VALUE_ADDRESS (result);
|
||||||
|
|
||||||
@ -1545,8 +1560,8 @@ cannot allocate TLS data structures for initial thread");
|
|||||||
|
|
||||||
if ((GLRO(dl_debug_mask) & DL_DEBUG_PRELINK)
|
if ((GLRO(dl_debug_mask) & DL_DEBUG_PRELINK)
|
||||||
&& GL(dl_rtld_map).l_opencount > 1)
|
&& GL(dl_rtld_map).l_opencount > 1)
|
||||||
INTUSE(_dl_relocate_object) (&GL(dl_rtld_map),
|
_dl_relocate_object (&GL(dl_rtld_map), GL(dl_loaded)->l_scope,
|
||||||
GL(dl_loaded)->l_scope, 0, 0);
|
0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define VERNEEDTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (DT_VERNEED))
|
#define VERNEEDTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (DT_VERNEED))
|
||||||
@ -1783,8 +1798,8 @@ cannot allocate TLS data structures for initial thread");
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (l != &GL(dl_rtld_map))
|
if (l != &GL(dl_rtld_map))
|
||||||
INTUSE(_dl_relocate_object) (l, l->l_scope, GLRO(dl_lazy),
|
_dl_relocate_object (l, l->l_scope, GLRO(dl_lazy),
|
||||||
consider_profiling);
|
consider_profiling);
|
||||||
|
|
||||||
l = l->l_prev;
|
l = l->l_prev;
|
||||||
}
|
}
|
||||||
@ -1806,16 +1821,14 @@ cannot allocate TLS data structures for initial thread");
|
|||||||
needs to have _dl_profile_map set up by the relocator. */
|
needs to have _dl_profile_map set up by the relocator. */
|
||||||
if (__builtin_expect (GL(dl_profile_map) != NULL, 0))
|
if (__builtin_expect (GL(dl_profile_map) != NULL, 0))
|
||||||
/* We must prepare the profiling. */
|
/* We must prepare the profiling. */
|
||||||
INTUSE(_dl_start_profile) (GL(dl_profile_map),
|
_dl_start_profile (GL(dl_profile_map), GLRO(dl_profile_output));
|
||||||
GLRO(dl_profile_output));
|
|
||||||
|
|
||||||
if (GL(dl_rtld_map).l_opencount > 1)
|
if (GL(dl_rtld_map).l_opencount > 1)
|
||||||
{
|
{
|
||||||
/* There was an explicit ref to the dynamic linker as a shared lib.
|
/* There was an explicit ref to the dynamic linker as a shared lib.
|
||||||
Re-relocate ourselves with user-controlled symbol definitions. */
|
Re-relocate ourselves with user-controlled symbol definitions. */
|
||||||
HP_TIMING_NOW (start);
|
HP_TIMING_NOW (start);
|
||||||
INTUSE(_dl_relocate_object) (&GL(dl_rtld_map), GL(dl_loaded)->l_scope,
|
_dl_relocate_object (&GL(dl_rtld_map), GL(dl_loaded)->l_scope, 0, 0);
|
||||||
0, 0);
|
|
||||||
HP_TIMING_NOW (stop);
|
HP_TIMING_NOW (stop);
|
||||||
HP_TIMING_DIFF (add, start, stop);
|
HP_TIMING_DIFF (add, start, stop);
|
||||||
HP_TIMING_ACCUM_NT (relocate_time, add);
|
HP_TIMING_ACCUM_NT (relocate_time, add);
|
||||||
@ -1854,11 +1867,11 @@ cannot allocate TLS data structures for initial thread");
|
|||||||
|
|
||||||
/* Notify the debugger that all objects are now mapped in. */
|
/* Notify the debugger that all objects are now mapped in. */
|
||||||
r->r_state = RT_ADD;
|
r->r_state = RT_ADD;
|
||||||
INTUSE(_dl_debug_state) ();
|
_dl_debug_state ();
|
||||||
|
|
||||||
#ifndef MAP_COPY
|
#ifndef MAP_COPY
|
||||||
/* We must munmap() the cache file. */
|
/* We must munmap() the cache file. */
|
||||||
INTUSE(_dl_unload_cache) ();
|
_dl_unload_cache ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Once we return, _dl_sysdep_start will invoke
|
/* Once we return, _dl_sysdep_start will invoke
|
||||||
@ -2211,9 +2224,8 @@ print_statistics (hp_timing_t *rtld_total_timep)
|
|||||||
if (HP_TIMING_AVAIL)
|
if (HP_TIMING_AVAIL)
|
||||||
{
|
{
|
||||||
HP_TIMING_PRINT (buf, sizeof (buf), *rtld_total_timep);
|
HP_TIMING_PRINT (buf, sizeof (buf), *rtld_total_timep);
|
||||||
INTUSE(_dl_debug_printf) ("\nruntime linker statistics:\n"
|
_dl_debug_printf ("\nruntime linker statistics:\n"
|
||||||
" total startup time in dynamic loader: %s\n",
|
" total startup time in dynamic loader: %s\n", buf);
|
||||||
buf);
|
|
||||||
|
|
||||||
/* Print relocation statistics. */
|
/* Print relocation statistics. */
|
||||||
char pbuf[30];
|
char pbuf[30];
|
||||||
@ -2232,9 +2244,8 @@ print_statistics (hp_timing_t *rtld_total_timep)
|
|||||||
*wp++ = *cp++;
|
*wp++ = *cp++;
|
||||||
}
|
}
|
||||||
*wp = '\0';
|
*wp = '\0';
|
||||||
INTUSE(_dl_debug_printf) ("\
|
_dl_debug_printf ("\
|
||||||
time needed for relocation: %s (%s%%)\n",
|
time needed for relocation: %s (%s%%)\n", buf, pbuf);
|
||||||
buf, pbuf);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -2255,12 +2266,12 @@ print_statistics (hp_timing_t *rtld_total_timep)
|
|||||||
num_relative_relocations += l->l_info[VERSYMIDX (DT_RELACOUNT)]->d_un.d_val;
|
num_relative_relocations += l->l_info[VERSYMIDX (DT_RELACOUNT)]->d_un.d_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
INTUSE(_dl_debug_printf) (" number of relocations: %lu\n",
|
_dl_debug_printf (" number of relocations: %lu\n",
|
||||||
GL(dl_num_relocations));
|
GL(dl_num_relocations));
|
||||||
INTUSE(_dl_debug_printf) (" number of relocations from cache: %lu\n",
|
_dl_debug_printf (" number of relocations from cache: %lu\n",
|
||||||
GL(dl_num_cache_relocations));
|
GL(dl_num_cache_relocations));
|
||||||
INTUSE(_dl_debug_printf) (" number of relative relocations: %lu\n",
|
_dl_debug_printf (" number of relative relocations: %lu\n",
|
||||||
num_relative_relocations);
|
num_relative_relocations);
|
||||||
|
|
||||||
#ifndef HP_TIMING_NONAVAIL
|
#ifndef HP_TIMING_NONAVAIL
|
||||||
/* Time spend while loading the object and the dependencies. */
|
/* Time spend while loading the object and the dependencies. */
|
||||||
@ -2282,7 +2293,7 @@ print_statistics (hp_timing_t *rtld_total_timep)
|
|||||||
*wp++ = *cp++;
|
*wp++ = *cp++;
|
||||||
}
|
}
|
||||||
*wp = '\0';
|
*wp = '\0';
|
||||||
INTUSE(_dl_debug_printf) ("\
|
_dl_debug_printf ("\
|
||||||
time needed to load objects: %s (%s%%)\n",
|
time needed to load objects: %s (%s%%)\n",
|
||||||
buf, pbuf);
|
buf, pbuf);
|
||||||
}
|
}
|
||||||
|
@ -64,10 +64,6 @@ extern int _dl_catch_error (const char **objname, const char **errstring,
|
|||||||
void (*operate) (void *),
|
void (*operate) (void *),
|
||||||
void *args)
|
void *args)
|
||||||
internal_function;
|
internal_function;
|
||||||
extern int _dl_catch_error_internal (const char **objname,
|
|
||||||
const char **errstring,
|
|
||||||
void (*operate) (void *), void *args)
|
|
||||||
internal_function;
|
|
||||||
|
|
||||||
/* Helper function for <dlfcn.h> functions. Runs the OPERATE function via
|
/* Helper function for <dlfcn.h> functions. Runs the OPERATE function via
|
||||||
_dl_catch_error. Returns zero for success, nonzero for failure; and
|
_dl_catch_error. Returns zero for success, nonzero for failure; and
|
||||||
|
@ -188,7 +188,7 @@ _dl_load_cache_lookup (const char *name)
|
|||||||
|
|
||||||
/* Print a message if the loading of libs is traced. */
|
/* Print a message if the loading of libs is traced. */
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0))
|
||||||
INTUSE(_dl_debug_printf) (" search cache=%s\n", LD_SO_CACHE);
|
_dl_debug_printf (" search cache=%s\n", LD_SO_CACHE);
|
||||||
|
|
||||||
if (cache == NULL)
|
if (cache == NULL)
|
||||||
{
|
{
|
||||||
@ -291,7 +291,7 @@ _dl_load_cache_lookup (const char *name)
|
|||||||
/* Print our result if wanted. */
|
/* Print our result if wanted. */
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0)
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0)
|
||||||
&& best != NULL)
|
&& best != NULL)
|
||||||
INTUSE(_dl_debug_printf) (" trying file=%s\n", best);
|
_dl_debug_printf (" trying file=%s\n", best);
|
||||||
|
|
||||||
return best;
|
return best;
|
||||||
}
|
}
|
||||||
@ -310,5 +310,4 @@ _dl_unload_cache (void)
|
|||||||
cache = NULL;
|
cache = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
INTDEF (_dl_unload_cache)
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Manage function descriptors. Generic version.
|
/* Manage function descriptors. Generic version.
|
||||||
Copyright (C) 1999,2000,2001,2002,2003 Free Software Foundation, Inc.
|
Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -80,12 +80,12 @@ new_fdesc_table (struct local *l, size_t *size)
|
|||||||
if (! COMPARE_AND_SWAP (&l->npages, old_npages, new_npages))
|
if (! COMPARE_AND_SWAP (&l->npages, old_npages, new_npages))
|
||||||
return (struct fdesc_table *) NULL;
|
return (struct fdesc_table *) NULL;
|
||||||
|
|
||||||
*size = old_npages * GL(dl_pagesize);
|
*size = old_npages * GLRO(dl_pagesize);
|
||||||
new_table = __mmap (NULL, *size,
|
new_table = __mmap (NULL, *size,
|
||||||
PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
|
PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
|
||||||
if (new_table == MAP_FAILED)
|
if (new_table == MAP_FAILED)
|
||||||
INTUSE(_dl_signal_error) (errno, NULL, NULL,
|
_dl_signal_error (errno, NULL, NULL,
|
||||||
N_("cannot map pages for fdesc table"));
|
N_("cannot map pages for fdesc table"));
|
||||||
|
|
||||||
new_table->len
|
new_table->len
|
||||||
= (*size - sizeof (*new_table)) / sizeof (struct fdesc);
|
= (*size - sizeof (*new_table)) / sizeof (struct fdesc);
|
||||||
@ -178,8 +178,8 @@ make_fptr_table (struct link_map *map)
|
|||||||
afterwards... */
|
afterwards... */
|
||||||
len = ((strtab - (char *) symtab)
|
len = ((strtab - (char *) symtab)
|
||||||
/ map->l_info[DT_SYMENT]->d_un.d_val);
|
/ map->l_info[DT_SYMENT]->d_un.d_val);
|
||||||
size = ((len * sizeof (fptr_table[0]) + GL(dl_pagesize) - 1)
|
size = ((len * sizeof (fptr_table[0]) + GLRO(dl_pagesize) - 1)
|
||||||
& -GL(dl_pagesize));
|
& -GLRO(dl_pagesize));
|
||||||
/* XXX We don't support here in the moment systems without MAP_ANON.
|
/* XXX We don't support here in the moment systems without MAP_ANON.
|
||||||
There probably are none for IA-64. In case this is proven wrong
|
There probably are none for IA-64. In case this is proven wrong
|
||||||
we will have to open /dev/null here and use the file descriptor
|
we will have to open /dev/null here and use the file descriptor
|
||||||
@ -188,8 +188,8 @@ make_fptr_table (struct link_map *map)
|
|||||||
PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE,
|
PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE,
|
||||||
-1, 0);
|
-1, 0);
|
||||||
if (fptr_table == MAP_FAILED)
|
if (fptr_table == MAP_FAILED)
|
||||||
INTUSE(_dl_signal_error) (errno, NULL, NULL,
|
_dl_signal_error (errno, NULL, NULL,
|
||||||
N_("cannot map pages for fptr table"));
|
N_("cannot map pages for fptr table"));
|
||||||
|
|
||||||
if (COMPARE_AND_SWAP ((ElfW(Addr) *) &map->l_mach.fptr_table,
|
if (COMPARE_AND_SWAP ((ElfW(Addr) *) &map->l_mach.fptr_table,
|
||||||
(ElfW(Addr)) NULL, (ElfW(Addr)) fptr_table))
|
(ElfW(Addr)) NULL, (ElfW(Addr)) fptr_table))
|
||||||
@ -217,8 +217,8 @@ _dl_make_fptr (struct link_map *map, const ElfW(Sym) *sym,
|
|||||||
symidx = sym - symtab;
|
symidx = sym - symtab;
|
||||||
|
|
||||||
if (symidx >= map->l_mach.fptr_table_len)
|
if (symidx >= map->l_mach.fptr_table_len)
|
||||||
INTUSE(_dl_signal_error) (0, NULL, NULL, N_("\
|
_dl_signal_error (0, NULL, NULL,
|
||||||
internal error: symidx out of range of fptr table"));
|
N_("internal error: symidx out of range of fptr table"));
|
||||||
|
|
||||||
while (ftab[symidx] == 0)
|
while (ftab[symidx] == 0)
|
||||||
{
|
{
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#include <dl-dst.h>
|
#include <dl-dst.h>
|
||||||
|
|
||||||
|
|
||||||
#undef _dl_get_origin
|
|
||||||
const char *
|
const char *
|
||||||
_dl_get_origin (void)
|
_dl_get_origin (void)
|
||||||
{
|
{
|
||||||
@ -50,4 +49,3 @@ _dl_get_origin (void)
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
INTDEF(_dl_get_origin)
|
|
||||||
|
@ -416,8 +416,8 @@ _dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz,
|
|||||||
#ifndef USE_TLS
|
#ifndef USE_TLS
|
||||||
no_memory:
|
no_memory:
|
||||||
#endif
|
#endif
|
||||||
INTUSE(_dl_signal_error) (ENOMEM, NULL, NULL,
|
_dl_signal_error (ENOMEM, NULL, NULL,
|
||||||
N_("cannot create capability list"));
|
N_("cannot create capability list"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cnt == 1)
|
if (cnt == 1)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Thread-local storage handling in the ELF dynamic linker. Generic version.
|
/* Thread-local storage handling in the ELF dynamic linker. Generic version.
|
||||||
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -505,32 +505,6 @@ rtld_hidden_def (_dl_deallocate_tls)
|
|||||||
# ifndef GET_ADDR_OFFSET
|
# ifndef GET_ADDR_OFFSET
|
||||||
# define GET_ADDR_OFFSET ti->ti_offset
|
# define GET_ADDR_OFFSET ti->ti_offset
|
||||||
# endif
|
# endif
|
||||||
/* Systems which do not have tls_index also probably have to define
|
|
||||||
DONT_USE_TLS_INDEX. */
|
|
||||||
|
|
||||||
# ifndef __TLS_GET_ADDR
|
|
||||||
# define __TLS_GET_ADDR __tls_get_addr
|
|
||||||
# endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Return the symbol address given the map of the module it is in and
|
|
||||||
the symbol record. This is used in dl-sym.c. */
|
|
||||||
void *
|
|
||||||
internal_function
|
|
||||||
_dl_tls_symaddr (struct link_map *map, const ElfW(Sym) *ref)
|
|
||||||
{
|
|
||||||
# ifndef DONT_USE_TLS_INDEX
|
|
||||||
tls_index tmp =
|
|
||||||
{
|
|
||||||
.ti_module = map->l_tls_modid,
|
|
||||||
.ti_offset = ref->st_value
|
|
||||||
};
|
|
||||||
|
|
||||||
return __TLS_GET_ADDR (&tmp);
|
|
||||||
# else
|
|
||||||
return __TLS_GET_ADDR (map->l_tls_modid, ref->st_value);
|
|
||||||
# endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
|
@ -447,14 +447,74 @@ struct rtld_global_ro
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SHARED
|
#ifdef SHARED
|
||||||
|
/* We add a function table to _rtld_global which is then used to
|
||||||
|
call the function instead of going through the PLT. The result
|
||||||
|
is that we can avoid exporting the functions and we do not jump
|
||||||
|
PLT relocations in libc.so. */
|
||||||
|
const char *(*_dl_get_origin) (void);
|
||||||
|
size_t (*_dl_dst_count) (const char *, int);
|
||||||
|
char *(*_dl_dst_substitute) (struct link_map *, const char *, char *, int);
|
||||||
|
struct link_map *(internal_function *_dl_map_object) (struct link_map *,
|
||||||
|
const char *, int,
|
||||||
|
int, int, int);
|
||||||
|
void (internal_function *_dl_map_object_deps) (struct link_map *,
|
||||||
|
struct link_map **,
|
||||||
|
unsigned int, int, int);
|
||||||
|
void (*_dl_relocate_object) (struct link_map *, struct r_scope_elem *[],
|
||||||
|
int, int);
|
||||||
|
int (internal_function *_dl_check_map_versions) (struct link_map *, int,
|
||||||
|
int);
|
||||||
|
void (internal_function *_dl_init) (struct link_map *, int, char **,
|
||||||
|
char **);
|
||||||
|
void (*_dl_debug_state) (void);
|
||||||
|
#ifndef MAP_COPY
|
||||||
|
void (*_dl_unload_cache) (void);
|
||||||
|
#endif
|
||||||
|
void (*_dl_debug_printf) (const char *, ...)
|
||||||
|
__attribute__ ((__format__ (__printf__, 1, 2)));
|
||||||
|
int (internal_function *_dl_catch_error) (const char **, const char **,
|
||||||
|
void (*) (void *), void *);
|
||||||
|
void (internal_function *_dl_signal_error) (int, const char *, const char *,
|
||||||
|
const char *);
|
||||||
|
void (internal_function *_dl_start_profile) (struct link_map *,
|
||||||
|
const char *);
|
||||||
|
void (*_dl_mcount) (ElfW(Addr) frompc, ElfW(Addr) selfpc);
|
||||||
|
lookup_t (internal_function *_dl_lookup_symbol) (const char *,
|
||||||
|
struct link_map *,
|
||||||
|
const ElfW(Sym) **,
|
||||||
|
struct r_scope_elem *[],
|
||||||
|
int, int);
|
||||||
|
lookup_t (internal_function *_dl_lookup_versioned_symbol) (const char *,
|
||||||
|
struct link_map *,
|
||||||
|
const ElfW(Sym) **,
|
||||||
|
struct r_scope_elem *[],
|
||||||
|
const struct r_found_version *,
|
||||||
|
int, int);
|
||||||
|
lookup_t (internal_function *_dl_lookup_symbol_skip) (const char *,
|
||||||
|
struct link_map *,
|
||||||
|
const ElfW(Sym) **,
|
||||||
|
struct r_scope_elem *[],
|
||||||
|
struct link_map *);
|
||||||
|
lookup_t (internal_function *_dl_lookup_versioned_symbol_skip) (const char *,
|
||||||
|
struct link_map *,
|
||||||
|
const ElfW(Sym) **,
|
||||||
|
struct r_scope_elem *[],
|
||||||
|
const struct r_found_version *,
|
||||||
|
struct link_map *);
|
||||||
|
|
||||||
};
|
};
|
||||||
# define __rtld_global_attribute__
|
# define __rtld_global_attribute__
|
||||||
# ifdef IS_IN_rtld
|
# ifdef IS_IN_rtld
|
||||||
extern struct rtld_global_ro _rtld_local_ro
|
extern struct rtld_global_ro _rtld_local_ro
|
||||||
attribute_relro __rtld_local_attribute__;
|
attribute_relro __rtld_local_attribute__;
|
||||||
# endif
|
|
||||||
extern struct rtld_global_ro _rtld_global_ro
|
extern struct rtld_global_ro _rtld_global_ro
|
||||||
attribute_relro __rtld_global_attribute__;
|
attribute_relro __rtld_global_attribute__;
|
||||||
|
# else
|
||||||
|
/* We cheat a bit here. We declare the variable as as const even
|
||||||
|
though it is at startup. */
|
||||||
|
extern const struct rtld_global_ro _rtld_global_ro
|
||||||
|
attribute_relro __rtld_global_attribute__;
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
|
|
||||||
@ -518,10 +578,7 @@ extern int _dl_sysdep_open_zero_fill (void); /* dl-sysdep.c */
|
|||||||
interpreted as for a `printf' call. All the lines start with a
|
interpreted as for a `printf' call. All the lines start with a
|
||||||
tag showing the PID. */
|
tag showing the PID. */
|
||||||
extern void _dl_debug_printf (const char *fmt, ...)
|
extern void _dl_debug_printf (const char *fmt, ...)
|
||||||
__attribute__ ((__format__ (__printf__, 1, 2)));
|
__attribute__ ((__format__ (__printf__, 1, 2))) attribute_hidden;
|
||||||
extern void _dl_debug_printf_internal (const char *fmt, ...)
|
|
||||||
__attribute__ ((__format__ (__printf__, 1, 2)))
|
|
||||||
attribute_hidden;
|
|
||||||
|
|
||||||
/* Write message on the debug file descriptor. The parameters are
|
/* Write message on the debug file descriptor. The parameters are
|
||||||
interpreted as for a `printf' call. All the lines buf the first
|
interpreted as for a `printf' call. All the lines buf the first
|
||||||
@ -564,11 +621,6 @@ extern void _dl_dprintf (int fd, const char *fmt, ...)
|
|||||||
problem. */
|
problem. */
|
||||||
extern void _dl_signal_error (int errcode, const char *object,
|
extern void _dl_signal_error (int errcode, const char *object,
|
||||||
const char *occurred, const char *errstring)
|
const char *occurred, const char *errstring)
|
||||||
internal_function
|
|
||||||
__attribute__ ((__noreturn__));
|
|
||||||
extern void _dl_signal_error_internal (int errcode, const char *object,
|
|
||||||
const char *occurred,
|
|
||||||
const char *errstring)
|
|
||||||
internal_function __attribute__ ((__noreturn__)) attribute_hidden;
|
internal_function __attribute__ ((__noreturn__)) attribute_hidden;
|
||||||
|
|
||||||
/* Like _dl_signal_error, but may return when called in the context of
|
/* Like _dl_signal_error, but may return when called in the context of
|
||||||
@ -594,12 +646,6 @@ extern void _dl_receive_error (receiver_fct fct, void (*operate) (void *),
|
|||||||
extern struct link_map *_dl_map_object (struct link_map *loader,
|
extern struct link_map *_dl_map_object (struct link_map *loader,
|
||||||
const char *name, int preloaded,
|
const char *name, int preloaded,
|
||||||
int type, int trace_mode, int mode)
|
int type, int trace_mode, int mode)
|
||||||
internal_function;
|
|
||||||
extern struct link_map *_dl_map_object_internal (struct link_map *loader,
|
|
||||||
const char *name,
|
|
||||||
int preloaded,
|
|
||||||
int type, int trace_mode,
|
|
||||||
int mode)
|
|
||||||
internal_function attribute_hidden;
|
internal_function attribute_hidden;
|
||||||
|
|
||||||
/* Call _dl_map_object on the dependencies of MAP, and set up
|
/* Call _dl_map_object on the dependencies of MAP, and set up
|
||||||
@ -610,11 +656,6 @@ extern void _dl_map_object_deps (struct link_map *map,
|
|||||||
struct link_map **preloads,
|
struct link_map **preloads,
|
||||||
unsigned int npreloads, int trace_mode,
|
unsigned int npreloads, int trace_mode,
|
||||||
int open_mode)
|
int open_mode)
|
||||||
internal_function;
|
|
||||||
extern void _dl_map_object_deps_internal (struct link_map *map,
|
|
||||||
struct link_map **preloads,
|
|
||||||
unsigned int npreloads,
|
|
||||||
int trace_mode, int open_mode)
|
|
||||||
internal_function attribute_hidden;
|
internal_function attribute_hidden;
|
||||||
|
|
||||||
/* Cache the locations of MAP's hash table. */
|
/* Cache the locations of MAP's hash table. */
|
||||||
@ -646,12 +687,6 @@ extern lookup_t _dl_lookup_symbol (const char *undef,
|
|||||||
const ElfW(Sym) **sym,
|
const ElfW(Sym) **sym,
|
||||||
struct r_scope_elem *symbol_scope[],
|
struct r_scope_elem *symbol_scope[],
|
||||||
int type_class, int flags)
|
int type_class, int flags)
|
||||||
internal_function;
|
|
||||||
extern lookup_t _dl_lookup_symbol_internal (const char *undef,
|
|
||||||
struct link_map *undef_map,
|
|
||||||
const ElfW(Sym) **sym,
|
|
||||||
struct r_scope_elem *symbolscope[],
|
|
||||||
int type_class, int flags)
|
|
||||||
internal_function attribute_hidden;
|
internal_function attribute_hidden;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
@ -670,14 +705,6 @@ extern lookup_t _dl_lookup_versioned_symbol (const char *undef,
|
|||||||
struct r_scope_elem *symbol_scope[],
|
struct r_scope_elem *symbol_scope[],
|
||||||
const struct r_found_version *version,
|
const struct r_found_version *version,
|
||||||
int type_class, int explicit)
|
int type_class, int explicit)
|
||||||
internal_function;
|
|
||||||
extern lookup_t _dl_lookup_versioned_symbol_internal (const char *undef,
|
|
||||||
struct link_map *undef_map,
|
|
||||||
const ElfW(Sym) **sym,
|
|
||||||
struct r_scope_elem *symbol_scope[],
|
|
||||||
const struct r_found_version *version,
|
|
||||||
int type_class,
|
|
||||||
int explicit)
|
|
||||||
internal_function attribute_hidden;
|
internal_function attribute_hidden;
|
||||||
|
|
||||||
/* For handling RTLD_NEXT we must be able to skip shared objects. */
|
/* For handling RTLD_NEXT we must be able to skip shared objects. */
|
||||||
@ -713,10 +740,7 @@ extern struct link_map *_dl_new_object (char *realname, const char *libname,
|
|||||||
If LAZY is nonzero, don't relocate its PLT. */
|
If LAZY is nonzero, don't relocate its PLT. */
|
||||||
extern void _dl_relocate_object (struct link_map *map,
|
extern void _dl_relocate_object (struct link_map *map,
|
||||||
struct r_scope_elem *scope[],
|
struct r_scope_elem *scope[],
|
||||||
int lazy, int consider_profiling);
|
int lazy, int consider_profiling)
|
||||||
extern void _dl_relocate_object_internal (struct link_map *map,
|
|
||||||
struct r_scope_elem *scope[],
|
|
||||||
int lazy, int consider_profiling)
|
|
||||||
attribute_hidden;
|
attribute_hidden;
|
||||||
|
|
||||||
/* Protect PT_GNU_RELRO area. */
|
/* Protect PT_GNU_RELRO area. */
|
||||||
@ -750,7 +774,7 @@ extern int _dl_check_map_versions (struct link_map *map, int verbose,
|
|||||||
/* Initialize the object in SCOPE by calling the constructors with
|
/* Initialize the object in SCOPE by calling the constructors with
|
||||||
ARGC, ARGV, and ENV as the parameters. */
|
ARGC, ARGV, and ENV as the parameters. */
|
||||||
extern void _dl_init (struct link_map *main_map, int argc, char **argv,
|
extern void _dl_init (struct link_map *main_map, int argc, char **argv,
|
||||||
char **env) internal_function;
|
char **env) internal_function attribute_hidden;
|
||||||
|
|
||||||
/* Call the finalizer functions of all shared objects whose
|
/* Call the finalizer functions of all shared objects whose
|
||||||
initializer functions have completed. */
|
initializer functions have completed. */
|
||||||
@ -760,8 +784,7 @@ extern void _dl_fini (void) internal_function;
|
|||||||
any shared object mappings. The `r_state' member of `struct r_debug'
|
any shared object mappings. The `r_state' member of `struct r_debug'
|
||||||
says what change is taking place. This function's address is
|
says what change is taking place. This function's address is
|
||||||
the value of the `r_brk' member. */
|
the value of the `r_brk' member. */
|
||||||
extern void _dl_debug_state (void);
|
extern void _dl_debug_state (void) attribute_hidden;
|
||||||
extern void _dl_debug_state_internal (void) attribute_hidden;
|
|
||||||
|
|
||||||
/* Initialize `struct r_debug' if it has not already been done. The
|
/* Initialize `struct r_debug' if it has not already been done. The
|
||||||
argument is the run-time load address of the dynamic linker, to be put
|
argument is the run-time load address of the dynamic linker, to be put
|
||||||
@ -775,9 +798,6 @@ extern void _dl_init_paths (const char *library_path) internal_function;
|
|||||||
/* Gather the information needed to install the profiling tables and start
|
/* Gather the information needed to install the profiling tables and start
|
||||||
the timers. */
|
the timers. */
|
||||||
extern void _dl_start_profile (struct link_map *map, const char *output_dir)
|
extern void _dl_start_profile (struct link_map *map, const char *output_dir)
|
||||||
internal_function;
|
|
||||||
extern void _dl_start_profile_internal (struct link_map *map,
|
|
||||||
const char *output_dir)
|
|
||||||
internal_function attribute_hidden;
|
internal_function attribute_hidden;
|
||||||
|
|
||||||
/* The actual functions used to keep book on the calls. */
|
/* The actual functions used to keep book on the calls. */
|
||||||
@ -813,8 +833,7 @@ extern const char *_dl_load_cache_lookup (const char *name)
|
|||||||
all the time since this would create problems when the file is replaced.
|
all the time since this would create problems when the file is replaced.
|
||||||
Therefore we provide this function to close the file and open it again
|
Therefore we provide this function to close the file and open it again
|
||||||
once needed. */
|
once needed. */
|
||||||
extern void _dl_unload_cache (void);
|
extern void _dl_unload_cache (void) attribute_hidden;
|
||||||
extern void _dl_unload_cache_internal (void) attribute_hidden;
|
|
||||||
|
|
||||||
/* System-dependent function to read a file's whole contents in the
|
/* System-dependent function to read a file's whole contents in the
|
||||||
most convenient manner available. *SIZEP gets the size of the
|
most convenient manner available. *SIZEP gets the size of the
|
||||||
@ -871,15 +890,20 @@ rtld_hidden_proto (_dl_allocate_tls_init)
|
|||||||
extern void _dl_deallocate_tls (void *tcb, bool dealloc_tcb) internal_function;
|
extern void _dl_deallocate_tls (void *tcb, bool dealloc_tcb) internal_function;
|
||||||
rtld_hidden_proto (_dl_deallocate_tls)
|
rtld_hidden_proto (_dl_deallocate_tls)
|
||||||
|
|
||||||
/* Return the symbol address given the map of the module it is in and
|
|
||||||
the symbol record. */
|
|
||||||
extern void *_dl_tls_symaddr (struct link_map *map, const ElfW(Sym) *ref)
|
|
||||||
internal_function;
|
|
||||||
|
|
||||||
#if defined USE_TLS
|
#if defined USE_TLS
|
||||||
extern void _dl_nothread_init_static_tls (struct link_map *) attribute_hidden;
|
extern void _dl_nothread_init_static_tls (struct link_map *) attribute_hidden;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Find origin of the executable. */
|
||||||
|
extern const char *_dl_get_origin (void) attribute_hidden;
|
||||||
|
|
||||||
|
/* Count DSTs. */
|
||||||
|
extern size_t _dl_dst_count (const char *name, int is_path) attribute_hidden;
|
||||||
|
|
||||||
|
/* Substitute DST values. */
|
||||||
|
extern char *_dl_dst_substitute (struct link_map *l, const char *name,
|
||||||
|
char *result, int is_path) attribute_hidden;
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
#endif /* ldsodefs.h */
|
#endif /* ldsodefs.h */
|
||||||
|
@ -174,7 +174,7 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
|
|||||||
/* Call the initializer of the program, if any. */
|
/* Call the initializer of the program, if any. */
|
||||||
#ifdef SHARED
|
#ifdef SHARED
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
||||||
_dl_debug_printf ("\ninitialize program: %s\n\n", argv[0]);
|
GLRO(dl_debug_printf) ("\ninitialize program: %s\n\n", argv[0]);
|
||||||
#endif
|
#endif
|
||||||
if (init)
|
if (init)
|
||||||
(*init) (
|
(*init) (
|
||||||
@ -185,7 +185,7 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
|
|||||||
|
|
||||||
#ifdef SHARED
|
#ifdef SHARED
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
||||||
_dl_debug_printf ("\ntransferring control: %s\n\n", argv[0]);
|
GLRO(dl_debug_printf) ("\ntransferring control: %s\n\n", argv[0]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CLEANUP_JMP_BUF
|
#ifdef HAVE_CLEANUP_JMP_BUF
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Thread-local storage handling in the ELF dynamic linker. i386 version.
|
/* Thread-local storage handling in the ELF dynamic linker. i386 version.
|
||||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -33,6 +33,7 @@ extern void *___tls_get_addr (tls_index *ti)
|
|||||||
extern void *___tls_get_addr_internal (tls_index *ti)
|
extern void *___tls_get_addr_internal (tls_index *ti)
|
||||||
__attribute__ ((__regparm__ (1))) attribute_hidden;
|
__attribute__ ((__regparm__ (1))) attribute_hidden;
|
||||||
|
|
||||||
|
# ifdef IS_IN_rtld
|
||||||
/* The special thing about the x86 TLS ABI is that we have two
|
/* The special thing about the x86 TLS ABI is that we have two
|
||||||
variants of the __tls_get_addr function with different calling
|
variants of the __tls_get_addr function with different calling
|
||||||
conventions. The GNU version, which we are mostly concerned here,
|
conventions. The GNU version, which we are mostly concerned here,
|
||||||
@ -50,5 +51,10 @@ __tls_get_addr (tls_index *ti)
|
|||||||
version of this file. */
|
version of this file. */
|
||||||
# define __tls_get_addr __attribute__ ((__regparm__ (1))) ___tls_get_addr
|
# define __tls_get_addr __attribute__ ((__regparm__ (1))) ___tls_get_addr
|
||||||
strong_alias (___tls_get_addr, ___tls_get_addr_internal)
|
strong_alias (___tls_get_addr, ___tls_get_addr_internal)
|
||||||
# define __TLS_GET_ADDR ___tls_get_addr_internal
|
#else
|
||||||
|
|
||||||
|
/* Users should get the better interface. */
|
||||||
|
# define __tls_get_addr ___tls_get_addr
|
||||||
|
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Operating system support for run-time dynamic linker. Hurd version.
|
/* Operating system support for run-time dynamic linker. Hurd version.
|
||||||
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
|
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
@ -252,7 +252,7 @@ unfmh(); /* XXX */
|
|||||||
__mach_init ();
|
__mach_init ();
|
||||||
|
|
||||||
/* Initialize frequently used global variable. */
|
/* Initialize frequently used global variable. */
|
||||||
GL(dl_pagesize) = __getpagesize ();
|
GLRO(dl_pagesize) = __getpagesize ();
|
||||||
|
|
||||||
#if HP_TIMING_AVAIL
|
#if HP_TIMING_AVAIL
|
||||||
HP_TIMING_NOW (_dl_cpuclock_offset);
|
HP_TIMING_NOW (_dl_cpuclock_offset);
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
the path of the application from the /proc/self/exe symlink. Try this
|
the path of the application from the /proc/self/exe symlink. Try this
|
||||||
first and fall back on the generic method if necessary. */
|
first and fall back on the generic method if necessary. */
|
||||||
|
|
||||||
#undef _dl_get_origin
|
|
||||||
const char *
|
const char *
|
||||||
_dl_get_origin (void)
|
_dl_get_origin (void)
|
||||||
{
|
{
|
||||||
@ -77,4 +76,3 @@ _dl_get_origin (void)
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
INTDEF(_dl_get_origin)
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Variable initialization. IA-64 version.
|
/* Variable initialization. IA-64 version.
|
||||||
Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -31,8 +31,8 @@ _dl_var_init (void *array[])
|
|||||||
DL_CLKTCK
|
DL_CLKTCK
|
||||||
};
|
};
|
||||||
|
|
||||||
GL(dl_pagesize) = *((size_t *) array[DL_PAGESIZE]);
|
GLRO(dl_pagesize) = *((size_t *) array[DL_PAGESIZE]);
|
||||||
GL(dl_clktck) = *((int *) array[DL_CLKTCK]);
|
GLRO(dl_clktck) = *((int *) array[DL_CLKTCK]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@ -42,8 +42,8 @@ __libc_lock_define_initialized_recursive (static, _dl_static_lock)
|
|||||||
|
|
||||||
static void *variables[] =
|
static void *variables[] =
|
||||||
{
|
{
|
||||||
&GL(dl_pagesize),
|
&GLRO(dl_pagesize),
|
||||||
&GL(dl_clktck)
|
&GLRO(dl_clktck)
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* 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.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -32,8 +32,8 @@
|
|||||||
int
|
int
|
||||||
__getpagesize ()
|
__getpagesize ()
|
||||||
{
|
{
|
||||||
assert (GL(dl_pagesize) != 0);
|
assert (GLRO(dl_pagesize) != 0);
|
||||||
return GL(dl_pagesize);
|
return GLRO(dl_pagesize);
|
||||||
}
|
}
|
||||||
libc_hidden_def (__getpagesize)
|
libc_hidden_def (__getpagesize)
|
||||||
weak_alias (__getpagesize, getpagesize)
|
weak_alias (__getpagesize, getpagesize)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
|
/* Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Andreas Schwab <schwab@suse.de>.
|
Contributed by Andreas Schwab <schwab@suse.de>.
|
||||||
|
|
||||||
@ -33,8 +33,8 @@ __getpagesize ()
|
|||||||
int result;
|
int result;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (GL(dl_pagesize) != 0)
|
if (GLRO(dl_pagesize) != 0)
|
||||||
return GL(dl_pagesize);
|
return GLRO(dl_pagesize);
|
||||||
|
|
||||||
#ifdef __NR_getpagesize
|
#ifdef __NR_getpagesize
|
||||||
INTERNAL_SYSCALL_DECL (err);
|
INTERNAL_SYSCALL_DECL (err);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1997, 2002, 2003 Free Software Foundation, Inc.
|
/* Copyright (C) 1997, 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -31,12 +31,12 @@
|
|||||||
int
|
int
|
||||||
__getpagesize ()
|
__getpagesize ()
|
||||||
{
|
{
|
||||||
if (GL(dl_pagesize) == 0)
|
if (GLRO(dl_pagesize) == 0)
|
||||||
{
|
{
|
||||||
INTERNAL_SYSCALL_DECL (err);
|
INTERNAL_SYSCALL_DECL (err);
|
||||||
GL(dl_pagesize) = INTERNAL_SYSCALL (getpagesize, err, 0);
|
GLRO(dl_pagesize) = INTERNAL_SYSCALL (getpagesize, err, 0);
|
||||||
}
|
}
|
||||||
return GL(dl_pagesize);
|
return GLRO(dl_pagesize);
|
||||||
}
|
}
|
||||||
libc_hidden_def (__getpagesize)
|
libc_hidden_def (__getpagesize)
|
||||||
weak_alias (__getpagesize, getpagesize)
|
weak_alias (__getpagesize, getpagesize)
|
||||||
|
Reference in New Issue
Block a user