if (map->l_opencount > 1 || map->l_type != lt_loaded)
{
/* There are still references to this object. Do nothing more. */
- if (__builtin_expect (_dl_debug_files, 0))
+ if (//__builtin_expect (_dl_debug_files, 0))
+ __builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0))
{
char buf[20];
&& imap->l_init_called)
{
/* When debugging print a message first. */
- if (__builtin_expect (_dl_debug_impcalls, 0))
+ if (//__builtin_expect (_dl_debug_impcalls, 0))
+ __builtin_expect (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0))
_dl_debug_message (1, "\ncalling fini: ", imap->l_name,
"\n\n", NULL);
/* Load the dependencies of a mapped object.
- 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.
The GNU C Library is free software; you can redistribute it and/or
else \
{ \
/* This is for DT_AUXILIARY. */ \
- if (__builtin_expect (_dl_debug_libs, 0)) \
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0)) \
_dl_debug_message (1, "cannot load auxiliary `", __str, \
"' because of empty dynamic string" \
" token substitution\n", NULL); \
if (d->d_tag == DT_AUXILIARY)
{
/* Say that we are about to load an auxiliary library. */
- if (__builtin_expect (_dl_debug_libs, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0))
_dl_debug_message (1, "load auxiliary object=",
name, " requested by file=",
l->l_name[0]
else
{
/* Say that we are about to load an auxiliary library. */
- if (__builtin_expect (_dl_debug_libs, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0))
_dl_debug_message (1, "load filtered object=", name,
" requested by file=",
l->l_name[0]
/* Call the termination functions of loaded shared objects.
- Copyright (C) 1995,96,98,99,2000 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,98,99,2000,2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
continue;
/* When debugging print a message first. */
- if (__builtin_expect (_dl_debug_impcalls, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0))
_dl_debug_message (1, "\ncalling fini: ",
l->l_name[0] ? l->l_name : _dl_argv[0],
"\n\n", NULL);
return;
/* Print a debug message if wanted. */
- if (__builtin_expect (_dl_debug_impcalls, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0))
_dl_debug_message (1, "\ncalling init: ",
l->l_name[0] ? l->l_name : _dl_argv[0], "\n\n", NULL);
ElfW(Addr) *addrs;
unsigned int cnt;
- if (__builtin_expect (_dl_debug_impcalls, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_IMPCALLS, 0))
_dl_debug_message (1, "\ncalling preinit: ",
main_map->l_name[0]
? main_map->l_name : _dl_argv[0], "\n\n", NULL);
return NULL;
/* Print debugging message. */
- if (__builtin_expect (_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);
/* This is the ELF header. We read it in `open_verify'. */
l->l_entry += l->l_addr;
- if (__builtin_expect (_dl_debug_files, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0))
{
const size_t nibbles = sizeof (void *) * 2;
char buf1[nibbles + 1];
/* If we are debugging the search for libraries print the path
now if it hasn't happened now. */
- if (__builtin_expect (_dl_debug_libs, 0)
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0)
&& current_what != this_dir->what)
{
current_what = this_dir->what;
- buf);
/* Print name we try if this is wanted. */
- if (__builtin_expect (_dl_debug_libs, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0))
_dl_debug_message (1, " trying file=", buf, "\n", NULL);
fd = open_verify (buf, fbp);
}
/* Display information if we are debugging. */
- if (__builtin_expect (_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 ",
loader->l_name[0] ? loader->l_name : _dl_argv[0],
"\n", NULL);
size_t namelen = strlen (name) + 1;
- if (__builtin_expect (_dl_debug_libs, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0))
_dl_debug_message (1, "find library=", name, "; searching\n", NULL);
fd = -1;
&realname, &fb);
/* Add another newline when we a tracing the library loading. */
- if (__builtin_expect (_dl_debug_libs, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0))
_dl_debug_message (1, "\n", NULL);
}
else
/* Look up a symbol in the loaded objects.
- 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.
The GNU C Library is free software; you can redistribute it and/or
++map->l_opencount;
/* Display information if we are debugging. */
- if (__builtin_expect (_dl_debug_files, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0))
_dl_debug_message (1, "\nfile=",
map->l_name[0] ? map->l_name : _dl_argv[0],
"; needed by ",
protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED;
- if (__builtin_expect (_dl_debug_bindings, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0))
_dl_debug_message (1, "binding file ",
(reference_name && reference_name[0]
? reference_name
protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED;
- if (__builtin_expect (_dl_debug_bindings, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0))
_dl_debug_message (1, "binding file ",
(reference_name && reference_name[0]
? reference_name
protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED;
- if (__builtin_expect (_dl_debug_bindings, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0))
_dl_debug_message (1, "binding file ",
(reference_name && reference_name[0]
? reference_name
protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED;
- if (__builtin_expect (_dl_debug_bindings, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0))
_dl_debug_message (1, "binding file ",
(reference_name && reference_name[0]
? reference_name
if (new->l_searchlist.r_list != NULL)
{
/* Let the user know about the opencount. */
- if (__builtin_expect (_dl_debug_files, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0))
{
char buf[20];
__libc_multiple_libcs = 1;
/* Let the user know about the opencount. */
- if (__builtin_expect (_dl_debug_files, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_FILES, 0))
{
char buf[20];
/* Relocate a shared object and resolve its references to other loaded objects.
- 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.
The GNU C Library is free software; you can redistribute it and/or
&& __builtin_expect (l->l_info[DT_BIND_NOW] != NULL, 0))
lazy = 0;
- if (__builtin_expect (_dl_debug_reloc, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_RELOC, 0))
_dl_debug_message (1, "\nrelocation processing: ",
l->l_name[0] ? l->l_name : _dl_argv[0],
lazy ? " (lazy)\n" : "\n", NULL);
const char *_dl_platform;
size_t _dl_platformlen;
-int _dl_debug_libs;
-int _dl_debug_impcalls;
-int _dl_debug_bindings;
-int _dl_debug_symbols;
-int _dl_debug_versions;
-int _dl_debug_reloc;
-int _dl_debug_files;
+int _dl_debug_mask;
int _dl_lazy;
/* XXX I know about at least one case where we depend on the old weak
behavior (it has to do with librt). Until we get DSO groups implemented
/* Handle symbol and library versioning.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
ElfW(Verdef) *def;
/* Display information about what we are doing while debugging. */
- if (__builtin_expect (_dl_debug_versions, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_VERSIONS, 0))
_dl_debug_message (1, "checking for version `", string, "' in file ",
map->l_name[0] ? map->l_name : _dl_argv[0],
" required by file ", name, "\n", NULL);
/* Look up a symbol in the loaded objects.
- 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.
The GNU C Library is free software; you can redistribute it and/or
continue;
/* Print some debugging info if wanted. */
- if (__builtin_expect (_dl_debug_symbols, 0))
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_SYMBOLS, 0))
_dl_debug_message (1, "symbol=", undef_name, "; lookup in file=",
map->l_name[0] ? map->l_name : _dl_argv[0],
"\n", NULL);
#else
int _dl_dynamic_weak = 1;
#endif
-int _dl_debug_libs;
-int _dl_debug_impcalls;
-int _dl_debug_bindings;
-int _dl_debug_symbols;
-int _dl_debug_versions;
-int _dl_debug_reloc;
-int _dl_debug_files;
-int _dl_debug_statistics;
+int _dl_debug_mask;
const char *_dl_inhibit_rpath; /* RPATH values which should be
ignored. */
const char *_dl_origin_path;
}
#endif
- if (__builtin_expect (_dl_debug_statistics, 0))
+ if (//__builtin_expect (_dl_debug_statistics, 0))
+ __builtin_expect (_dl_debug_mask & DL_DEBUG_STATISTICS, 0))
print_statistics ();
return *start_addr;
useful. */
if (memcmp (dl_debug, "all", 3) == 0)
{
- _dl_debug_libs = 1;
- _dl_debug_impcalls = 1;
- _dl_debug_reloc = 1;
- _dl_debug_files = 1;
- _dl_debug_symbols = 1;
- _dl_debug_bindings = 1;
- _dl_debug_versions = 1;
+ _dl_debug_mask = (DL_DEBUG_LIBS | DL_DEBUG_IMPCALLS
+ | DL_DEBUG_RELOC | DL_DEBUG_FILES
+ | DL_DEBUG_SYMBOLS | DL_DEBUG_BINDINGS
+ | DL_DEBUG_VERSIONS);
any_debug = 1;
continue;
}
if (memcmp (dl_debug, "libs", 4) == 0)
{
- _dl_debug_libs = 1;
- _dl_debug_impcalls = 1;
+ _dl_debug_mask |= DL_DEBUG_LIBS | DL_DEBUG_IMPCALLS;
any_debug = 1;
continue;
}
case 5:
if (memcmp (dl_debug, "reloc", 5) == 0)
{
- _dl_debug_reloc = 1;
- _dl_debug_impcalls = 1;
+ _dl_debug_mask |= DL_DEBUG_RELOC | DL_DEBUG_IMPCALLS;
any_debug = 1;
continue;
}
if (memcmp (dl_debug, "files", 5) == 0)
{
- _dl_debug_files = 1;
- _dl_debug_impcalls = 1;
+ _dl_debug_mask |= DL_DEBUG_FILES | DL_DEBUG_IMPCALLS;
any_debug = 1;
continue;
}
case 7:
if (memcmp (dl_debug, "symbols", 7) == 0)
{
- _dl_debug_symbols = 1;
- _dl_debug_impcalls = 1;
+ _dl_debug_mask |= DL_DEBUG_SYMBOLS | DL_DEBUG_IMPCALLS;
any_debug = 1;
continue;
}
case 8:
if (memcmp (dl_debug, "bindings", 8) == 0)
{
- _dl_debug_bindings = 1;
- _dl_debug_impcalls = 1;
+ _dl_debug_mask |= DL_DEBUG_BINDINGS | DL_DEBUG_IMPCALLS;
any_debug = 1;
continue;
}
if (memcmp (dl_debug, "versions", 8) == 0)
{
- _dl_debug_versions = 1;
- _dl_debug_impcalls = 1;
+ _dl_debug_mask |= DL_DEBUG_VERSIONS | DL_DEBUG_IMPCALLS;
any_debug = 1;
continue;
}
case 10:
if (memcmp (dl_debug, "statistics", 10) == 0)
{
- _dl_debug_statistics = 1;
+ _dl_debug_mask |= DL_DEBUG_STATISTICS;
continue;
}
break;
/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
- 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.
The GNU C Library is free software; you can redistribute it and/or
const char *best;
/* Print a message if the loading of libs is traced. */
- if (_dl_debug_libs)
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0))
_dl_debug_message (1, " search cache=", LD_SO_CACHE, "\n", NULL);
if (cache == NULL)
}
/* Print our result if wanted. */
- if (_dl_debug_libs && best != NULL)
+ if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0) && best != NULL)
_dl_debug_message (1, " trying file=", best, "\n", NULL);
return best;
extern const char *_dl_profile_output;
/* If nonzero the appropriate debug information is printed. */
+#if 0
extern int _dl_debug_libs;
extern int _dl_debug_impcalls;
extern int _dl_debug_bindings;
extern int _dl_debug_versions;
extern int _dl_debug_reloc;
extern int _dl_debug_files;
+#else
+extern int _dl_debug_mask;
+#define DL_DEBUG_LIBS (1 << 0)
+#define DL_DEBUG_IMPCALLS (1 << 1)
+#define DL_DEBUG_BINDINGS (1 << 2)
+#define DL_DEBUG_SYMBOLS (1 << 3)
+#define DL_DEBUG_VERSIONS (1 << 4)
+#define DL_DEBUG_RELOC (1 << 5)
+#define DL_DEBUG_FILES (1 << 6)
+#define DL_DEBUG_STATISTICS (1 << 7)
+#endif
/* Expect cache ID. */
extern int _dl_correct_cache_id;
/* Call the initializer of the program, if any. */
#ifdef SHARED
- if (__builtin_expect (_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);
#endif
if (init)
(*init) ();
#ifdef SHARED
- if (__builtin_expect (_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);
#endif