From debc727d4ef44707cae4173ed0d3a03f7057b546 Mon Sep 17 00:00:00 2001 From: kan Date: Thu, 13 Feb 2003 17:05:10 +0000 Subject: Remove /usr/lib/elf from a default search path. Move xprintf to malloc.c, it is only used there. Make static. Submitted by: phantom --- libexec/rtld-elf/malloc.c | 17 ++++++++++++++++- libexec/rtld-elf/rtld.c | 17 ----------------- libexec/rtld-elf/rtld.h | 2 +- 3 files changed, 17 insertions(+), 19 deletions(-) (limited to 'libexec') diff --git a/libexec/rtld-elf/malloc.c b/libexec/rtld-elf/malloc.c index ed0d1fd..da94a55 100644 --- a/libexec/rtld-elf/malloc.c +++ b/libexec/rtld-elf/malloc.c @@ -147,7 +147,7 @@ botch(s) #endif /* Debugging stuff */ -extern void xprintf(const char *, ...); +static void xprintf(const char *, ...); #define TRACE() xprintf("TRACE %s:%d\n", __FILE__, __LINE__) void * @@ -483,3 +483,18 @@ int n; #endif return n; } + +/* + * Non-mallocing printf, for use by malloc itself. + */ +static void +xprintf(const char *fmt, ...) +{ + char buf[256]; + va_list ap; + + va_start(ap, fmt); + vsprintf(buf, fmt, ap); + (void)write(STDOUT_FILENO, buf, strlen(buf)); + va_end(ap); +} diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 4408d63..1febf0c 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -118,7 +118,6 @@ static void unload_object(Obj_Entry *); static void unref_dag(Obj_Entry *); void r_debug_state(struct r_debug*, struct link_map*); -void xprintf(const char *, ...) __printflike(1, 2); /* * Data declarations. @@ -2172,19 +2171,3 @@ unref_dag(Obj_Entry *root) objlist_remove(&elm->obj->dldags, root); } } - -/* - * Non-mallocing printf, for use by malloc itself. - * XXX - This doesn't belong in this module. - */ -void -xprintf(const char *fmt, ...) -{ - char buf[256]; - va_list ap; - - va_start(ap, fmt); - vsprintf(buf, fmt, ap); - (void)write(STDOUT_FILENO, buf, strlen(buf)); - va_end(ap); -} diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index b425013..274bfce 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -39,7 +39,7 @@ #include "rtld_machdep.h" #ifndef STANDARD_LIBRARY_PATH -#define STANDARD_LIBRARY_PATH "/usr/lib/elf:/usr/lib" +#define STANDARD_LIBRARY_PATH "/usr/lib" #endif #define NEW(type) ((type *) xmalloc(sizeof(type))) -- cgit v1.1