From d38a104b7589e2ef02b2d1392305352a009ed12f Mon Sep 17 00:00:00 2001 From: Alexander Kabaev Date: Thu, 13 Feb 2003 17:05:10 +0000 Subject: [PATCH] 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(-) diff --git a/libexec/rtld-elf/malloc.c b/libexec/rtld-elf/malloc.c index ed0d1fd1ffce..da94a552ff19 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 4408d631208d..1febf0ccbd89 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 b4250132ea3e..274bfce8ee40 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)))