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/ldso/dl-elf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ldso/ldso/dl-elf.c') diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c index 31ba11ffa..55ff31e4f 100644 --- a/ldso/ldso/dl-elf.c +++ b/ldso/ldso/dl-elf.c @@ -739,7 +739,7 @@ struct elf_resolve *_dl_load_elf_shared_library(unsigned rflags, } } #else - _dl_dprintf(_dl_debug_file, "Can't modify %s's text section." + _dl_dprintf(2, "Can't modify %s's text section." " Use GCC option -fPIC for shared objects, please.\n", libname); _dl_exit(1); @@ -1004,6 +1004,7 @@ int _dl_fixup(struct dyn_elf *rpnt, struct r_scope_elem *scope, int now_flag) return goof; } +#ifdef IS_IN_rtld /* Minimal printf which handles only %s, %d, and %x */ void _dl_dprintf(int fd, const char *fmt, ...) { @@ -1069,7 +1070,7 @@ void _dl_dprintf(int fd, const char *fmt, ...) break; } case 'x': - case 'X': + case 'p': { char tmp[22]; #if __WORDSIZE > 32 @@ -1106,6 +1107,7 @@ char *_dl_strdup(const char *string) _dl_strcpy(retval, string); return retval; } +#endif unsigned int _dl_parse_dynamic_info(ElfW(Dyn) *dpnt, unsigned long dynamic_info[], void *debug_addr, DL_LOADADDR_TYPE load_off) -- cgit v1.2.3