aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic')
-rw-r--r--sysdeps/generic/dl-cache.c6
-rw-r--r--sysdeps/generic/ldsodefs.h12
-rw-r--r--sysdeps/generic/libc-start.c4
3 files changed, 17 insertions, 5 deletions
diff --git a/sysdeps/generic/dl-cache.c b/sysdeps/generic/dl-cache.c
index d92b4bac37..f08bbf1896 100644
--- a/sysdeps/generic/dl-cache.c
+++ b/sysdeps/generic/dl-cache.c
@@ -1,5 +1,5 @@
/* 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
@@ -154,7 +154,7 @@ _dl_load_cache_lookup (const char *name)
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)
@@ -252,7 +252,7 @@ _dl_load_cache_lookup (const char *name)
}
/* 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;
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 7d9907b8b6..ee13591b78 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -184,6 +184,7 @@ extern struct link_map *_dl_profile_map;
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;
@@ -191,6 +192,17 @@ extern int _dl_debug_symbols;
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;
diff --git a/sysdeps/generic/libc-start.c b/sysdeps/generic/libc-start.c
index b651d73603..c02fa8a445 100644
--- a/sysdeps/generic/libc-start.c
+++ b/sysdeps/generic/libc-start.c
@@ -115,14 +115,14 @@ BP_SYM (__libc_start_main) (int (*main) (int, char **, char **),
/* 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