mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Update.
Change ld.so to not use functions which are exported. One cannot interpose them anyway. Use INT() to mark uses, INTDEF() to mark definitions. * include/libc-symbols.h: Define INT and INTDEF. * sysdeps/generic/ldsodefs.h: Declare _dl_debug_printf_internal, _dl_signal_error_internal, _dl_map_object_internal, _dl_map_object_deps_internal, _dl_lookup_symbol_internal, _dl_lookup_versioned_symbol_internal, _dl_relocate_object_internal, _dl_debug_state_internal, _dl_start_profile_internal, and _dl_unload_cache_internal. * include/dlfcn.h: Declare _dl_catch_error_internal. * elf/rtld.c: Use INT for calls to any of the *_internal functions above. Add INTDEF to function definitions. * elf/dl-debug.c: Likewise. * 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-open.c: Likewise. * elf/dl-profile.c: Likewise. * elf/dl-reloc.c: Likewise. * elf/dl-runtime.c: Likewise. * elf/dl-version.c: Likewise. * elf/do-lookup.h: Likewise. * sysdeps/generic/dl-cache.c: Likewise. * sysdeps/generic/dl-sysdep.c: Likewise. * sysdeps/alpha/dl-machine.h (RTLD_START): Call _dl_init_internal instead of _dl_init. * sysdeps/arm/dl-machine.h: Likewise. * sysdeps/cris/dl-machine.h: Likewise. * sysdeps/hppa/dl-machine.h: Likewise. * sysdeps/i386/dl-machine.h: Likewise. * sysdeps/ia64/dl-machine.h: Likewise. * sysdeps/m68k/dl-machine.h: Likewise. * sysdeps/mips/dl-machine.h: Likewise. * sysdeps/mips/mips64/dl-machine.h: Likewise. * sysdeps/s390/s390-32/dl-machine.h: Likewise. * sysdeps/s390/s390-64/dl-machine.h: Likewise. * sysdeps/sh/dl-machine.h: Likewise. * sysdeps/sparc/sparc32/dl-machine.h: Likewise. * sysdeps/sparc/sparc64/dl-machine.h: Likewise. * sysdeps/x86_64/dl-machine.h: Likewise. * sysdeps/powerpc/dl-start.S (_dl_start_user): Likewise. * elf/Versions: Don't export _dl_check_all_versions, _dl_sysdep_start, and _dl_debug_initialize.
This commit is contained in:
51
ChangeLog
51
ChangeLog
@ -1,5 +1,56 @@
|
|||||||
2002-02-02 Ulrich Drepper <drepper@redhat.com>
|
2002-02-02 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
Change ld.so to not use functions which are exported. One cannot
|
||||||
|
interpose them anyway. Use INT() to mark uses, INTDEF() to mark
|
||||||
|
definitions.
|
||||||
|
* include/libc-symbols.h: Define INT and INTDEF.
|
||||||
|
* sysdeps/generic/ldsodefs.h: Declare _dl_debug_printf_internal,
|
||||||
|
_dl_signal_error_internal, _dl_map_object_internal,
|
||||||
|
_dl_map_object_deps_internal, _dl_lookup_symbol_internal,
|
||||||
|
_dl_lookup_versioned_symbol_internal,
|
||||||
|
_dl_relocate_object_internal, _dl_debug_state_internal,
|
||||||
|
_dl_start_profile_internal, and _dl_unload_cache_internal.
|
||||||
|
* include/dlfcn.h: Declare _dl_catch_error_internal.
|
||||||
|
* elf/rtld.c: Use INT for calls to any of the *_internal functions
|
||||||
|
above. Add INTDEF to function definitions.
|
||||||
|
* elf/dl-debug.c: Likewise.
|
||||||
|
* 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-open.c: Likewise.
|
||||||
|
* elf/dl-profile.c: Likewise.
|
||||||
|
* elf/dl-reloc.c: Likewise.
|
||||||
|
* elf/dl-runtime.c: Likewise.
|
||||||
|
* elf/dl-version.c: Likewise.
|
||||||
|
* elf/do-lookup.h: Likewise.
|
||||||
|
* sysdeps/generic/dl-cache.c: Likewise.
|
||||||
|
* sysdeps/generic/dl-sysdep.c: Likewise.
|
||||||
|
* sysdeps/alpha/dl-machine.h (RTLD_START): Call _dl_init_internal
|
||||||
|
instead of _dl_init.
|
||||||
|
* sysdeps/arm/dl-machine.h: Likewise.
|
||||||
|
* sysdeps/cris/dl-machine.h: Likewise.
|
||||||
|
* sysdeps/hppa/dl-machine.h: Likewise.
|
||||||
|
* sysdeps/i386/dl-machine.h: Likewise.
|
||||||
|
* sysdeps/ia64/dl-machine.h: Likewise.
|
||||||
|
* sysdeps/m68k/dl-machine.h: Likewise.
|
||||||
|
* sysdeps/mips/dl-machine.h: Likewise.
|
||||||
|
* sysdeps/mips/mips64/dl-machine.h: Likewise.
|
||||||
|
* sysdeps/s390/s390-32/dl-machine.h: Likewise.
|
||||||
|
* sysdeps/s390/s390-64/dl-machine.h: Likewise.
|
||||||
|
* sysdeps/sh/dl-machine.h: Likewise.
|
||||||
|
* sysdeps/sparc/sparc32/dl-machine.h: Likewise.
|
||||||
|
* sysdeps/sparc/sparc64/dl-machine.h: Likewise.
|
||||||
|
* sysdeps/x86_64/dl-machine.h: Likewise.
|
||||||
|
* sysdeps/powerpc/dl-start.S (_dl_start_user): Likewise.
|
||||||
|
|
||||||
|
* elf/Versions: Don't export _dl_check_all_versions, _dl_sysdep_start,
|
||||||
|
and _dl_debug_initialize.
|
||||||
|
|
||||||
* elf/dl-object.c (_dl_new_object): Avoid using strrchr. We have
|
* elf/dl-object.c (_dl_new_object): Avoid using strrchr. We have
|
||||||
more information.
|
more information.
|
||||||
* elf/rtld.c (dl_main): Avoid strrchr.
|
* elf/rtld.c (dl_main): Avoid strrchr.
|
||||||
|
@ -38,13 +38,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_stack_end;
|
__libc_enable_secure; __libc_stack_end;
|
||||||
_dl_argv; _dl_catch_error; _dl_check_all_versions; _dl_check_map_versions;
|
_dl_argv; _dl_catch_error; _dl_check_map_versions;
|
||||||
_dl_debug_initialize; _dl_debug_printf; _dl_debug_state; _dl_dst_count;
|
_dl_debug_printf; _dl_debug_state; _dl_dst_count;
|
||||||
_dl_dst_substitute; _dl_init; _dl_lookup_symbol; _dl_lookup_symbol_skip;
|
_dl_dst_substitute; _dl_init; _dl_lookup_symbol; _dl_lookup_symbol_skip;
|
||||||
_dl_lookup_versioned_symbol; _dl_lookup_versioned_symbol_skip;
|
_dl_lookup_versioned_symbol; _dl_lookup_versioned_symbol_skip;
|
||||||
_dl_map_object; _dl_map_object_deps; _dl_out_of_memory;
|
_dl_map_object; _dl_map_object_deps; _dl_out_of_memory;
|
||||||
_dl_relocate_object; _dl_signal_error; _dl_start_profile; _dl_starting_up;
|
_dl_relocate_object; _dl_signal_error; _dl_start_profile; _dl_starting_up;
|
||||||
_dl_sysdep_start; _dl_unload_cache;
|
_dl_unload_cache;
|
||||||
_rtld_global;
|
_rtld_global;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,3 +55,4 @@ void
|
|||||||
_dl_debug_state (void)
|
_dl_debug_state (void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
INTDEF (_dl_debug_state)
|
||||||
|
@ -59,10 +59,10 @@ openaux (void *a)
|
|||||||
{
|
{
|
||||||
struct openaux_args *args = (struct openaux_args *) a;
|
struct openaux_args *args = (struct openaux_args *) a;
|
||||||
|
|
||||||
args->aux = _dl_map_object (args->map, args->name, 0,
|
args->aux = INT(_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, 0);
|
args->trace_mode, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ptrdiff_t
|
static ptrdiff_t
|
||||||
@ -107,28 +107,28 @@ struct list
|
|||||||
\
|
\
|
||||||
/* DST must not appear in SUID/SGID programs. */ \
|
/* DST must not appear in SUID/SGID programs. */ \
|
||||||
if (__libc_enable_secure) \
|
if (__libc_enable_secure) \
|
||||||
_dl_signal_error (0, __str, NULL, \
|
INT(_dl_signal_error) (0, __str, NULL, \
|
||||||
N_("DST not allowed in SUID/SGID programs")); \
|
N_("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 = DL_DST_SUBSTITUTE (l, __str, __newp, 0); \
|
__result = INT(_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) \
|
||||||
_dl_signal_error (0, __str, NULL, N_("\
|
INT(_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 (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0)) \
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0)) \
|
||||||
_dl_debug_printf ("cannot load auxiliary `%s' because of" \
|
INT(_dl_debug_printf) (N_("\
|
||||||
"empty dynamic string token " \
|
cannot load auxiliary `%s' because of empty dynamic string token " \
|
||||||
"substitution\n", __str); \
|
"substitution\n"), __str); \
|
||||||
continue; \
|
continue; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
@ -239,7 +239,8 @@ _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 = _dl_catch_error (&objname, &errstring, openaux, &args);
|
err = INT(_dl_catch_error) (&objname, &errstring, openaux,
|
||||||
|
&args);
|
||||||
if (__builtin_expect (errstring != NULL, 0))
|
if (__builtin_expect (errstring != NULL, 0))
|
||||||
{
|
{
|
||||||
if (err)
|
if (err)
|
||||||
@ -290,15 +291,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 (GL(dl_debug_mask) & DL_DEBUG_LIBS,
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS,
|
||||||
0))
|
0))
|
||||||
_dl_debug_printf ("load auxiliary object=%s"
|
INT(_dl_debug_printf) ("load auxiliary object=%s"
|
||||||
" requested by file=%s\n", name,
|
" requested by file=%s\n", name,
|
||||||
l->l_name[0]
|
l->l_name[0]
|
||||||
? l->l_name : _dl_argv[0]);
|
? l->l_name : _dl_argv[0]);
|
||||||
|
|
||||||
/* 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 = _dl_catch_error (&objname, &errstring, openaux,
|
err = INT(_dl_catch_error) (&objname, &errstring, 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. */
|
||||||
@ -317,14 +318,14 @@ _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 (GL(dl_debug_mask) & DL_DEBUG_LIBS,
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS,
|
||||||
0))
|
0))
|
||||||
_dl_debug_printf ("load filtered object=%s"
|
INT(_dl_debug_printf) ("load filtered object=%s"
|
||||||
" requested by file=%s\n", name,
|
" requested by file=%s\n", name,
|
||||||
l->l_name[0]
|
l->l_name[0]
|
||||||
? l->l_name : _dl_argv[0]);
|
? l->l_name : _dl_argv[0]);
|
||||||
|
|
||||||
/* For filter objects the dependency must be available. */
|
/* For filter objects the dependency must be available. */
|
||||||
err = _dl_catch_error (&objname, &errstring, openaux,
|
err = INT(_dl_catch_error) (&objname, &errstring, openaux,
|
||||||
&args);
|
&args);
|
||||||
if (__builtin_expect (errstring != NULL, 0))
|
if (__builtin_expect (errstring != NULL, 0))
|
||||||
{
|
{
|
||||||
if (err)
|
if (err)
|
||||||
@ -452,8 +453,8 @@ _dl_map_object_deps (struct link_map *map,
|
|||||||
l->l_initfini = (struct link_map **)
|
l->l_initfini = (struct link_map **)
|
||||||
malloc ((nneeded + 1) * sizeof needed[0]);
|
malloc ((nneeded + 1) * sizeof needed[0]);
|
||||||
if (l->l_initfini == NULL)
|
if (l->l_initfini == NULL)
|
||||||
_dl_signal_error (ENOMEM, map->l_name, NULL,
|
INT(_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]);
|
||||||
}
|
}
|
||||||
@ -483,8 +484,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)
|
||||||
_dl_signal_error (ENOMEM, map->l_name, NULL,
|
INT(_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];
|
||||||
@ -524,7 +525,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. */
|
||||||
_dl_signal_error (EINVAL, l->l_name, NULL, N_("\
|
INT(_dl_signal_error) (EINVAL, l->l_name, NULL, N_("\
|
||||||
Filters not supported with LD_TRACE_PRELINKING"));
|
Filters not supported with LD_TRACE_PRELINKING"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -538,8 +539,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)
|
||||||
_dl_signal_error (ENOMEM, map->l_name, NULL,
|
INT(_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);
|
||||||
@ -618,6 +619,7 @@ Filters not supported with LD_TRACE_PRELINKING"));
|
|||||||
map->l_initfini[nlist] = NULL;
|
map->l_initfini[nlist] = NULL;
|
||||||
|
|
||||||
if (errno_reason)
|
if (errno_reason)
|
||||||
_dl_signal_error (errno_reason == -1 ? 0 : errno_reason,
|
INT(_dl_signal_error) (errno_reason == -1 ? 0 : errno_reason, objname,
|
||||||
objname, NULL, errstring);
|
NULL, errstring);
|
||||||
}
|
}
|
||||||
|
INTDEF (_dl_map_object_deps)
|
||||||
|
10
elf/dl-dst.h
10
elf/dl-dst.h
@ -25,12 +25,13 @@
|
|||||||
const char *__sf = strchr (name, '$'); \
|
const char *__sf = strchr (name, '$'); \
|
||||||
\
|
\
|
||||||
if (__builtin_expect (__sf != NULL, 0)) \
|
if (__builtin_expect (__sf != NULL, 0)) \
|
||||||
__cnt = _dl_dst_count (__sf, is_path); \
|
__cnt = INT(_dl_dst_count) (__sf, is_path); \
|
||||||
\
|
\
|
||||||
__cnt; })
|
__cnt; })
|
||||||
|
|
||||||
/* Prototype for used function. */
|
/* Prototype for used function. */
|
||||||
extern size_t _dl_dst_count (const char *name, int is_path);
|
extern size_t _dl_dst_count (const char *name, int is_path);
|
||||||
|
extern size_t _dl_dst_count_internal (const char *name, int is_path);
|
||||||
|
|
||||||
|
|
||||||
/* Guess from the number of DSTs the length of the result string. */
|
/* Guess from the number of DSTs the length of the result string. */
|
||||||
@ -62,11 +63,8 @@ extern size_t _dl_dst_count (const char *name, int is_path);
|
|||||||
/* Find origin of the executable. */
|
/* Find origin of the executable. */
|
||||||
extern const char *_dl_get_origin (void);
|
extern const char *_dl_get_origin (void);
|
||||||
|
|
||||||
|
|
||||||
/* Perform the DST substitution. */
|
|
||||||
#define DL_DST_SUBSTITUTE(l, name, res, is_path) \
|
|
||||||
_dl_dst_substitute (l, name, res, is_path)
|
|
||||||
|
|
||||||
/* Prototype for used function. */
|
/* Prototype for used function. */
|
||||||
extern char *_dl_dst_substitute (struct link_map *l, const char *name,
|
extern char *_dl_dst_substitute (struct link_map *l, const char *name,
|
||||||
char *result, int is_path);
|
char *result, int is_path);
|
||||||
|
extern char *_dl_dst_substitute_internal (struct link_map *l, const char *name,
|
||||||
|
char *result, int is_path);
|
||||||
|
@ -110,6 +110,7 @@ _dl_signal_error (int errcode, const char *objname, const char *occation,
|
|||||||
: ""));
|
: ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
INTDEF (_dl_signal_error)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -125,7 +126,7 @@ _dl_signal_cerror (int errcode, const char *objname, const char *occation,
|
|||||||
(*receiver) (errcode, objname, errstring);
|
(*receiver) (errcode, objname, errstring);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_dl_signal_error (errcode, objname, occation, errstring);
|
INT(_dl_signal_error) (errcode, objname, occation, errstring);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -162,6 +163,8 @@ _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
|
||||||
internal_function
|
internal_function
|
||||||
|
@ -147,8 +147,8 @@ _dl_fini (void)
|
|||||||
|
|
||||||
/* When debugging print a message first. */
|
/* When debugging print a message first. */
|
||||||
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
||||||
_dl_debug_printf ("\ncalling fini: %s\n\n",
|
INT(_dl_debug_printf) ("\ncalling fini: %s\n\n",
|
||||||
l->l_name[0] ? l->l_name : _dl_argv[0]);
|
l->l_name[0] ? l->l_name : _dl_argv[0]);
|
||||||
|
|
||||||
/* 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)
|
||||||
|
@ -51,8 +51,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 (GL(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
||||||
_dl_debug_printf ("\ncalling init: %s\n\n",
|
INT(_dl_debug_printf) ("\ncalling init: %s\n\n",
|
||||||
l->l_name[0] ? l->l_name : _dl_argv[0]);
|
l->l_name[0] ? l->l_name : _dl_argv[0]);
|
||||||
|
|
||||||
/* 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
|
||||||
@ -106,9 +106,9 @@ _dl_init (struct link_map *main_map, int argc, char **argv, char **env)
|
|||||||
unsigned int cnt;
|
unsigned int cnt;
|
||||||
|
|
||||||
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
|
||||||
_dl_debug_printf ("\ncalling preinit: %s\n\n",
|
INT(_dl_debug_printf) ("\ncalling preinit: %s\n\n",
|
||||||
main_map->l_name[0]
|
main_map->l_name[0]
|
||||||
? main_map->l_name : _dl_argv[0]);
|
? main_map->l_name : _dl_argv[0]);
|
||||||
|
|
||||||
addrs = (ElfW(Addr) *) (main_map->l_info[DT_PREINIT_ARRAY]->d_un.d_ptr
|
addrs = (ElfW(Addr) *) (main_map->l_info[DT_PREINIT_ARRAY]->d_un.d_ptr
|
||||||
+ main_map->l_addr);
|
+ main_map->l_addr);
|
||||||
@ -121,7 +121,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;
|
||||||
_dl_debug_state ();
|
INT(_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
|
||||||
@ -139,8 +139,9 @@ _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;
|
||||||
_dl_debug_state ();
|
INT(_dl_debug_state) ();
|
||||||
|
|
||||||
/* Finished starting up. */
|
/* Finished starting up. */
|
||||||
_dl_starting_up = 0;
|
_dl_starting_up = 0;
|
||||||
}
|
}
|
||||||
|
INTDEF (_dl_init)
|
||||||
|
@ -212,6 +212,7 @@ _dl_dst_count (const char *name, int is_path)
|
|||||||
|
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
INTDEF (_dl_dst_count)
|
||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
@ -273,6 +274,7 @@ _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
|
||||||
@ -306,7 +308,7 @@ expand_dynamic_string_token (struct link_map *l, const char *s)
|
|||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return DL_DST_SUBSTITUTE (l, s, result, 1);
|
return INT(_dl_dst_substitute) (l, s, result, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -332,7 +334,8 @@ add_name_to_object (struct link_map *l, const char *name)
|
|||||||
if (newname == NULL)
|
if (newname == NULL)
|
||||||
{
|
{
|
||||||
/* No more memory. */
|
/* No more memory. */
|
||||||
_dl_signal_error (ENOMEM, name, NULL, N_("cannot allocate name record"));
|
INT(_dl_signal_error) (ENOMEM, name, NULL,
|
||||||
|
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. */
|
||||||
@ -433,8 +436,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)
|
||||||
_dl_signal_error (ENOMEM, NULL, NULL,
|
INT(_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));
|
||||||
@ -509,7 +512,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:
|
||||||
_dl_signal_error (ENOMEM, NULL, NULL, errstring);
|
INT(_dl_signal_error) (ENOMEM, NULL, NULL, errstring);
|
||||||
}
|
}
|
||||||
|
|
||||||
result[0] = NULL;
|
result[0] = NULL;
|
||||||
@ -584,7 +587,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:
|
||||||
_dl_signal_error (ENOMEM, NULL, NULL, errstring);
|
INT(_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
|
||||||
@ -749,7 +752,7 @@ lose (int code, int fd, const char *name, char *realname, struct link_map *l,
|
|||||||
free (l);
|
free (l);
|
||||||
}
|
}
|
||||||
free (realname);
|
free (realname);
|
||||||
_dl_signal_error (code, name, NULL, msg);
|
INT(_dl_signal_error) (code, name, NULL, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -808,7 +811,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
|
|||||||
|
|
||||||
/* Print debugging message. */
|
/* Print debugging message. */
|
||||||
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
||||||
_dl_debug_printf ("file=%s; generating link map\n", name);
|
INT(_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;
|
||||||
@ -821,8 +824,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);
|
||||||
_dl_signal_error (errno, NULL, NULL,
|
INT(_dl_signal_error) (errno, NULL, NULL,
|
||||||
N_("cannot open zero fill device"));
|
N_("cannot open zero fill device"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1107,14 +1110,19 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
|
|||||||
l->l_entry += l->l_addr;
|
l->l_entry += l->l_addr;
|
||||||
|
|
||||||
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
||||||
_dl_debug_printf (" dynamic: 0x%0*lx base: 0x%0*lx size: 0x%0*Zx\n"
|
INT(_dl_debug_printf) ("\
|
||||||
" entry: 0x%0*lx phdr: 0x%0*lx phnum: %*u\n\n",
|
dynamic: 0x%0*lx base: 0x%0*lx size: 0x%0*Zx\n\
|
||||||
(int) sizeof (void *) * 2, (unsigned long int) l->l_ld,
|
entry: 0x%0*lx phdr: 0x%0*lx phnum: %*u\n\n",
|
||||||
(int) sizeof (void *) * 2, (unsigned long int) l->l_addr,
|
(int) sizeof (void *) * 2,
|
||||||
(int) sizeof (void *) * 2, maplength,
|
(unsigned long int) l->l_ld,
|
||||||
(int) sizeof (void *) * 2, (unsigned long int) l->l_entry,
|
(int) sizeof (void *) * 2,
|
||||||
(int) sizeof (void *) * 2, (unsigned long int) l->l_phdr,
|
(unsigned long int) l->l_addr,
|
||||||
(int) sizeof (void *) * 2, l->l_phnum);
|
(int) sizeof (void *) * 2, maplength,
|
||||||
|
(int) sizeof (void *) * 2,
|
||||||
|
(unsigned long int) l->l_entry,
|
||||||
|
(int) sizeof (void *) * 2,
|
||||||
|
(unsigned long int) l->l_phdr,
|
||||||
|
(int) sizeof (void *) * 2, l->l_phnum);
|
||||||
|
|
||||||
elf_get_dynamic_info (l);
|
elf_get_dynamic_info (l);
|
||||||
|
|
||||||
@ -1189,7 +1197,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;
|
||||||
|
|
||||||
_dl_debug_printf (" search path=");
|
INT(_dl_debug_printf) (" search path=");
|
||||||
|
|
||||||
while (*list != NULL && (*list)->what == what) /* Yes, ==. */
|
while (*list != NULL && (*list)->what == what) /* Yes, ==. */
|
||||||
{
|
{
|
||||||
@ -1460,7 +1468,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 (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0))
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0))
|
||||||
_dl_debug_printf (" trying file=%s\n", buf);
|
INT(_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)
|
||||||
@ -1592,9 +1600,10 @@ _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 (GL(dl_debug_mask) & DL_DEBUG_FILES, 0) && loader != NULL)
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_FILES, 0)
|
||||||
_dl_debug_printf ("\nfile=%s; needed by %s\n", name,
|
&& loader != NULL)
|
||||||
loader->l_name[0] ? loader->l_name : _dl_argv[0]);
|
INT(_dl_debug_printf) ("\nfile=%s; needed by %s\n", name,
|
||||||
|
loader->l_name[0] ? loader->l_name : _dl_argv[0]);
|
||||||
|
|
||||||
if (strchr (name, '/') == NULL)
|
if (strchr (name, '/') == NULL)
|
||||||
{
|
{
|
||||||
@ -1603,7 +1612,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 (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0))
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0))
|
||||||
_dl_debug_printf ("find library=%s; searching\n", name);
|
INT(_dl_debug_printf) ("find library=%s; searching\n", name);
|
||||||
|
|
||||||
fd = -1;
|
fd = -1;
|
||||||
|
|
||||||
@ -1752,7 +1761,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
|
|||||||
|
|
||||||
/* Add another newline when we a tracing the library loading. */
|
/* Add another newline when we a tracing the library loading. */
|
||||||
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0))
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0))
|
||||||
_dl_debug_printf ("\n");
|
INT(_dl_debug_printf) ("\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1784,8 +1793,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)
|
||||||
_dl_signal_error (ENOMEM, name, NULL,
|
INT(_dl_signal_error) (ENOMEM, name, NULL, N_("\
|
||||||
N_("cannot create shared object descriptor"));
|
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
|
||||||
@ -1798,9 +1807,10 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
|
|||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_dl_signal_error (errno, name, NULL,
|
INT(_dl_signal_error) (errno, name, NULL,
|
||||||
N_("cannot open shared object file"));
|
N_("cannot open shared object file"));
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
INTDEF (_dl_map_object)
|
||||||
|
@ -168,11 +168,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 (GL(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
||||||
_dl_debug_printf ("\
|
INT(_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 : _dl_argv[0],
|
map->l_name[0] ? map->l_name : _dl_argv[0],
|
||||||
undef_map->l_name[0]
|
undef_map->l_name[0]
|
||||||
? undef_map->l_name : _dl_argv[0]);
|
? undef_map->l_name : _dl_argv[0]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
/* Whoa, that was bad luck. We have to search again. */
|
/* Whoa, that was bad luck. We have to search again. */
|
||||||
@ -203,8 +203,9 @@ static void
|
|||||||
internal_function
|
internal_function
|
||||||
_dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
|
_dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
|
||||||
const ElfW(Sym) **ref, struct r_scope_elem *symbol_scope[],
|
const ElfW(Sym) **ref, struct r_scope_elem *symbol_scope[],
|
||||||
struct sym_val *value, const struct r_found_version *version,
|
struct sym_val *value,
|
||||||
int type_class, int protected);
|
const struct r_found_version *version, int type_class,
|
||||||
|
int protected);
|
||||||
|
|
||||||
/* Search loaded objects' symbol tables for a definition of the symbol
|
/* Search loaded objects' symbol tables for a definition of the symbol
|
||||||
UNDEF_NAME. */
|
UNDEF_NAME. */
|
||||||
@ -239,8 +240,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 _dl_lookup_symbol (undef_name, undef_map, ref, symbol_scope,
|
return INT(_dl_lookup_symbol) (undef_name, undef_map, ref,
|
||||||
type_class, 0);
|
symbol_scope, type_class, 0);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -288,6 +289,7 @@ _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,9 +402,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 _dl_lookup_versioned_symbol (undef_name, undef_map, ref,
|
return INT(_dl_lookup_versioned_symbol) (undef_name, undef_map,
|
||||||
symbol_scope, version,
|
ref, symbol_scope,
|
||||||
type_class, 0);
|
version, type_class, 0);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -478,6 +480,7 @@ _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
|
||||||
@ -597,12 +600,14 @@ _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
|
|||||||
|
|
||||||
if (GL(dl_debug_mask) & DL_DEBUG_BINDINGS)
|
if (GL(dl_debug_mask) & DL_DEBUG_BINDINGS)
|
||||||
{
|
{
|
||||||
_dl_debug_printf ("binding file %s to %s: %s symbol `%s'",
|
INT(_dl_debug_printf) ("binding file %s to %s: %s symbol `%s'",
|
||||||
(reference_name[0]
|
(reference_name[0]
|
||||||
? reference_name : (_dl_argv[0] ?: "<main program>")),
|
? reference_name
|
||||||
value->m->l_name[0] ? value->m->l_name : _dl_argv[0],
|
: (_dl_argv[0] ?: "<main program>")),
|
||||||
protected ? "protected" : "normal",
|
value->m->l_name[0]
|
||||||
undef_name);
|
? value->m->l_name : _dl_argv[0],
|
||||||
|
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
|
||||||
|
@ -249,6 +249,7 @@ _dl_debug_printf (const char *fmt, ...)
|
|||||||
_dl_debug_vdprintf (GL(dl_debug_fd), 1, fmt, arg);
|
_dl_debug_vdprintf (GL(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. */
|
||||||
|
@ -40,9 +40,6 @@ extern ElfW(Addr) _dl_sysdep_start (void **start_argptr,
|
|||||||
ElfW(Addr) *user_entry));
|
ElfW(Addr) *user_entry));
|
||||||
weak_extern (BP_SYM (_dl_sysdep_start))
|
weak_extern (BP_SYM (_dl_sysdep_start))
|
||||||
|
|
||||||
/* This function is used to unload the cache file if necessary. */
|
|
||||||
extern void _dl_unload_cache (void);
|
|
||||||
|
|
||||||
extern int __libc_multiple_libcs; /* Defined in init-first.c. */
|
extern int __libc_multiple_libcs; /* Defined in init-first.c. */
|
||||||
|
|
||||||
extern int __libc_argc;
|
extern int __libc_argc;
|
||||||
@ -200,7 +197,7 @@ dl_open_worker (void *a)
|
|||||||
new_file = (char *) alloca (required + 1);
|
new_file = (char *) alloca (required + 1);
|
||||||
|
|
||||||
/* Generate the new file name. */
|
/* Generate the new file name. */
|
||||||
DL_DST_SUBSTITUTE (call_map, file, new_file, 0);
|
_dl_dst_substitute (call_map, file, new_file, 0);
|
||||||
|
|
||||||
/* 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')
|
||||||
@ -374,10 +371,11 @@ dl_open_worker (void *a)
|
|||||||
if (__builtin_expect (mode & RTLD_NODELETE, 0))
|
if (__builtin_expect (mode & RTLD_NODELETE, 0))
|
||||||
new->l_flags_1 |= DF_1_NODELETE;
|
new->l_flags_1 |= DF_1_NODELETE;
|
||||||
|
|
||||||
if (_dl_sysdep_start == NULL)
|
#ifndef SHARED
|
||||||
/* We must be the static _dl_open in libc.a. A static program that
|
/* We must be the static _dl_open in libc.a. A static program that
|
||||||
has loaded a dynamic object now has competition. */
|
has loaded a dynamic object now has competition. */
|
||||||
__libc_multiple_libcs = 1;
|
__libc_multiple_libcs = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Let the user know about the opencount. */
|
/* Let the user know about the opencount. */
|
||||||
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
||||||
|
@ -430,6 +430,7 @@ _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
|
||||||
|
@ -87,7 +87,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:
|
||||||
_dl_signal_error (errno, l->l_name, NULL, errstring);
|
INT(_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
|
||||||
@ -126,11 +126,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 \
|
||||||
? _dl_lookup_versioned_symbol (strtab + (*ref)->st_name, \
|
? INT(_dl_lookup_versioned_symbol) (strtab \
|
||||||
l, (ref), scope, \
|
+ (*ref)->st_name, \
|
||||||
(version), _tc, 0) \
|
l, (ref), scope, \
|
||||||
: _dl_lookup_symbol (strtab + (*ref)->st_name, l, (ref), \
|
(version), _tc, 0) \
|
||||||
scope, _tc, 0)); \
|
: INT(_dl_lookup_symbol) (strtab + (*ref)->st_name, l, \
|
||||||
|
(ref), scope, _tc, 0)); \
|
||||||
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)
|
||||||
@ -146,11 +147,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 \
|
||||||
? _dl_lookup_versioned_symbol (strtab + (*ref)->st_name, \
|
? INT(_dl_lookup_versioned_symbol) (strtab \
|
||||||
l, (ref), scope, \
|
+ (*ref)->st_name, \
|
||||||
(version), _tc, 0) \
|
l, (ref), scope, \
|
||||||
: _dl_lookup_symbol (strtab + (*ref)->st_name, l, (ref), \
|
(version), _tc, 0) \
|
||||||
scope, _tc, 0)); \
|
: INT(_dl_lookup_symbol) (strtab + (*ref)->st_name, l, \
|
||||||
|
(ref), scope, _tc, 0)); \
|
||||||
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)
|
||||||
@ -201,6 +203,7 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
|
|||||||
textrels = textrels->next;
|
textrels = textrels->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
INTDEF (_dl_relocate_object)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -220,5 +223,5 @@ _dl_reloc_bad_type (struct link_map *map, unsigned int type, int plt)
|
|||||||
*cp++ = DIGIT (type >> 4);
|
*cp++ = DIGIT (type >> 4);
|
||||||
*cp = DIGIT (type);
|
*cp = DIGIT (type);
|
||||||
|
|
||||||
_dl_signal_error (0, map->l_name, NULL, msgbuf);
|
INT(_dl_signal_error) (0, map->l_name, NULL, msgbuf);
|
||||||
}
|
}
|
||||||
|
@ -87,16 +87,18 @@ fixup (
|
|||||||
|
|
||||||
if (version->hash != 0)
|
if (version->hash != 0)
|
||||||
{
|
{
|
||||||
result = _dl_lookup_versioned_symbol (strtab + sym->st_name,
|
result = INT(_dl_lookup_versioned_symbol) (strtab
|
||||||
l, &sym, l->l_scope,
|
+ sym->st_name,
|
||||||
version,
|
l, &sym, l->l_scope,
|
||||||
ELF_RTYPE_CLASS_PLT, 0);
|
version,
|
||||||
|
ELF_RTYPE_CLASS_PLT,
|
||||||
|
0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case 0:
|
case 0:
|
||||||
result = _dl_lookup_symbol (strtab + sym->st_name, l, &sym,
|
result = INT(_dl_lookup_symbol) (strtab + sym->st_name, l, &sym,
|
||||||
l->l_scope, ELF_RTYPE_CLASS_PLT, 0);
|
l->l_scope, ELF_RTYPE_CLASS_PLT, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Currently result contains the base load address (or link map)
|
/* Currently result contains the base load address (or link map)
|
||||||
@ -179,17 +181,20 @@ profile_fixup (
|
|||||||
|
|
||||||
if (version->hash != 0)
|
if (version->hash != 0)
|
||||||
{
|
{
|
||||||
result = _dl_lookup_versioned_symbol(strtab + sym->st_name,
|
result = INT(_dl_lookup_versioned_symbol) (strtab
|
||||||
l, &sym, l->l_scope,
|
+ sym->st_name,
|
||||||
version,
|
l, &sym,
|
||||||
ELF_RTYPE_CLASS_PLT,
|
l->l_scope,
|
||||||
0);
|
version,
|
||||||
|
ELF_RTYPE_CLASS_PLT,
|
||||||
|
0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case 0:
|
case 0:
|
||||||
result = _dl_lookup_symbol (strtab + sym->st_name, l, &sym,
|
result = INT(_dl_lookup_symbol) (strtab + sym->st_name, l, &sym,
|
||||||
l->l_scope, ELF_RTYPE_CLASS_PLT, 0);
|
l->l_scope, ELF_RTYPE_CLASS_PLT,
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Currently result contains the base load address (or link map)
|
/* Currently result contains the base load address (or link map)
|
||||||
|
@ -87,10 +87,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 (GL(dl_debug_mask) & DL_DEBUG_VERSIONS, 0))
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_VERSIONS, 0))
|
||||||
_dl_debug_printf ("\
|
INT(_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 : _dl_argv[0], name);
|
? map->l_name : _dl_argv[0], name);
|
||||||
|
|
||||||
if (__builtin_expect (map->l_info[VERSYMIDX (DT_VERDEF)] == NULL, 0))
|
if (__builtin_expect (map->l_info[VERSYMIDX (DT_VERDEF)] == NULL, 0))
|
||||||
{
|
{
|
||||||
@ -214,9 +214,9 @@ _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:
|
||||||
_dl_signal_error (errval, (*map->l_name
|
INT(_dl_signal_error) (errval, (*map->l_name
|
||||||
? map->l_name : _dl_argv[0]),
|
? map->l_name : _dl_argv[0]),
|
||||||
NULL, errstring);
|
NULL, errstring);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
@ -374,6 +374,7 @@ _dl_check_map_versions (struct link_map *map, int verbose, int trace_mode)
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
INTDEF (_dl_check_map_versions)
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -384,7 +385,8 @@ _dl_check_all_versions (struct link_map *map, int verbose, int trace_mode)
|
|||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
for (l = map; l != NULL; l = l->l_next)
|
for (l = map; l != NULL; l = l->l_next)
|
||||||
result |= ! l->l_faked && _dl_check_map_versions (l, verbose, trace_mode);
|
result |= (! l->l_faked
|
||||||
|
&& INT(_dl_check_map_versions) (l, verbose, trace_mode));
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -61,8 +61,8 @@ 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 (GL(dl_debug_mask) & DL_DEBUG_SYMBOLS, 0))
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_SYMBOLS, 0))
|
||||||
_dl_debug_printf ("symbol=%s; lookup in file=%s\n", undef_name,
|
INT(_dl_debug_printf) ("symbol=%s; lookup in file=%s\n", undef_name,
|
||||||
map->l_name[0] ? map->l_name : _dl_argv[0]);
|
map->l_name[0] ? map->l_name : _dl_argv[0]);
|
||||||
|
|
||||||
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]);
|
||||||
|
71
elf/rtld.c
71
elf/rtld.c
@ -297,15 +297,14 @@ relocate_doit (void *a)
|
|||||||
{
|
{
|
||||||
struct relocate_args *args = (struct relocate_args *) a;
|
struct relocate_args *args = (struct relocate_args *) a;
|
||||||
|
|
||||||
_dl_relocate_object (args->l, args->l->l_scope,
|
INT(_dl_relocate_object) (args->l, args->l->l_scope, args->lazy, 0);
|
||||||
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->main_map = _dl_map_object (NULL, args->str, 0, lt_library, 0, 0);
|
args->main_map = INT(_dl_map_object) (NULL, args->str, 0, lt_library, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -495,7 +494,7 @@ of this helper program; chances are you did not intend to run this program.\n\
|
|||||||
struct map_args args;
|
struct map_args args;
|
||||||
|
|
||||||
args.str = _dl_argv[0];
|
args.str = _dl_argv[0];
|
||||||
(void) _dl_catch_error (&objname, &err_str, map_doit, &args);
|
(void) INT(_dl_catch_error) (&objname, &err_str, map_doit, &args);
|
||||||
if (__builtin_expect (err_str != NULL, 0))
|
if (__builtin_expect (err_str != NULL, 0))
|
||||||
{
|
{
|
||||||
if (err_str != _dl_out_of_memory)
|
if (err_str != _dl_out_of_memory)
|
||||||
@ -506,7 +505,7 @@ 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);
|
||||||
_dl_map_object (NULL, _dl_argv[0], 0, lt_library, 0, 0);
|
INT(_dl_map_object) (NULL, _dl_argv[0], 0, lt_library, 0, 0);
|
||||||
HP_TIMING_NOW (stop);
|
HP_TIMING_NOW (stop);
|
||||||
|
|
||||||
HP_TIMING_DIFF (load_time, start, stop);
|
HP_TIMING_DIFF (load_time, start, stop);
|
||||||
@ -703,8 +702,9 @@ of this helper program; chances are you did not intend to run this program.\n\
|
|||||||
&& (__builtin_expect (! __libc_enable_secure, 1)
|
&& (__builtin_expect (! __libc_enable_secure, 1)
|
||||||
|| strchr (p, '/') == NULL))
|
|| strchr (p, '/') == NULL))
|
||||||
{
|
{
|
||||||
struct link_map *new_map = _dl_map_object (GL(dl_loaded), p, 1,
|
struct link_map *new_map = INT(_dl_map_object) (GL(dl_loaded), p,
|
||||||
lt_library, 0, 0);
|
1, 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;
|
||||||
@ -771,8 +771,10 @@ of this helper program; chances are you did not intend to run this program.\n\
|
|||||||
while ((p = strsep (&runp, ": \t\n")) != NULL)
|
while ((p = strsep (&runp, ": \t\n")) != NULL)
|
||||||
if (p[0] != '\0')
|
if (p[0] != '\0')
|
||||||
{
|
{
|
||||||
struct link_map *new_map = _dl_map_object (GL(dl_loaded), p, 1,
|
struct link_map *new_map = INT(_dl_map_object) (GL(dl_loaded),
|
||||||
lt_library, 0, 0);
|
p, 1,
|
||||||
|
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;
|
||||||
@ -782,8 +784,8 @@ of this helper program; chances are you did not intend to run this program.\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 = _dl_map_object (GL(dl_loaded), p, 1,
|
struct link_map *new_map = INT(_dl_map_object) (GL(dl_loaded), 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;
|
||||||
@ -816,7 +818,7 @@ of this helper program; chances are you did not intend to run this program.\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);
|
||||||
_dl_map_object_deps (GL(dl_loaded), preloads, npreloads, mode == trace);
|
INT(_dl_map_object_deps) (GL(dl_loaded), preloads, npreloads, mode == trace);
|
||||||
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);
|
||||||
@ -938,9 +940,9 @@ of this helper program; chances are you did not intend to run this program.\n\
|
|||||||
ElfW(Addr) loadbase;
|
ElfW(Addr) loadbase;
|
||||||
lookup_t result;
|
lookup_t result;
|
||||||
|
|
||||||
result = _dl_lookup_symbol (_dl_argv[i], GL(dl_loaded),
|
result = INT(_dl_lookup_symbol) (_dl_argv[i], 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);
|
||||||
|
|
||||||
@ -976,8 +978,8 @@ of this helper program; chances are you did not intend to run this program.\n\
|
|||||||
|
|
||||||
if ((GL(dl_debug_mask) & DL_DEBUG_PRELINK)
|
if ((GL(dl_debug_mask) & DL_DEBUG_PRELINK)
|
||||||
&& GL(dl_rtld_map).l_opencount > 1)
|
&& GL(dl_rtld_map).l_opencount > 1)
|
||||||
_dl_relocate_object (&GL(dl_rtld_map), GL(dl_loaded)->l_scope,
|
INT(_dl_relocate_object) (&GL(dl_rtld_map),
|
||||||
0, 0);
|
GL(dl_loaded)->l_scope, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define VERNEEDTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (DT_VERNEED))
|
#define VERNEEDTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (DT_VERNEED))
|
||||||
@ -1174,7 +1176,8 @@ of this helper program; chances are you did not intend to run this program.\n\
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (l != &GL(dl_rtld_map))
|
if (l != &GL(dl_rtld_map))
|
||||||
_dl_relocate_object (l, l->l_scope, GL(dl_lazy), consider_profiling);
|
INT(_dl_relocate_object) (l, l->l_scope, GL(dl_lazy),
|
||||||
|
consider_profiling);
|
||||||
|
|
||||||
l = l->l_prev;
|
l = l->l_prev;
|
||||||
}
|
}
|
||||||
@ -1196,14 +1199,15 @@ of this helper program; chances are you did not intend to run this program.\n\
|
|||||||
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. */
|
||||||
_dl_start_profile (GL(dl_profile_map), GL(dl_profile_output));
|
INT(_dl_start_profile) (GL(dl_profile_map), GL(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);
|
||||||
_dl_relocate_object (&GL(dl_rtld_map), GL(dl_loaded)->l_scope, 0, 0);
|
INT(_dl_relocate_object) (&GL(dl_rtld_map), GL(dl_loaded)->l_scope,
|
||||||
|
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);
|
||||||
@ -1248,12 +1252,12 @@ of this helper program; chances are you did not intend to run this program.\n\
|
|||||||
|
|
||||||
/* 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;
|
||||||
_dl_debug_state ();
|
INT(_dl_debug_state) ();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef MAP_COPY
|
#ifndef MAP_COPY
|
||||||
/* We must munmap() the cache file. */
|
/* We must munmap() the cache file. */
|
||||||
_dl_unload_cache ();
|
INT(_dl_unload_cache) ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Once we return, _dl_sysdep_start will invoke
|
/* Once we return, _dl_sysdep_start will invoke
|
||||||
@ -1593,8 +1597,9 @@ print_statistics (void)
|
|||||||
if (HP_TIMING_AVAIL)
|
if (HP_TIMING_AVAIL)
|
||||||
{
|
{
|
||||||
HP_TIMING_PRINT (buf, sizeof (buf), rtld_total_time);
|
HP_TIMING_PRINT (buf, sizeof (buf), rtld_total_time);
|
||||||
_dl_debug_printf ("\nruntime linker statistics:\n"
|
INT(_dl_debug_printf) ("\nruntime linker statistics:\n"
|
||||||
" total startup time in dynamic loader: %s\n", buf);
|
" total startup time in dynamic loader: %s\n",
|
||||||
|
buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print relocation statistics. */
|
/* Print relocation statistics. */
|
||||||
@ -1616,14 +1621,15 @@ print_statistics (void)
|
|||||||
*wp++ = *cp++;
|
*wp++ = *cp++;
|
||||||
}
|
}
|
||||||
*wp = '\0';
|
*wp = '\0';
|
||||||
_dl_debug_printf (" time needed for relocation: %s (%s%%)\n",
|
INT(_dl_debug_printf) ("\
|
||||||
buf, pbuf);
|
time needed for relocation: %s (%s%%)\n",
|
||||||
|
buf, pbuf);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
_dl_debug_printf (" number of relocations: %lu\n",
|
INT(_dl_debug_printf) (" number of relocations: %lu\n",
|
||||||
GL(dl_num_relocations));
|
GL(dl_num_relocations));
|
||||||
_dl_debug_printf (" number of relocations from cache: %lu\n",
|
INT(_dl_debug_printf) (" number of relocations from cache: %lu\n",
|
||||||
GL(dl_num_cache_relocations));
|
GL(dl_num_cache_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. */
|
||||||
@ -1645,8 +1651,9 @@ print_statistics (void)
|
|||||||
*wp++ = *cp++;
|
*wp++ = *cp++;
|
||||||
}
|
}
|
||||||
*wp = '\0';
|
*wp = '\0';
|
||||||
_dl_debug_printf (" time needed to load objects: %s (%s%%)\n",
|
INT(_dl_debug_printf) ("\
|
||||||
buf, pbuf);
|
time needed to load objects: %s (%s%%)\n",
|
||||||
|
buf, pbuf);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,10 @@ 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
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* Support macros for making weak and strong aliases for symbols,
|
/* Support macros for making weak and strong aliases for symbols,
|
||||||
and for using symbol sets and linker warnings with GNU ld.
|
and for using symbol sets and linker warnings with GNU ld.
|
||||||
Copyright (C) 1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc.
|
Copyright (C) 1995-1998,2000,2001,2002 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
|
||||||
@ -226,7 +226,7 @@
|
|||||||
The native aix linker will remove the .stab and .stabstr sections
|
The native aix linker will remove the .stab and .stabstr sections
|
||||||
The gnu linker will have a fatal error if there is a relocation for
|
The gnu linker will have a fatal error if there is a relocation for
|
||||||
symbol in the .stab section. Silently disable this macro. */
|
symbol in the .stab section. Silently disable this macro. */
|
||||||
# define link_warning(symbol, msg)
|
# define link_warning(symbol, msg)
|
||||||
# else
|
# else
|
||||||
# define link_warning(symbol, msg) \
|
# define link_warning(symbol, msg) \
|
||||||
asm (".stabs \"" msg "\",30,0,0,0\n\t" \
|
asm (".stabs \"" msg "\",30,0,0,0\n\t" \
|
||||||
@ -298,9 +298,9 @@
|
|||||||
The native aix linker will remove the .stab and .stabstr sections
|
The native aix linker will remove the .stab and .stabstr sections
|
||||||
The gnu linker will have a fatal error if there is a relocation for
|
The gnu linker will have a fatal error if there is a relocation for
|
||||||
symbol in the .stab section. Silently disable these macros. */
|
symbol in the .stab section. Silently disable these macros. */
|
||||||
# define text_set_element(set, symbol)
|
# define text_set_element(set, symbol)
|
||||||
# define data_set_element(set, symbol)
|
# define data_set_element(set, symbol)
|
||||||
# define bss_set_element(set, symbol)
|
# define bss_set_element(set, symbol)
|
||||||
# else
|
# else
|
||||||
# define text_set_element(set, symbol) \
|
# define text_set_element(set, symbol) \
|
||||||
asm (".stabs \"" __SYMBOL_PREFIX #set "\",23,0,0," __SYMBOL_PREFIX #symbol)
|
asm (".stabs \"" __SYMBOL_PREFIX #set "\",23,0,0," __SYMBOL_PREFIX #symbol)
|
||||||
@ -349,4 +349,14 @@
|
|||||||
strong_alias(real, name)
|
strong_alias(real, name)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Handling on non-exported internal names. We have to do this only
|
||||||
|
for shared code. */
|
||||||
|
#ifdef SHARED
|
||||||
|
# define INT(name) name##_internal
|
||||||
|
# define INTDEF(name) strong_alias (name, name##_internal);
|
||||||
|
#else
|
||||||
|
# define INT(name) name
|
||||||
|
# define INTDEF(name)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* libc-symbols.h */
|
#endif /* libc-symbols.h */
|
||||||
|
@ -333,7 +333,7 @@ $fixup_stack_ret: \n\
|
|||||||
lda $18, 8($sp) \n\
|
lda $18, 8($sp) \n\
|
||||||
s8addq $17, 8, $19 \n\
|
s8addq $17, 8, $19 \n\
|
||||||
addq $19, $18, $19 \n\
|
addq $19, $18, $19 \n\
|
||||||
jsr $26, _dl_init \n\
|
jsr $26, _dl_init_internal \n\
|
||||||
/* Pass our finalizer function to the user in $0. */ \n\
|
/* Pass our finalizer function to the user in $0. */ \n\
|
||||||
lda $0, _dl_fini \n\
|
lda $0, _dl_fini \n\
|
||||||
/* Jump to the user's entry point. */ \n\
|
/* Jump to the user's entry point. */ \n\
|
||||||
|
@ -302,7 +302,7 @@ _dl_start_user:
|
|||||||
ldr r0, [sl, r0]
|
ldr r0, [sl, r0]
|
||||||
ldr r0, [r0]
|
ldr r0, [r0]
|
||||||
@ call _dl_init
|
@ call _dl_init
|
||||||
bl _dl_init(PLT)
|
bl _dl_init_internal(PLT)
|
||||||
@ clear the startup flag
|
@ clear the startup flag
|
||||||
ldr r2, .L_STARTUP_FLAG
|
ldr r2, .L_STARTUP_FLAG
|
||||||
ldr r1, [sl, r2]
|
ldr r1, [sl, r2]
|
||||||
|
@ -214,7 +214,7 @@ _dl_start_user:
|
|||||||
; main_map: at _dl_loaded.
|
; main_map: at _dl_loaded.
|
||||||
move.d [$r0+_rtld_global:GOT16],$r9
|
move.d [$r0+_rtld_global:GOT16],$r9
|
||||||
move.d [$r9],$r10
|
move.d [$r9],$r10
|
||||||
move.d _dl_init:PLTG,$r9
|
move.d _dl_init_internal:PLTG,$r9
|
||||||
add.d $r0,$r9
|
add.d $r0,$r9
|
||||||
jsr $r9
|
jsr $r9
|
||||||
; Pass our finalizer function to the user in R10.
|
; Pass our finalizer function to the user in R10.
|
||||||
|
@ -149,7 +149,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 (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0))
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0))
|
||||||
_dl_debug_printf (" search cache=%s\n", LD_SO_CACHE);
|
INT(_dl_debug_printf) (" search cache=%s\n", LD_SO_CACHE);
|
||||||
|
|
||||||
if (cache == NULL)
|
if (cache == NULL)
|
||||||
{
|
{
|
||||||
@ -251,7 +251,7 @@ _dl_load_cache_lookup (const char *name)
|
|||||||
|
|
||||||
/* Print our result if wanted. */
|
/* Print our result if wanted. */
|
||||||
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0) && best != NULL)
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0) && best != NULL)
|
||||||
_dl_debug_printf (" trying file=%s\n", best);
|
INT(_dl_debug_printf) (" trying file=%s\n", best);
|
||||||
|
|
||||||
return best;
|
return best;
|
||||||
}
|
}
|
||||||
@ -270,4 +270,5 @@ _dl_unload_cache (void)
|
|||||||
cache = NULL;
|
cache = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
INTDEF (_dl_unload_cache)
|
||||||
#endif
|
#endif
|
||||||
|
@ -298,8 +298,8 @@ _dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz,
|
|||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
{
|
{
|
||||||
no_memory:
|
no_memory:
|
||||||
_dl_signal_error (ENOMEM, NULL, NULL,
|
INT(_dl_signal_error) (ENOMEM, NULL, NULL,
|
||||||
N_("cannot create capability list"));
|
N_("cannot create capability list"));
|
||||||
}
|
}
|
||||||
|
|
||||||
result[0].str = (char *) result; /* Does not really matter. */
|
result[0].str = (char *) result; /* Does not really matter. */
|
||||||
|
@ -352,6 +352,8 @@ extern int _dl_sysdep_open_zero_fill (void); /* dl-sysdep.c */
|
|||||||
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)));
|
||||||
|
extern void _dl_debug_printf_internal (const char *fmt, ...)
|
||||||
|
__attribute__ ((__format__ (__printf__, 1, 2)));
|
||||||
|
|
||||||
/* 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
|
||||||
@ -395,6 +397,11 @@ extern void _dl_signal_error (int errcode, const char *object,
|
|||||||
const char *occurred, const char *errstring)
|
const char *occurred, const char *errstring)
|
||||||
internal_function
|
internal_function
|
||||||
__attribute__ ((__noreturn__));
|
__attribute__ ((__noreturn__));
|
||||||
|
extern void _dl_signal_error_internal (int errcode, const char *object,
|
||||||
|
const char *occurred,
|
||||||
|
const char *errstring)
|
||||||
|
internal_function
|
||||||
|
__attribute__ ((__noreturn__));
|
||||||
|
|
||||||
/* 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
|
||||||
_dl_receive_error. */
|
_dl_receive_error. */
|
||||||
@ -420,6 +427,12 @@ 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;
|
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;
|
||||||
|
|
||||||
/* Call _dl_map_object on the dependencies of MAP, and set up
|
/* Call _dl_map_object on the dependencies of MAP, and set up
|
||||||
MAP->l_searchlist. PRELOADS points to a vector of NPRELOADS previously
|
MAP->l_searchlist. PRELOADS points to a vector of NPRELOADS previously
|
||||||
@ -429,6 +442,11 @@ 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)
|
||||||
internal_function;
|
internal_function;
|
||||||
|
extern void _dl_map_object_deps_internal (struct link_map *map,
|
||||||
|
struct link_map **preloads,
|
||||||
|
unsigned int npreloads,
|
||||||
|
int trace_mode)
|
||||||
|
internal_function;
|
||||||
|
|
||||||
/* Cache the locations of MAP's hash table. */
|
/* Cache the locations of MAP's hash table. */
|
||||||
extern void _dl_setup_hash (struct link_map *map) internal_function;
|
extern void _dl_setup_hash (struct link_map *map) internal_function;
|
||||||
@ -449,6 +467,12 @@ extern lookup_t _dl_lookup_symbol (const char *undef,
|
|||||||
struct r_scope_elem *symbol_scope[],
|
struct r_scope_elem *symbol_scope[],
|
||||||
int type_class, int explicit)
|
int type_class, int explicit)
|
||||||
internal_function;
|
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 *symbol_scope[],
|
||||||
|
int type_class, int explicit)
|
||||||
|
internal_function;
|
||||||
|
|
||||||
/* Lookup versioned symbol. */
|
/* Lookup versioned symbol. */
|
||||||
extern lookup_t _dl_lookup_versioned_symbol (const char *undef,
|
extern lookup_t _dl_lookup_versioned_symbol (const char *undef,
|
||||||
@ -458,6 +482,14 @@ extern lookup_t _dl_lookup_versioned_symbol (const char *undef,
|
|||||||
const struct r_found_version *version,
|
const struct r_found_version *version,
|
||||||
int type_class, int explicit)
|
int type_class, int explicit)
|
||||||
internal_function;
|
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;
|
||||||
|
|
||||||
/* For handling RTLD_NEXT we must be able to skip shared objects. */
|
/* For handling RTLD_NEXT we must be able to skip shared objects. */
|
||||||
extern lookup_t _dl_lookup_symbol_skip (const char *undef,
|
extern lookup_t _dl_lookup_symbol_skip (const char *undef,
|
||||||
@ -493,6 +525,9 @@ extern struct link_map *_dl_new_object (char *realname, const char *libname,
|
|||||||
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);
|
||||||
|
|
||||||
/* Call _dl_signal_error with a message about an unhandled reloc type.
|
/* Call _dl_signal_error with a message about an unhandled reloc type.
|
||||||
TYPE is the result of ELFW(R_TYPE) (r_info), i.e. an R_<CPU>_* value.
|
TYPE is the result of ELFW(R_TYPE) (r_info), i.e. an R_<CPU>_* value.
|
||||||
@ -532,6 +567,7 @@ extern void _dl_fini (void) internal_function;
|
|||||||
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);
|
||||||
|
extern void _dl_debug_state_internal (void);
|
||||||
|
|
||||||
/* 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
|
||||||
@ -546,6 +582,9 @@ extern void _dl_init_paths (const char *library_path) internal_function;
|
|||||||
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;
|
internal_function;
|
||||||
|
extern void _dl_start_profile_internal (struct link_map *map,
|
||||||
|
const char *output_dir)
|
||||||
|
internal_function;
|
||||||
|
|
||||||
/* The actual functions used to keep book on the calls. */
|
/* The actual functions used to keep book on the calls. */
|
||||||
extern void _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc);
|
extern void _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc);
|
||||||
@ -579,6 +618,7 @@ extern const char *_dl_load_cache_lookup (const char *name)
|
|||||||
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);
|
||||||
|
extern void _dl_unload_cache_internal (void);
|
||||||
|
|
||||||
/* 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
|
||||||
|
@ -372,7 +372,7 @@ asm ( \
|
|||||||
\
|
\
|
||||||
/* envp = argv + argc + 1 */ \
|
/* envp = argv + argc + 1 */ \
|
||||||
" sh2add %r25,%r24,%r23\n" \
|
" sh2add %r25,%r24,%r23\n" \
|
||||||
" bl _dl_init,%r2\n" \
|
" bl _dl_init_internal,%r2\n" \
|
||||||
" ldo 4(%r23),%r23\n" /* delay slot */ \
|
" ldo 4(%r23),%r23\n" /* delay slot */ \
|
||||||
\
|
\
|
||||||
/* Reload argc, argv to the registers start.S expects them in (feh) */ \
|
/* Reload argc, argv to the registers start.S expects them in (feh) */ \
|
||||||
|
@ -243,7 +243,7 @@ _dl_start_user:\n\
|
|||||||
pushl %eax\n\
|
pushl %eax\n\
|
||||||
movl (%esi), %eax\n\
|
movl (%esi), %eax\n\
|
||||||
# Call the function to run the initializers.\n\
|
# Call the function to run the initializers.\n\
|
||||||
call _dl_init@PLT\n\
|
call _dl_init_internal@PLT\n\
|
||||||
# Pass our finalizer function to the user in %edx, as per ELF ABI.\n\
|
# Pass our finalizer function to the user in %edx, as per ELF ABI.\n\
|
||||||
movl _dl_fini@GOT(%ebx), %edx\n\
|
movl _dl_fini@GOT(%ebx), %edx\n\
|
||||||
# Jump to the user's entry point.\n\
|
# Jump to the user's entry point.\n\
|
||||||
|
@ -402,7 +402,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
|
|||||||
" { .mmb\n" \
|
" { .mmb\n" \
|
||||||
" ld8 out0 = [out0] /* get the linkmap */\n" \
|
" ld8 out0 = [out0] /* get the linkmap */\n" \
|
||||||
" st8 [r2] = r17 /* Load the new _dl_argv. */\n" \
|
" st8 [r2] = r17 /* Load the new _dl_argv. */\n" \
|
||||||
" br.call.sptk.many b0 = _dl_init#\n" \
|
" br.call.sptk.many b0 = _dl_init_internal#\n" \
|
||||||
" ;;\n" \
|
" ;;\n" \
|
||||||
" }\n" \
|
" }\n" \
|
||||||
" /* Pass our finializer function to the user,\n" \
|
" /* Pass our finializer function to the user,\n" \
|
||||||
|
@ -177,7 +177,7 @@ _dl_start_user:\n\
|
|||||||
pea 8(%sp)\n\
|
pea 8(%sp)\n\
|
||||||
move.l %d1, -(%sp)\n\
|
move.l %d1, -(%sp)\n\
|
||||||
move.l ([_rtld_global@GOT.w, %a5]), -(%sp)\n\
|
move.l ([_rtld_global@GOT.w, %a5]), -(%sp)\n\
|
||||||
jbsr _dl_init@PLTPC\n\
|
jbsr _dl_init_internal@PLTPC\n\
|
||||||
addq.l #8, %sp\n\
|
addq.l #8, %sp\n\
|
||||||
addq.l #8, %sp\n\
|
addq.l #8, %sp\n\
|
||||||
| Pass our finalizer function to the user in %a1.\n\
|
| Pass our finalizer function to the user in %a1.\n\
|
||||||
|
@ -449,7 +449,7 @@ _dl_start_user:\n\
|
|||||||
addu $7, $7, 4\n\
|
addu $7, $7, 4\n\
|
||||||
subu $29, 16\n\
|
subu $29, 16\n\
|
||||||
# Call the function to run the initializers.\n\
|
# Call the function to run the initializers.\n\
|
||||||
jal _dl_init
|
jal _dl_init_internal\n\
|
||||||
addiu $29, 16\n\
|
addiu $29, 16\n\
|
||||||
# Pass our finalizer function to the user in $2 as per ELF ABI.\n\
|
# Pass our finalizer function to the user in $2 as per ELF ABI.\n\
|
||||||
la $2, _dl_fini\n\
|
la $2, _dl_fini\n\
|
||||||
|
@ -486,7 +486,7 @@ _dl_start_user:\n\
|
|||||||
dla $7, 8($29)\n\
|
dla $7, 8($29)\n\
|
||||||
dsubu $29, 16\n\
|
dsubu $29, 16\n\
|
||||||
# Call the function to run the initializers.\n\
|
# Call the function to run the initializers.\n\
|
||||||
jal _dl_init
|
jal _dl_init_internal\n\
|
||||||
daddiu $29, 16\n\
|
daddiu $29, 16\n\
|
||||||
# Pass our finalizer function to the user in ra.\n\
|
# Pass our finalizer function to the user in ra.\n\
|
||||||
dla $31, _dl_fini\n\
|
dla $31, _dl_fini\n\
|
||||||
@ -498,7 +498,7 @@ _dl_start_user:\n\
|
|||||||
la $7, 8($29)\n\
|
la $7, 8($29)\n\
|
||||||
subu $29, 16\n\
|
subu $29, 16\n\
|
||||||
# Call the function to run the initializers.\n\
|
# Call the function to run the initializers.\n\
|
||||||
jal _dl_init
|
jal _dl_init_internal\n\
|
||||||
addiu $29, 16\n\
|
addiu $29, 16\n\
|
||||||
# Pass our finalizer function to the user in ra.\n\
|
# Pass our finalizer function to the user in ra.\n\
|
||||||
dla $31, _dl_fini\n\
|
dla $31, _dl_fini\n\
|
||||||
|
@ -63,7 +63,7 @@ ENTRY(_dl_start_user)
|
|||||||
slwi r6,r4,2
|
slwi r6,r4,2
|
||||||
add r6,r5,r6
|
add r6,r5,r6
|
||||||
addi r6,r6,4
|
addi r6,r6,4
|
||||||
bl _dl_init@local
|
bl _dl_init_internal@local
|
||||||
|
|
||||||
/* Now, to conform to the ELF ABI, we have to: */
|
/* Now, to conform to the ELF ABI, we have to: */
|
||||||
/* Pass argc (actually _dl_argc) in r3; */
|
/* Pass argc (actually _dl_argc) in r3; */
|
||||||
|
@ -305,7 +305,7 @@ _dl_start_user:\n\
|
|||||||
.Llit:\n\
|
.Llit:\n\
|
||||||
.Ladr0: .long _GLOBAL_OFFSET_TABLE_-.Llit\n\
|
.Ladr0: .long _GLOBAL_OFFSET_TABLE_-.Llit\n\
|
||||||
.Ladr1: .long _dl_start-.Llit\n\
|
.Ladr1: .long _dl_start-.Llit\n\
|
||||||
.Ladr4: .long _dl_init@PLT-.Llit\n\
|
.Ladr4: .long _dl_init_internal@PLT-.Llit\n\
|
||||||
");
|
");
|
||||||
|
|
||||||
#ifndef RTLD_START_SPECIAL_INIT
|
#ifndef RTLD_START_SPECIAL_INIT
|
||||||
|
@ -270,7 +270,7 @@ _dl_start_user:\n\
|
|||||||
lgr %r5,%r3\n\
|
lgr %r5,%r3\n\
|
||||||
sllg %r5,%r5,3\n\
|
sllg %r5,%r5,3\n\
|
||||||
la %r5,176(%r5,%r15)\n\
|
la %r5,176(%r5,%r15)\n\
|
||||||
brasl %r14,_dl_init@PLT\n
|
brasl %r14,_dl_init_internal@PLT\n
|
||||||
# Pass our finalizer function to the user in %r14, as per ELF ABI.\n\
|
# Pass our finalizer function to the user in %r14, as per ELF ABI.\n\
|
||||||
lghi %r14,_dl_fini@GOT
|
lghi %r14,_dl_fini@GOT
|
||||||
lg %r14,0(%r14,%r12)\n\
|
lg %r14,0(%r14,%r12)\n\
|
||||||
|
@ -386,7 +386,7 @@ _dl_start_user:\n\
|
|||||||
.L_dl_skip_args:\n\
|
.L_dl_skip_args:\n\
|
||||||
.long _dl_skip_args@GOT\n\
|
.long _dl_skip_args@GOT\n\
|
||||||
.L_dl_init:\n\
|
.L_dl_init:\n\
|
||||||
.long _dl_init@PLT\n\
|
.long _dl_init_internal@PLT\n\
|
||||||
.L_dl_loaded:\n\
|
.L_dl_loaded:\n\
|
||||||
.long _rtld_global@GOT\n\
|
.long _rtld_global@GOT\n\
|
||||||
.L_dl_starting_up:\n\
|
.L_dl_starting_up:\n\
|
||||||
|
@ -320,7 +320,7 @@ _dl_start_user:
|
|||||||
add %o3, 4, %o3
|
add %o3, 4, %o3
|
||||||
mov %i5, %o1
|
mov %i5, %o1
|
||||||
add %o2, %o3, %o3
|
add %o2, %o3, %o3
|
||||||
call _dl_init
|
call _dl_init_internal
|
||||||
ld [%o0], %o0
|
ld [%o0], %o0
|
||||||
/* Pass our finalizer function to the user in %g1. */
|
/* Pass our finalizer function to the user in %g1. */
|
||||||
sethi %hi(_dl_fini), %g1
|
sethi %hi(_dl_fini), %g1
|
||||||
|
@ -753,7 +753,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
|
|||||||
" add %o3, 8, %o3\n" \
|
" add %o3, 8, %o3\n" \
|
||||||
" mov %i5, %o1\n" \
|
" mov %i5, %o1\n" \
|
||||||
" add %o2, %o3, %o3\n" \
|
" add %o2, %o3, %o3\n" \
|
||||||
" call _dl_init\n" \
|
" call _dl_init_internal\n" \
|
||||||
" ldx [%o0], %o0\n" \
|
" ldx [%o0], %o0\n" \
|
||||||
" /* Pass our finalizer function to the user in %g1. */\n" \
|
" /* Pass our finalizer function to the user in %g1. */\n" \
|
||||||
" sethi %hi(_dl_fini), %g1\n" \
|
" sethi %hi(_dl_fini), %g1\n" \
|
||||||
|
@ -257,7 +257,7 @@ _dl_start_user:\n\
|
|||||||
# argv -> rdx\n\
|
# argv -> rdx\n\
|
||||||
leaq 8(%rsp), %rdx\n\
|
leaq 8(%rsp), %rdx\n\
|
||||||
# Call the function to run the initializers.\n\
|
# Call the function to run the initializers.\n\
|
||||||
call _dl_init@PLT\n\
|
call _dl_init_internal@PLT\n\
|
||||||
# Pass our finalizer function to the user in %rdx, as per ELF ABI.\n\
|
# Pass our finalizer function to the user in %rdx, as per ELF ABI.\n\
|
||||||
movq _dl_fini@GOTPCREL(%rip), %rdx\n\
|
movq _dl_fini@GOTPCREL(%rip), %rdx\n\
|
||||||
# Jump to the user's entry point.\n\
|
# Jump to the user's entry point.\n\
|
||||||
|
Reference in New Issue
Block a user