[git commit ldso-future] ldso: make _dl_preload static and hide _dl_ldsopath and _dl_dprintf

Peter S. Mazinger ps.m at gmx.net
Wed Mar 30 11:53:36 UTC 2011


commit: http://git.uclibc.org/uClibc/commit/?id=2643479a7fa8c4f0bbaa04b9943f771928ade6d1
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/ldso-future

While there, add restrict to _dl_dprintf to be like dprintf and
change the failure message from (null) to (bad format)

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
---
 ldso/include/ldso.h |    5 ++---
 ldso/ldso/dl-elf.c  |    4 ++--
 ldso/ldso/ldso.c    |    2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/ldso/include/ldso.h b/ldso/include/ldso.h
index ea19c92..5dcf845 100644
--- a/ldso/include/ldso.h
+++ b/ldso/include/ldso.h
@@ -52,8 +52,7 @@
 
 /* Global variables used within the shared library loader */
 extern char *_dl_library_path attribute_hidden;	/* Where we look for libraries */
-extern char *_dl_preload;			/* Things to be loaded before the libs */
-extern char *_dl_ldsopath;			/* Where the shared lib loader was found */
+extern char *_dl_ldsopath attribute_hidden;	/* Where the shared lib loader was found */
 extern const char *_dl_progname;		/* The name of the executable being run */
 extern size_t _dl_pagesize;			/* Store the page size for use later */
 
@@ -119,7 +118,7 @@ extern void *_dl_calloc(size_t __nmemb, size_t __size);
 extern void *_dl_realloc(void *__ptr, size_t __size);
 extern void _dl_free(void *);
 extern char *_dl_strdup(const char *string) attribute_hidden;
-extern void _dl_dprintf(int, const char *, ...) attribute_hidden;
+extern void _dl_dprintf(int, const char *__restrict, ...) attribute_hidden;
 #else
 # include <stdlib.h>
 # define _dl_malloc malloc
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index 8214cab..0ee1b62 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -938,7 +938,7 @@ int _dl_fixup(struct dyn_elf *rpnt, int now_flag)
 
 #ifdef IS_IN_rtld
 /* Minimal printf which handles only %s, %d, and %x */
-void _dl_dprintf(int fd, const char *fmt, ...)
+void _dl_dprintf(int fd, const char *__restrict fmt, ...)
 {
 #if __WORDSIZE > 32
 	long int num;
@@ -1015,7 +1015,7 @@ void _dl_dprintf(int fd, const char *fmt, ...)
 						break;
 					}
 				default:
-					_dl_write(fd, "(null)", 6);
+					_dl_write(fd, "(bad format)", 12);
 					break;
 			}
 
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index 25acf02..f67c042 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -49,7 +49,7 @@
 /* Global variables used within the shared library loader */
 char *_dl_library_path         = NULL;	/* Where we look for libraries */
 #ifdef __LDSO_PRELOAD_ENV_SUPPORT__
-char *_dl_preload              = NULL;	/* Things to be loaded before the libs */
+static char *_dl_preload       = NULL;	/* Things to be loaded before the libs */
 #endif
 char *_dl_ldsopath             = NULL;	/* Location of the shared lib loader */
 int _dl_errno                  = 0;	/* We can't use the real errno in ldso */
-- 
1.7.3.4



More information about the uClibc-cvs mailing list