From 6ac83250f28be17add6324129cf5890ca9920701 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Thu, 31 Mar 2011 00:20:50 +0200 Subject: ldso: use _dl_strdup and _dl_dprintf only in ld-uClibc.so Add support for %p to _dl_dprintf for later corrections in debug messages. Disable _dl_debug_file if LD debugging is not enabled and change it's use to 2. The use of dprintf in elfinterp.c will spit out warnings, will be fixed in the reworked ldso. Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- ldso/include/ldso.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'ldso/include') diff --git a/ldso/include/ldso.h b/ldso/include/ldso.h index fc356b0e3..f5bb6e077 100644 --- a/ldso/include/ldso.h +++ b/ldso/include/ldso.h @@ -113,7 +113,8 @@ extern int _dl_debug_file; #else # define __dl_debug_dprint(fmt, args...) do {} while (0) # define _dl_if_debug_dprint(fmt, args...) do {} while (0) -# define _dl_debug_file 2 +/* disabled on purpose, _dl_debug_file should be guarded by __SUPPORT_LD_DEBUG__ +# define _dl_debug_file 2*/ #endif /* __SUPPORT_LD_DEBUG__ */ #ifdef IS_IN_rtld @@ -149,8 +150,19 @@ extern void *_dl_realloc(void *__ptr, size_t __size); extern void _dl_free(void *); extern char *_dl_getenv(const char *symbol, char **envp); extern void _dl_unsetenv(const char *symbol, char **envp); +#ifdef IS_IN_rtld extern char *_dl_strdup(const char *string); extern void _dl_dprintf(int, const char *, ...); +#else +# include +# define _dl_strdup strdup +# include +# ifdef __USE_GNU +# define _dl_dprintf dprintf +# else +# define _dl_dprintf(fd, fmt, args...) fprintf(stderr, fmt, ## args) +# endif +#endif #ifndef DL_GET_READY_TO_RUN_EXTRA_PARMS # define DL_GET_READY_TO_RUN_EXTRA_PARMS -- cgit v1.2.3