1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
* sysdeps/arm/dl-machine.h: Likewise.
	* sysdeps/hppa/dl-machine.h: Likewise.
	* sysdeps/m68k/dl-machine.h: Likewise.
	* sysdeps/powerpc/dl-machine.h: Likewise.
	* sysdeps/s390/dl-machine.h: Likewise.
	* sysdeps/sh/dl-machine.h: Likewise.
This commit is contained in:
Ulrich Drepper
2001-02-28 06:36:10 +00:00
parent b5ba065963
commit 35fc382add
28 changed files with 216 additions and 305 deletions

View File

@ -28,6 +28,12 @@
* sysdeps/generic/dl-sysdep.c: Likewise. * sysdeps/generic/dl-sysdep.c: Likewise.
* sysdeps/generic/libc-start.c: Likewise. * sysdeps/generic/libc-start.c: Likewise.
* sysdeps/i386/dl-machine.h: Likewise. * sysdeps/i386/dl-machine.h: Likewise.
* sysdeps/arm/dl-machine.h: Likewise.
* sysdeps/hppa/dl-machine.h: Likewise.
* sysdeps/m68k/dl-machine.h: Likewise.
* sysdeps/powerpc/dl-machine.h: Likewise.
* sysdeps/s390/dl-machine.h: Likewise.
* sysdeps/sh/dl-machine.h: Likewise.
* sysdeps/unix/sysv/linux/dl-osinfo.h: Likewise. * sysdeps/unix/sysv/linux/dl-osinfo.h: Likewise.
* sysdeps/unix/sysv/linux/i386/dl-librecon.h: Likewise. * sysdeps/unix/sysv/linux/i386/dl-librecon.h: Likewise.
* sysdeps/unix/sysv/linux/i386/dl-procinfo.h: Likewise. * sysdeps/unix/sysv/linux/i386/dl-procinfo.h: Likewise.

View File

@ -27,8 +27,6 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <stdio-common/_itoa.h>
/* Type of the constructor functions. */ /* Type of the constructor functions. */
typedef void (*fini_t) (void); typedef void (*fini_t) (void);
@ -76,11 +74,8 @@ _dl_close (void *_map)
buf[sizeof buf - 1] = '\0'; buf[sizeof buf - 1] = '\0';
_dl_debug_message (1, "\nclosing file=", map->l_name, _dl_debug_printf ("\nclosing file=%s; opencount == %u\n",
"; opencount == ", map->l_name, map->l_opencount);
_itoa_word (map->l_opencount,
buf + sizeof buf - 1, 10, 0),
"\n", NULL);
} }
/* One decrement the object itself, not the dependencies. */ /* One decrement the object itself, not the dependencies. */
@ -134,10 +129,8 @@ _dl_close (void *_map)
&& imap->l_init_called) && imap->l_init_called)
{ {
/* When debugging print a message first. */ /* When debugging print a message first. */
if (//__builtin_expect (_dl_debug_impcalls, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0))
__builtin_expect (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0)) _dl_debug_printf ("\ncalling fini: %s\n\n", imap->l_name);
_dl_debug_message (1, "\ncalling fini: ", imap->l_name,
"\n\n", NULL);
/* Call its termination function. */ /* Call its termination function. */
if (imap->l_info[DT_FINI_ARRAY] != NULL) if (imap->l_info[DT_FINI_ARRAY] != NULL)

View File

@ -121,9 +121,9 @@ empty dynamics string token substitution")); \
{ \ { \
/* This is for DT_AUXILIARY. */ \ /* This is for DT_AUXILIARY. */ \
if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0)) \ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0)) \
_dl_debug_message (1, "cannot load auxiliary `", __str, \ _dl_debug_printf ("cannot load auxiliary `%s' because of" \
"' because of empty dynamic string" \ "empty dynamic string token " \
" token substitution\n", NULL); \ "substitution\n", __str); \
continue; \ continue; \
} \ } \
} \ } \
@ -294,11 +294,10 @@ _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 (_dl_debug_mask & DL_DEBUG_LIBS, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0))
_dl_debug_message (1, "load auxiliary object=", _dl_debug_printf ("load auxiliary object=%s"
name, " requested by file=", " 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]);
"\n", NULL);
/* We must be prepared that the addressed shared /* We must be prepared that the addressed shared
object is not available. */ object is not available. */
@ -317,11 +316,10 @@ _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 (_dl_debug_mask & DL_DEBUG_LIBS, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0))
_dl_debug_message (1, "load filtered object=", name, _dl_debug_printf ("load filtered object=%s"
" requested by file=", " 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]);
"\n", NULL);
/* For filter objects the dependency must be available. */ /* For filter objects the dependency must be available. */
if (_dl_catch_error (&objname, &errstring, openaux, &args)) if (_dl_catch_error (&objname, &errstring, openaux, &args))

View File

@ -1,5 +1,5 @@
/* Error handling for runtime dynamic linker. /* Error handling for runtime dynamic linker.
Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc. Copyright (C) 1995,96,97,98,99,2000,2001 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
@ -97,13 +97,14 @@ _dl_signal_error (int errcode, const char *objname, const char *errstring)
{ {
/* Lossage while resolving the program's own symbols is always fatal. */ /* Lossage while resolving the program's own symbols is always fatal. */
char buffer[1024]; char buffer[1024];
_dl_sysdep_fatal (_dl_argv[0] ?: "<program name unknown>", _dl_fatal_printf ("\
": error while loading shared libraries: ", %s: error while loading shared libraries: %s%s%s%s%s\n",
_dl_argv[0] ?: "<program name unknown>",
objname ?: "", objname && *objname ? ": " : "", objname ?: "", objname && *objname ? ": " : "",
errstring, errcode ? ": " : "", errstring, errcode ? ": " : "",
(errcode (errcode
? __strerror_r (errcode, buffer, sizeof buffer) ? __strerror_r (errcode, buffer, sizeof buffer)
: ""), "\n", NULL); : ""));
} }
} }
@ -143,7 +144,7 @@ _dl_catch_error (const char **objname, const char **errstring,
old = tsd_getspecific (); old = tsd_getspecific ();
errcode = setjmp (c.env); errcode = setjmp (c.env);
if (errcode == 0) if (__builtin_expect (errcode, 0) == 0)
{ {
tsd_setspecific (&c); tsd_setspecific (&c);
(*operate) (args); (*operate) (args);

View File

@ -147,9 +147,8 @@ _dl_fini (void)
/* When debugging print a message first. */ /* When debugging print a message first. */
if (__builtin_expect (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0))
_dl_debug_message (1, "\ncalling fini: ", _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]);
"\n\n", NULL);
/* 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)

View File

@ -54,8 +54,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 (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0))
_dl_debug_message (1, "\ncalling init: ", _dl_debug_printf ("\ncalling init: %s\n\n",
l->l_name[0] ? l->l_name : _dl_argv[0], "\n\n", NULL); 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
@ -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 (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0))
_dl_debug_message (1, "\ncalling preinit: ", _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], "\n\n", NULL); ? 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);

View File

@ -30,7 +30,6 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include "dynamic-link.h" #include "dynamic-link.h"
#include <stdio-common/_itoa.h>
#include <dl-dst.h> #include <dl-dst.h>
@ -802,7 +801,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
/* Print debugging message. */ /* Print debugging message. */
if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0))
_dl_debug_message (1, "file=", name, "; generating link map\n", NULL); _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;
@ -1060,34 +1059,14 @@ _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 (_dl_debug_mask & DL_DEBUG_FILES, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0))
{ _dl_debug_printf (" dynamic: 0x%0*lx base: 0x%0*lx size: 0x%0*Zx\n"
const size_t nibbles = sizeof (void *) * 2; " entry: 0x%0*lx phdr: 0x%0*lx phnum: %*u\n\n",
char buf1[nibbles + 1]; sizeof (void *) * 2, (unsigned long int) l->l_ld,
char buf2[nibbles + 1]; sizeof (void *) * 2, (unsigned long int) l->l_addr,
char buf3[nibbles + 1]; sizeof (void *) * 2, maplength,
sizeof (void *) * 2, (unsigned long int) l->l_entry,
buf1[nibbles] = '\0'; sizeof (void *) * 2, (unsigned long int) l->l_phdr,
buf2[nibbles] = '\0'; sizeof (void *) * 2, l->l_phnum);
buf3[nibbles] = '\0';
memset (buf1, '0', nibbles);
memset (buf2, '0', nibbles);
memset (buf3, '0', nibbles);
_itoa_word ((unsigned long int) l->l_ld, &buf1[nibbles], 16, 0);
_itoa_word ((unsigned long int) l->l_addr, &buf2[nibbles], 16, 0);
_itoa_word (maplength, &buf3[nibbles], 16, 0);
_dl_debug_message (1, " dynamic: 0x", buf1, " base: 0x", buf2,
" size: 0x", buf3, "\n", NULL);
memset (buf1, '0', nibbles);
memset (buf2, '0', nibbles);
memset (buf3, ' ', nibbles);
_itoa_word ((unsigned long int) l->l_entry, &buf1[nibbles], 16, 0);
_itoa_word ((unsigned long int) l->l_phdr, &buf2[nibbles], 16, 0);
_itoa_word (l->l_phnum, &buf3[nibbles], 10, 0);
_dl_debug_message (1, " entry: 0x", buf1, " phdr: 0x", buf2,
" phnum: ", buf3, "\n\n", NULL);
}
elf_get_dynamic_info (l); elf_get_dynamic_info (l);
@ -1172,7 +1151,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_message (1, " search path=", NULL); _dl_debug_printf (" search path=");
while (*list != NULL && (*list)->what == what) /* Yes, ==. */ while (*list != NULL && (*list)->what == what) /* Yes, ==. */
{ {
@ -1187,18 +1166,23 @@ print_search_path (struct r_search_path_elem **list,
cp[0] = '\0'; cp[0] = '\0';
else else
cp[-1] = '\0'; cp[-1] = '\0';
_dl_debug_message (0, first ? "" : ":", buf, NULL); if (first)
{
_dl_debug_printf_c ("%s", buf);
first = 0; first = 0;
} }
else
_dl_debug_printf_c (":%s", buf);
}
++list; ++list;
} }
if (name != NULL) if (name != NULL)
_dl_debug_message (0, "\t\t(", what, " from file ", _dl_debug_printf_c ("\t\t(%s from file %s)\n", what,
name[0] ? name : _dl_argv[0], ")\n", NULL); name[0] ? name : _dl_argv[0]);
else else
_dl_debug_message (0, "\t\t(", what, ")\n", NULL); _dl_debug_printf_c ("\t\t(%s)\n", what);
} }
/* Open a file and verify it is an ELF file for this architecture. We /* Open a file and verify it is an ELF file for this architecture. We
@ -1373,7 +1357,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 (_dl_debug_mask & DL_DEBUG_LIBS, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0))
_dl_debug_message (1, " trying file=", buf, "\n", NULL); _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)
@ -1507,9 +1491,8 @@ _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 (_dl_debug_mask & DL_DEBUG_FILES, 0) && loader != NULL) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0) && loader != NULL)
_dl_debug_message (1, "\nfile=", name, "; needed by ", _dl_debug_printf ("\nfile=%s; needed by %s\n", name,
loader->l_name[0] ? loader->l_name : _dl_argv[0], loader->l_name[0] ? loader->l_name : _dl_argv[0]);
"\n", NULL);
if (strchr (name, '/') == NULL) if (strchr (name, '/') == NULL)
{ {
@ -1518,7 +1501,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 (_dl_debug_mask & DL_DEBUG_LIBS, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0))
_dl_debug_message (1, "find library=", name, "; searching\n", NULL); _dl_debug_printf ("find library=%s; searching\n", name);
fd = -1; fd = -1;
@ -1655,7 +1638,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 (_dl_debug_mask & DL_DEBUG_LIBS, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0))
_dl_debug_message (1, "\n", NULL); _dl_debug_printf ("\n");
} }
else else
{ {

View File

@ -162,12 +162,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 (_dl_debug_mask & DL_DEBUG_FILES, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0))
_dl_debug_message (1, "\nfile=", _dl_debug_printf ("\
\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],
"; needed by ",
undef_map->l_name[0] undef_map->l_name[0]
? undef_map->l_name : _dl_argv[0], ? undef_map->l_name : _dl_argv[0]);
" (relocation dependency)\n\n", NULL);
} }
else else
/* Whoa, that was bad luck. We have to search again. */ /* Whoa, that was bad luck. We have to search again. */
@ -243,14 +242,12 @@ _dl_lookup_symbol (const char *undef_name, struct link_map *undef_map,
protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED; protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED;
if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0))
_dl_debug_message (1, "binding file ", _dl_debug_printf ("binding file %s to %s: %s symbol `%s'\n",
(reference_name && reference_name[0] (reference_name && reference_name[0]
? reference_name ? reference_name : (_dl_argv[0] ?: "<main program>")),
: (_dl_argv[0] ?: "<main program>")), current_value.m->l_name[0]
" to ", current_value.m->l_name[0]
? current_value.m->l_name : _dl_argv[0], ? current_value.m->l_name : _dl_argv[0],
": ", protected ? "protected" : "normal", protected ? "protected" : "normal", undef_name);
" symbol `", undef_name, "'\n", NULL);
if (__builtin_expect (protected == 0, 1)) if (__builtin_expect (protected == 0, 1))
{ {
@ -322,14 +319,12 @@ _dl_lookup_symbol_skip (const char *undef_name,
protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED; protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED;
if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0))
_dl_debug_message (1, "binding file ", _dl_debug_printf ("binding file %s to %s: %s symbol `%s'\n",
(reference_name && reference_name[0] (reference_name && reference_name[0]
? reference_name ? reference_name : (_dl_argv[0] ?: "<main program>")),
: (_dl_argv[0] ?: "<main program>")), current_value.m->l_name[0]
" to ", current_value.m->l_name[0]
? current_value.m->l_name : _dl_argv[0], ? current_value.m->l_name : _dl_argv[0],
": ", protected ? "protected" : "normal", protected ? "protected" : "normal", undef_name);
" symbol `", undef_name, "'\n", NULL);
if (__builtin_expect (protected == 0, 1)) if (__builtin_expect (protected == 0, 1))
{ {
@ -450,15 +445,13 @@ _dl_lookup_versioned_symbol (const char *undef_name,
protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED; protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED;
if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0))
_dl_debug_message (1, "binding file ", _dl_debug_printf ("binding file %s to %s: %s symbol `%s' [%s]\n",
(reference_name && reference_name[0] (reference_name && reference_name[0]
? reference_name ? reference_name : (_dl_argv[0] ?: "<main program>")),
: (_dl_argv[0] ?: "<main program>")), current_value.m->l_name[0]
" to ", current_value.m->l_name[0]
? current_value.m->l_name : _dl_argv[0], ? current_value.m->l_name : _dl_argv[0],
": ", protected ? "protected" : "normal", protected ? "protected" : "normal",
" symbol `", undef_name, "' [", version->name, undef_name, version->name);
"]\n", NULL);
if (__builtin_expect (protected == 0, 1)) if (__builtin_expect (protected == 0, 1))
{ {
@ -541,15 +534,13 @@ _dl_lookup_versioned_symbol_skip (const char *undef_name,
protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED; protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED;
if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0))
_dl_debug_message (1, "binding file ", _dl_debug_printf ("binding file %s to %s: %s symbol `%s' [%s]\n",
(reference_name && reference_name[0] (reference_name && reference_name[0]
? reference_name ? reference_name : (_dl_argv[0] ?: "<main program>")),
: (_dl_argv[0] ?: "<main program>")), current_value.m->l_name[0]
" to ", current_value.m->l_name[0]
? current_value.m->l_name : _dl_argv[0], ? current_value.m->l_name : _dl_argv[0],
": ", protected ? "protected" : "normal", protected ? "protected" : "normal",
" symbol `", undef_name, "' [", version->name, undef_name, version->name);
"]\n", NULL);
if (__builtin_expect (protected == 0, 1)) if (__builtin_expect (protected == 0, 1))
{ {

View File

@ -187,13 +187,10 @@ void weak_function
__assert_fail (const char *assertion, __assert_fail (const char *assertion,
const char *file, unsigned int line, const char *function) const char *file, unsigned int line, const char *function)
{ {
char buf[64]; _dl_fatal_printf ("\
buf[sizeof buf - 1] = '\0'; BUG IN DYNAMIC LINKER ld.so: %s: %u: %s%sAssertion `%s' failed!\n",
_dl_sysdep_fatal ("BUG IN DYNAMIC LINKER ld.so: ", file, line, function ?: "", function ? ": " : "",
file, ": ", _itoa_word (line, buf + sizeof buf - 1, 10, 0), assertion);
": ", function ?: "", function ? ": " : "",
"Assertion `", assertion, "' failed!\n",
NULL);
} }
@ -203,15 +200,10 @@ __assert_perror_fail (int errnum,
const char *function) const char *function)
{ {
char errbuf[64]; char errbuf[64];
char buf[64]; _dl_fatal_printf ("\
buf[sizeof buf - 1] = '\0'; BUG IN DYNAMIC LINKER ld.so: %s: %u: %s%sUnexpected error: %s\n",
_dl_sysdep_fatal ("BUG IN DYNAMIC LINKER ld.so: ", file, line, function ?: "", function ? ": " : "",
file, ": ", _itoa_word (line, buf + sizeof buf - 1, 10, 0), __strerror_r (errnum, errbuf, sizeof (errbuf)));
": ", function ?: "", function ? ": " : "",
"Unexpected error: ",
__strerror_r (errnum, errbuf, sizeof (errbuf)), "\n",
NULL);
} }
#endif #endif

View File

@ -243,17 +243,8 @@ dl_open_worker (void *a)
{ {
/* Let the user know about the opencount. */ /* Let the user know about the opencount. */
if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0))
{ _dl_debug_printf ("opening file=%s; opencount == %u\n\n",
char buf[20]; new->l_name, new->l_opencount);
buf[sizeof buf - 1] = '\0';
_dl_debug_message (1, "opening file=", new->l_name,
"; opencount == ",
_itoa_word (new->l_opencount,
buf + sizeof buf - 1, 10, 0),
"\n\n", NULL);
}
/* 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. */
@ -343,17 +334,8 @@ dl_open_worker (void *a)
/* Let the user know about the opencount. */ /* Let the user know about the opencount. */
if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0))
{ _dl_debug_printf ("opening file=%s; opencount == %u\n\n",
char buf[20]; new->l_name, new->l_opencount);
buf[sizeof buf - 1] = '\0';
_dl_debug_message (1, "opening file=", new->l_name,
"; opencount == ",
_itoa_word (new->l_opencount,
buf + sizeof buf - 1, 10, 0),
"\n\n", NULL);
}
} }
@ -453,17 +435,15 @@ show_scope (struct link_map *new)
numbuf[0] = '0' + scope_cnt; numbuf[0] = '0' + scope_cnt;
numbuf[1] = '\0'; numbuf[1] = '\0';
_dl_sysdep_message ("scope ", numbuf, ":", NULL); _dl_printf ("scope %s:", numbuf);
for (cnt = 0; cnt < new->l_scope[scope_cnt]->r_nlist; ++cnt) for (cnt = 0; cnt < new->l_scope[scope_cnt]->r_nlist; ++cnt)
if (*new->l_scope[scope_cnt]->r_list[cnt]->l_name) if (*new->l_scope[scope_cnt]->r_list[cnt]->l_name)
_dl_sysdep_message (" ", _dl_printf (" %s", new->l_scope[scope_cnt]->r_list[cnt]->l_name)
new->l_scope[scope_cnt]->r_list[cnt]->l_name,
NULL);
else else
_dl_sysdep_message (" <main>", NULL); _dl_printf (" <main>", NULL);
_dl_sysdep_message ("\n", NULL); _dl_printf ("\n", NULL);
} }
} }
#endif #endif

View File

@ -266,9 +266,8 @@ _dl_start_profile (struct link_map *map, const char *output_dir)
{ {
/* We cannot write the profiling data so don't do anything. */ /* We cannot write the profiling data so don't do anything. */
char buf[400]; char buf[400];
_dl_sysdep_message (filename, ": cannot open file: ", _dl_error_printf ("%s: cannot open file: %s\n", filename,
__strerror_r (errno, buf, sizeof buf), __strerror_r (errno, buf, sizeof buf));
"\n", NULL);
return; return;
} }
@ -278,9 +277,8 @@ _dl_start_profile (struct link_map *map, const char *output_dir)
char buf[400]; char buf[400];
int errnum = errno; int errnum = errno;
__close (fd); __close (fd);
_dl_sysdep_message (filename, ": cannot stat file: ", _dl_error_printf ("%s: cannot stat file: %s\n", filename,
__strerror_r (errnum, buf, sizeof buf), __strerror_r (errnum, buf, sizeof buf));
"\n", NULL);
return; return;
} }
@ -300,9 +298,8 @@ _dl_start_profile (struct link_map *map, const char *output_dir)
cannot_create: cannot_create:
errnum = errno; errnum = errno;
__close (fd); __close (fd);
_dl_sysdep_message (filename, ": cannot create file: ", _dl_error_printf ("%s: cannot create file: %s\n", filename,
__strerror_r (errnum, buf, sizeof buf), __strerror_r (errnum, buf, sizeof buf));
"\n", NULL);
return; return;
} }
@ -319,9 +316,8 @@ _dl_start_profile (struct link_map *map, const char *output_dir)
if (addr != NULL) if (addr != NULL)
__munmap ((void *) addr, expected_size); __munmap ((void *) addr, expected_size);
_dl_sysdep_message (filename, _dl_error_printf ("%s: file is no correct profile data file for `%s'\n",
": file is no correct profile data file for `", filename, _dl_profile);
_dl_profile, "'\n", NULL);
return; return;
} }
@ -332,9 +328,8 @@ _dl_start_profile (struct link_map *map, const char *output_dir)
char buf[400]; char buf[400];
int errnum = errno; int errnum = errno;
__close (fd); __close (fd);
_dl_sysdep_message (filename, ": cannot map file: ", _dl_error_printf ("%s: cannot map file: %s\n", filename,
__strerror_r (errnum, buf, sizeof buf), __strerror_r (errnum, buf, sizeof buf));
"\n", NULL);
return; return;
} }
@ -377,7 +372,7 @@ _dl_start_profile (struct link_map *map, const char *output_dir)
if (tos == NULL) if (tos == NULL)
{ {
__munmap ((void *) addr, expected_size); __munmap ((void *) addr, expected_size);
_dl_sysdep_fatal ("Out of memory while initializing profiler\n", NULL); _dl_fatal_printf ("Out of memory while initializing profiler\n");
/* NOTREACHED */ /* NOTREACHED */
} }

View File

@ -41,9 +41,8 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
lazy = 0; lazy = 0;
if (__builtin_expect (_dl_debug_mask & DL_DEBUG_RELOC, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_RELOC, 0))
_dl_debug_message (1, "\nrelocation processing: ", _dl_printf ("\nrelocation processing: %s%s\n",
l->l_name[0] ? l->l_name : _dl_argv[0], l->l_name[0] ? l->l_name : _dl_argv[0], lazy ? " (lazy)" : "");
lazy ? " (lazy)\n" : "\n", NULL);
if (__builtin_expect (l->l_info[DT_TEXTREL] != NULL, 0)) if (__builtin_expect (l->l_info[DT_TEXTREL] != NULL, 0))
{ {
@ -99,17 +98,18 @@ cannot make segment writable for relocation"));
if it only contains lead function) the l_info[DT_PLTRELSZ] if it only contains lead function) the l_info[DT_PLTRELSZ]
will be NULL. */ will be NULL. */
if (l->l_info[DT_PLTRELSZ] == NULL) if (l->l_info[DT_PLTRELSZ] == NULL)
_dl_sysdep_fatal (_dl_argv[0] ?: "<program name unknown>", _dl_fatal_printf ("%s: profiler found no PLTREL in object %s\n",
": profiler found no PLTREL in object ", _dl_argv[0] ?: "<program name unknown>",
l->l_name, "\n", NULL); l->l_name);
l->l_reloc_result = l->l_reloc_result =
(ElfW(Addr) *) calloc (sizeof (ElfW(Addr)), (ElfW(Addr) *) calloc (sizeof (ElfW(Addr)),
l->l_info[DT_PLTRELSZ]->d_un.d_val); l->l_info[DT_PLTRELSZ]->d_un.d_val);
if (l->l_reloc_result == NULL) if (l->l_reloc_result == NULL)
_dl_sysdep_fatal (_dl_argv[0] ?: "<program name unknown>", _dl_fatal_printf ("\
": profiler out of memory shadowing PLTREL of ", %s: profiler out of memory shadowing PLTREL of %s\n",
l->l_name, "\n", NULL); _dl_argv[0] ?: "<program name unknown>",
l->l_name);
} }
} }

View File

@ -84,9 +84,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 (_dl_debug_mask & DL_DEBUG_VERSIONS, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_VERSIONS, 0))
_dl_debug_message (1, "checking for version `", string, "' in file ", _dl_debug_printf ("\
map->l_name[0] ? map->l_name : _dl_argv[0], checking for version `%s' in file %s required by file %s\n",
" required by file ", name, "\n", NULL); string, map->l_name[0] ? 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))
{ {

View File

@ -61,9 +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 (_dl_debug_mask & DL_DEBUG_SYMBOLS, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_SYMBOLS, 0))
_dl_debug_message (1, "symbol=", undef_name, "; lookup in file=", _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]);
"\n", NULL);
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]);

View File

@ -452,7 +452,7 @@ dl_main (const ElfW(Phdr) *phdr,
/* If we have no further argument the program was called incorrectly. /* If we have no further argument the program was called incorrectly.
Grant the user some education. */ Grant the user some education. */
if (_dl_argc < 2) if (_dl_argc < 2)
_dl_sysdep_fatal ("\ _dl_fatal_printf ("\
Usage: ld.so [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...]\n\ Usage: ld.so [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...]\n\
You have invoked `ld.so', the helper program for shared library executables.\n\ You have invoked `ld.so', the helper program for shared library executables.\n\
This program usually lives in the file `/lib/ld.so', and special directives\n\ This program usually lives in the file `/lib/ld.so', and special directives\n\
@ -472,8 +472,7 @@ of this helper program; chances are you did not intend to run this program.\n\
--library-path PATH use given PATH instead of content of the environment\n\ --library-path PATH use given PATH instead of content of the environment\n\
variable LD_LIBRARY_PATH\n\ variable LD_LIBRARY_PATH\n\
--inhibit-rpath LIST ignore RUNPATH and RPATH information in object names\n\ --inhibit-rpath LIST ignore RUNPATH and RPATH information in object names\n\
in LIST\n", in LIST\n");
NULL);
++_dl_skip_args; ++_dl_skip_args;
--_dl_argc; --_dl_argc;
@ -522,7 +521,7 @@ of this helper program; chances are you did not intend to run this program.\n\
This will be what dlopen on "" returns. */ This will be what dlopen on "" returns. */
_dl_new_object ((char *) "", "", lt_executable, NULL); _dl_new_object ((char *) "", "", lt_executable, NULL);
if (_dl_loaded == NULL) if (_dl_loaded == NULL)
_dl_sysdep_fatal ("cannot allocate memory for link map\n", NULL); _dl_fatal_printf ("cannot allocate memory for link map\n");
_dl_loaded->l_phdr = phdr; _dl_loaded->l_phdr = phdr;
_dl_loaded->l_phnum = phnum; _dl_loaded->l_phnum = phnum;
_dl_loaded->l_entry = *user_entry; _dl_loaded->l_entry = *user_entry;
@ -865,7 +864,7 @@ of this helper program; chances are you did not intend to run this program.\n\
functions we call below for output may no longer work properly functions we call below for output may no longer work properly
after relocation. */ after relocation. */
if (! _dl_loaded->l_info[DT_NEEDED]) if (! _dl_loaded->l_info[DT_NEEDED])
_dl_sysdep_message ("\t", "statically linked\n", NULL); _dl_printf ("\tstatically linked\n");
else else
{ {
struct link_map *l; struct link_map *l;
@ -873,19 +872,10 @@ of this helper program; chances are you did not intend to run this program.\n\
for (l = _dl_loaded->l_next; l; l = l->l_next) for (l = _dl_loaded->l_next; l; l = l->l_next)
if (l->l_faked) if (l->l_faked)
/* The library was not found. */ /* The library was not found. */
_dl_sysdep_message ("\t", l->l_libname->name, " => not found\n", _dl_printf ("\t%s => not found\n", l->l_libname->name);
NULL);
else else
{ _dl_printf ("\t%s => %s (0x%0*Zx)\n", l->l_libname->name,
char buf[20], *bp; l->l_name, sizeof l->l_addr * 2, l->l_addr);
buf[sizeof buf - 1] = '\0';
bp = _itoa_word (l->l_addr, &buf[sizeof buf - 1], 16, 0);
while ((size_t) (&buf[sizeof buf - 1] - bp)
< sizeof l->l_addr * 2)
*--bp = '0';
_dl_sysdep_message ("\t", l->l_libname->name, " => ",
l->l_name, " (0x", bp, ")\n", NULL);
}
} }
if (__builtin_expect (mode, trace) != trace) if (__builtin_expect (mode, trace) != trace)
@ -894,7 +884,6 @@ of this helper program; chances are you did not intend to run this program.\n\
const ElfW(Sym) *ref = NULL; const ElfW(Sym) *ref = NULL;
ElfW(Addr) loadbase; ElfW(Addr) loadbase;
lookup_t result; lookup_t result;
char buf[20], *bp;
result = _dl_lookup_symbol (_dl_argv[i], _dl_loaded, result = _dl_lookup_symbol (_dl_argv[i], _dl_loaded,
&ref, _dl_loaded->l_scope, &ref, _dl_loaded->l_scope,
@ -902,16 +891,9 @@ of this helper program; chances are you did not intend to run this program.\n\
loadbase = LOOKUP_VALUE_ADDRESS (result); loadbase = LOOKUP_VALUE_ADDRESS (result);
buf[sizeof buf - 1] = '\0'; _dl_printf ("%s found at 0x%0*Zd in object at 0x%0*Zd\n",
bp = _itoa_word (ref->st_value, &buf[sizeof buf - 1], 16, 0); _dl_argv[i], sizeof ref->st_value * 2, ref->st_value,
while ((size_t) (&buf[sizeof buf - 1] - bp) < sizeof loadbase * 2) sizeof loadbase * 2, loadbase);
*--bp = '0';
_dl_sysdep_message (_dl_argv[i], " found at 0x", bp, NULL);
buf[sizeof buf - 1] = '\0';
bp = _itoa_word (loadbase, &buf[sizeof buf - 1], 16, 0);
while ((size_t) (&buf[sizeof buf - 1] - bp) < sizeof loadbase * 2)
*--bp = '0';
_dl_sysdep_message (" in object at 0x", bp, "\n", NULL);
} }
else else
{ {
@ -961,13 +943,12 @@ of this helper program; chances are you did not intend to run this program.\n\
if (first) if (first)
{ {
_dl_sysdep_message ("\n\tVersion information:\n", NULL); _dl_printf ("\n\tVersion information:\n");
first = 0; first = 0;
} }
_dl_sysdep_message ("\t", (map->l_name[0] _dl_printf ("\t%s:\n",
? map->l_name : _dl_argv[0]), map->l_name[0] ? map->l_name : _dl_argv[0]);
":\n", NULL);
while (1) while (1)
{ {
@ -981,22 +962,17 @@ of this helper program; chances are you did not intend to run this program.\n\
{ {
const char *fname = NULL; const char *fname = NULL;
_dl_sysdep_message ("\t\t",
strtab + ent->vn_file,
" (", strtab + aux->vna_name,
") ",
(aux->vna_flags
& VER_FLG_WEAK
? "[WEAK] " : ""),
"=> ", NULL);
if (needed != NULL if (needed != NULL
&& match_version (strtab + aux->vna_name, && match_version (strtab + aux->vna_name,
needed)) needed))
fname = needed->l_name; fname = needed->l_name;
_dl_sysdep_message (fname ?: "not found", "\n", _dl_printf ("\t\t%s (%s) %s=> %s\n",
NULL); strtab + ent->vn_file,
strtab + aux->vna_name,
aux->vna_flags & VER_FLG_WEAK
? "[WEAK] " : "",
fname ?: "not found");
if (aux->vna_next == 0) if (aux->vna_next == 0)
/* No more symbols. */ /* No more symbols. */
@ -1155,7 +1131,7 @@ print_unresolved (int errcode __attribute__ ((unused)), const char *objname,
{ {
if (objname[0] == '\0') if (objname[0] == '\0')
objname = _dl_argv[0] ?: "<main program>"; objname = _dl_argv[0] ?: "<main program>";
_dl_sysdep_error (errstring, " (", objname, ")\n", NULL); _dl_error_printf ("%s (%s)\n", errstring, objname);
} }
/* This is a little helper function for resolving symbols while /* This is a little helper function for resolving symbols while
@ -1164,8 +1140,8 @@ static void
print_missing_version (int errcode __attribute__ ((unused)), print_missing_version (int errcode __attribute__ ((unused)),
const char *objname, const char *errstring) const char *objname, const char *errstring)
{ {
_dl_sysdep_error (_dl_argv[0] ?: "<program name unknown>", ": ", _dl_error_printf ("%s: %s: %s\n", _dl_argv[0] ?: "<program name unknown>",
objname, ": ", errstring, "\n", NULL); objname, errstring);
} }
/* Nonzero if any of the debugging options is enabled. */ /* Nonzero if any of the debugging options is enabled. */
@ -1206,7 +1182,7 @@ process_dl_debug (const char *dl_debug)
case 4: case 4:
if (memcmp (dl_debug, "help", 4) == 0) if (memcmp (dl_debug, "help", 4) == 0)
{ {
_dl_sysdep_message ("\ _dl_printf ("\
Valid options for the LD_DEBUG environment variable are:\n\ Valid options for the LD_DEBUG environment variable are:\n\
\n\ \n\
bindings display information about symbol binding\n\ bindings display information about symbol binding\n\
@ -1219,8 +1195,7 @@ Valid options for the LD_DEBUG environment variable are:\n\
versions display version dependencies\n\ versions display version dependencies\n\
\n\ \n\
To direct the debugging output into a file instead of standard output\n\ To direct the debugging output into a file instead of standard output\n\
a filename can be specified using the LD_DEBUG_OUTPUT environment variable.\n", a filename can be specified using the LD_DEBUG_OUTPUT environment variable.\n");
NULL);
_exit (0); _exit (0);
} }
@ -1288,8 +1263,8 @@ a filename can be specified using the LD_DEBUG_OUTPUT environment variable.\n",
{ {
/* Display a warning and skip everything until next separator. */ /* Display a warning and skip everything until next separator. */
char *startp = strndupa (dl_debug, len); char *startp = strndupa (dl_debug, len);
_dl_sysdep_error ("warning: debug option `", startp, _dl_error_printf ("\
"' unknown; try LD_DEBUG=help\n", NULL); warning: debug option `%s' unknown; try LD_DEBUG=help\n", startp);
break; break;
} }
} }
@ -1511,21 +1486,19 @@ 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_message (1, "\nruntime linker statistics:\n" _dl_debug_printf ("\nruntime linker statistics:\n"
" total startup time in dynamic loader: ", " total startup time in dynamic loader: %s\n", buf);
buf, "\n", NULL);
} }
/* Print relocation statistics. */ /* Print relocation statistics. */
if (HP_TIMING_AVAIL) if (HP_TIMING_AVAIL)
{ {
char pbuf[30];
HP_TIMING_PRINT (buf, sizeof (buf), relocate_time); HP_TIMING_PRINT (buf, sizeof (buf), relocate_time);
_dl_debug_message (1, " time needed for relocation: ", buf,
NULL);
cp = _itoa_word ((1000 * relocate_time) / rtld_total_time, cp = _itoa_word ((1000 * relocate_time) / rtld_total_time,
buf + sizeof (buf), 10, 0); pbuf + sizeof (pbuf), 10, 0);
wp = buf; wp = pbuf;
switch (buf + sizeof (buf) - cp) switch (pbuf + sizeof (pbuf) - cp)
{ {
case 3: case 3:
*wp++ = *cp++; *wp++ = *cp++;
@ -1536,26 +1509,23 @@ print_statistics (void)
*wp++ = *cp++; *wp++ = *cp++;
} }
*wp = '\0'; *wp = '\0';
_dl_debug_message (0, " (", buf, "%)\n", NULL); _dl_debug_printf (" time needed for relocation: %s (%s)\n",
buf, pbuf);
} }
#endif #endif
buf[sizeof (buf) - 1] = '\0'; _dl_debug_printf (" number of relocations: %lu\n",
_dl_debug_message (1, " number of relocations: ", _dl_num_relocations);
_itoa_word (_dl_num_relocations,
buf + sizeof (buf) - 1, 10, 0),
"\n", NULL);
#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. */
if (HP_TIMING_AVAIL) if (HP_TIMING_AVAIL)
{ {
char pbuf[30];
HP_TIMING_PRINT (buf, sizeof (buf), load_time); HP_TIMING_PRINT (buf, sizeof (buf), load_time);
_dl_debug_message (1, " time needed to load objects: ", buf,
NULL);
cp = _itoa_word ((1000 * load_time) / rtld_total_time, cp = _itoa_word ((1000 * load_time) / rtld_total_time,
buf + sizeof (buf), 10, 0); pbuf + sizeof (pbuf), 10, 0);
wp = buf; wp = pbuf;
switch (buf + sizeof (buf) - cp) switch (pbuf + sizeof (pbuf) - cp)
{ {
case 3: case 3:
*wp++ = *cp++; *wp++ = *cp++;
@ -1566,7 +1536,8 @@ print_statistics (void)
*wp++ = *cp++; *wp++ = *cp++;
} }
*wp = '\0'; *wp = '\0';
_dl_debug_message (0, " (", buf, "%)\n", NULL); _dl_debug_printf (" time needed to load objects: %s (%s)\n",
buf, pbuf);
} }
#endif #endif
} }

View File

@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. ARM version. /* Machine-dependent ELF dynamic relocation inline functions. ARM version.
Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc. Copyright (C) 1995,96,97,98,99,2000,2001 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
@ -436,10 +436,10 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
const char *strtab; const char *strtab;
strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]); strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
_dl_sysdep_error (_dl_argv[0] ?: "<program name unknown>", _dl_error_printf ("\
": Symbol `", strtab + refsym->st_name, %s: Symbol `%s' has different size in shared object, consider re-linking\n",
"' has different size in shared object, " _dl_argv[0] ?: "<program name unknown>",
"consider re-linking\n", NULL); strtab + refsym->st_name);
} }
memcpy (reloc_addr, (void *) value, MIN (sym->st_size, memcpy (reloc_addr, (void *) value, MIN (sym->st_size,
refsym->st_size)); refsym->st_size));

View File

@ -155,7 +155,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 (_dl_debug_mask & DL_DEBUG_LIBS, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0))
_dl_debug_message (1, " search cache=", LD_SO_CACHE, "\n", NULL); _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE);
if (cache == NULL) if (cache == NULL)
{ {
@ -253,7 +253,7 @@ _dl_load_cache_lookup (const char *name)
/* Print our result if wanted. */ /* Print our result if wanted. */
if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0) && best != NULL) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0) && best != NULL)
_dl_debug_message (1, " trying file=", best, "\n", NULL); _dl_debug_printf (" trying file=%s\n", best);
return best; return best;
} }

View File

@ -264,7 +264,7 @@ _dl_show_auxv (void)
else if (__builtin_expect (auxvars[idx].form, hex) == hex) else if (__builtin_expect (auxvars[idx].form, hex) == hex)
val = _itoa_word (av->a_un.a_val, buf + sizeof buf - 1, 16, 0); val = _itoa_word (av->a_un.a_val, buf + sizeof buf - 1, 16, 0);
_dl_sysdep_message (auxvars[idx].label, val, "\n", NULL); _dl_printf ("%s%s\n", auxvars[idx].label, val);
} }
} }
} }

View File

@ -116,14 +116,14 @@ BP_SYM (__libc_start_main) (int (*main) (int, char **, char **),
/* Call the initializer of the program, if any. */ /* Call the initializer of the program, if any. */
#ifdef SHARED #ifdef SHARED
if (__builtin_expect (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0))
_dl_debug_message (1, "\ninitialize program: ", argv[0], "\n\n", NULL); _dl_debug_printf ("\ninitialize program: %s\n\n", argv[0]);
#endif #endif
if (init) if (init)
(*init) (); (*init) ();
#ifdef SHARED #ifdef SHARED
if (__builtin_expect (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0)) if (__builtin_expect (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0))
_dl_debug_message (1, "\ntransferring control: ", argv[0], "\n\n", NULL); _dl_debug_printf ("\ntransferring control: %s\n\n", argv[0]);
#endif #endif
exit ((*main) (argc, argv, __environ)); exit ((*main) (argc, argv, __environ));

View File

@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. PA-RISC version. /* Machine-dependent ELF dynamic relocation inline functions. PA-RISC version.
Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc. Copyright (C) 1995,1996,1997,1999,2000,2001 Free Software Foundation, Inc.
Contributed by David Huggins-Daines <dhd@debian.org> Contributed by David Huggins-Daines <dhd@debian.org>
This file is part of the GNU C Library. This file is part of the GNU C Library.
@ -575,10 +575,10 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const char *strtab; const char *strtab;
strtab = (const char *) D_PTR (map, l_info[DT_STRTAB]); strtab = (const char *) D_PTR (map, l_info[DT_STRTAB]);
_dl_sysdep_error (_dl_argv[0] ?: "<program name unknown>", _dl_error_printf ("\
": Symbol `", strtab + refsym->st_name, %s: Symbol `%s' has different size in shared object, consider re-linking\n",
"' has different size in shared object, " _dl_argv[0] ?: "<program name unknown>",
"consider re-linking\n", NULL); strtab + refsym->st_name);
} }
memcpy (reloc_addr, (void *) value, memcpy (reloc_addr, (void *) value,
MIN (sym->st_size, refsym->st_size)); MIN (sym->st_size, refsym->st_size));

View File

@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. i386 version. /* Machine-dependent ELF dynamic relocation inline functions. i386 version.
Copyright (C) 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Copyright (C) 1995,96,97,98,99,2000,2001 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
@ -351,10 +351,10 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
const char *strtab; const char *strtab;
strtab = (const char *) D_PTR (map, l_info[DT_STRTAB]); strtab = (const char *) D_PTR (map, l_info[DT_STRTAB]);
_dl_sysdep_error (_dl_argv[0] ?: "<program name unknown>", _dl_error_printf ("\
": Symbol `", strtab + refsym->st_name, %s: Symbol `%s' has different size in shared object, consider re-linking\n",
"' has different size in shared object, " _dl_argv[0] ?: "<program name unknown>",
"consider re-linking\n", NULL); strtab + refsym->st_name);
} }
memcpy (reloc_addr, (void *) value, MIN (sym->st_size, memcpy (reloc_addr, (void *) value, MIN (sym->st_size,
refsym->st_size)); refsym->st_size));

View File

@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. m68k version. /* Machine-dependent ELF dynamic relocation inline functions. m68k version.
Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. Copyright (C) 1996,1997,1998,1999,2000,2001 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
@ -255,10 +255,10 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const char *strtab; const char *strtab;
strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]); strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
_dl_sysdep_error (_dl_argv[0] ?: "<program name unknown>", _dl_error_printf ("\
": Symbol `", strtab + refsym->st_name, %s: Symbol `%s' has different size in shared object, consider re-linking\n",
"' has different size in shared object, " _dl_argv[0] ?: "<program name unknown>",
"consider re-linking\n", NULL); strtab + refsym->st_name);
} }
memcpy (reloc_addr, (void *) value, MIN (sym->st_size, memcpy (reloc_addr, (void *) value, MIN (sym->st_size,
refsym->st_size)); refsym->st_size));

View File

@ -468,10 +468,10 @@ __process_machine_rela (struct link_map *map,
const char *strtab; const char *strtab;
strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]); strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
_dl_sysdep_error (_dl_argv[0] ?: "<program name unknown>", _dl_error_printf ("\
": Symbol `", strtab + refsym->st_name, %s: Symbol `%s' has different size in shared object, onsider re-linking\n"
"' has different size in shared object, " _dl_argv[0] ?: "<program name unknown>",
"consider re-linking\n", NULL); strtab + refsym->st_name);
} }
memcpy (reloc_addr, (char *) finaladdr, MIN (sym->st_size, memcpy (reloc_addr, (char *) finaladdr, MIN (sym->st_size,
refsym->st_size)); refsym->st_size));

View File

@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. S390 Version. /* Machine-dependent ELF dynamic relocation inline functions. S390 Version.
Copyright (C) 2000 Free Software Foundation, Inc. Copyright (C) 2000, 2001 Free Software Foundation, Inc.
Contributed by Carl Pederson & Martin Schwidefsky. Contributed by Carl Pederson & Martin Schwidefsky.
This file is part of the GNU C Library. This file is part of the GNU C Library.
@ -395,10 +395,10 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const char *strtab; const char *strtab;
strtab = (const char *) D_PTR(map,l_info[DT_STRTAB]); strtab = (const char *) D_PTR(map,l_info[DT_STRTAB]);
_dl_sysdep_error (_dl_argv[0] ?: "<program name unknown>", _dl_error_printf ("\
": Symbol `", strtab + refsym->st_name, %s: Symbol `%s' has different size in shared object, consider re-linking\n",
"' has different size in shared object, " _dl_argv[0] ?: "<program name unknown>",
"consider re-linking\n", NULL); strtab + refsym->st_name);
} }
memcpy (reloc_addr, (void *) value, MIN (sym->st_size, memcpy (reloc_addr, (void *) value, MIN (sym->st_size,
refsym->st_size)); refsym->st_size));

View File

@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. SH version. /* Machine-dependent ELF dynamic relocation inline functions. SH version.
Copyright (C) 1999, 2000 Free Software Foundation, Inc. Copyright (C) 1999, 2000, 2001 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
@ -461,10 +461,10 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const char *strtab; const char *strtab;
strtab = (const char *) D_PTR (map, l_info[DT_STRTAB]); strtab = (const char *) D_PTR (map, l_info[DT_STRTAB]);
_dl_sysdep_error (_dl_argv[0] ?: "<program name unknown>", _dl_error_printf ("\
": Symbol `", strtab + refsym->st_name, %s: Symbol `%s' has different size in shared object, consider re-linking\n"
"' has different size in shared object, " _dl_argv[0] ?: "<program name unknown>",
"consider re-linking\n", NULL); strtab + refsym->st_name);
} }
memcpy (reloc_addr, (void *) value, MIN (sym->st_size, memcpy (reloc_addr, (void *) value, MIN (sym->st_size,
refsym->st_size)); refsym->st_size));

View File

@ -33,7 +33,7 @@ static inline void
__attribute__ ((__noreturn__)) __attribute__ ((__noreturn__))
dl_fatal (const char *str) dl_fatal (const char *str)
{ {
_dl_sysdep_output (2, str, NULL); _dl_dprintf (2, str);
_exit (1); _exit (1);
} }
#endif #endif

View File

@ -1,5 +1,5 @@
/* Optional code to distinguish library flavours. /* Optional code to distinguish library flavours.
Copyright (C) 1998 Free Software Foundation, Inc. Copyright (C) 1998, 2001 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>, 1998. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@ -41,7 +41,7 @@
break; \ break; \
\ \
/* We print a `5' or `6' depending on the outcome. */ \ /* We print a `5' or `6' depending on the outcome. */ \
_dl_sysdep_message (d->d_tag != DT_NULL ? "5\n" : "6\n", NULL); \ _dl_printf (d->d_tag != DT_NULL ? "5\n" : "6\n"); \
} \ } \
} \ } \
while (0) while (0)

View File

@ -21,6 +21,8 @@
#ifndef _DL_PROCINFO_H #ifndef _DL_PROCINFO_H
#define _DL_PROCINFO_H 1 #define _DL_PROCINFO_H 1
#include <ldsodefs.h>
/* If anything should be added here check whether the size of each string /* If anything should be added here check whether the size of each string
is still ok with the given array size. */ is still ok with the given array size. */
extern const char _dl_x86_cap_flags[][7]; extern const char _dl_x86_cap_flags[][7];
@ -43,13 +45,13 @@ _dl_procinfo (int word)
in the kernel sources. */ in the kernel sources. */
int i; int i;
_dl_sysdep_message ("AT_HWCAP: ", NULL); _dl_printf ("AT_HWCAP: ");
for (i = 0; i < _DL_HWCAP_COUNT; ++i) for (i = 0; i < _DL_HWCAP_COUNT; ++i)
if (word & (1 << i)) if (word & (1 << i))
_dl_sysdep_message (" ", _dl_x86_cap_flags[i], NULL); _dl_printf (" %s", _dl_x86_cap_flags[i]);
_dl_sysdep_message ("\n", NULL); _dl_printf ("\n");
return 0; return 0;
} }