diff options
| author | David 'Digit' Turner <digit@google.com> | 2010-01-20 12:36:51 -0800 |
|---|---|---|
| committer | David 'Digit' Turner <digit@google.com> | 2010-02-11 10:46:48 -0800 |
| commit | 5c734644eebf8d01be1e86cbe20a111a5c5a2738 (patch) | |
| tree | 5e442dc0157ec487f51a65f85f87fe2bd66fd0cf /linker/dlfcn.c | |
| parent | e100f52f4ad1b70762bbcc5ad9828bd258917ee5 (diff) | |
| download | bionic-5c734644eebf8d01be1e86cbe20a111a5c5a2738.zip bionic-5c734644eebf8d01be1e86cbe20a111a5c5a2738.tar.gz bionic-5c734644eebf8d01be1e86cbe20a111a5c5a2738.tar.bz2 | |
Fix debug output in the dynamic linker.
This provides a mini-printf implementation that reduces the
size of the dynamic linker by 25 KB, by preventing the drag of
formatting-related routines from the C library.
Also allow traces to be sent to the log, instead of stdout.
NOTE: You now need to modify Android.mk to enable/disable debug
output.
Diffstat (limited to 'linker/dlfcn.c')
| -rw-r--r-- | linker/dlfcn.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/linker/dlfcn.c b/linker/dlfcn.c index 039926c..bc6b95a 100644 --- a/linker/dlfcn.c +++ b/linker/dlfcn.c @@ -17,6 +17,7 @@ #include <pthread.h> #include <stdio.h> #include "linker.h" +#include "linker_format.h" /* This file hijacks the symbols stubbed out in libdl.so. */ @@ -45,7 +46,7 @@ static pthread_mutex_t dl_lock = PTHREAD_MUTEX_INITIALIZER; static void set_dlerror(int err) { - snprintf(dl_err_buf, sizeof(dl_err_buf), "%s: %s", dl_errors[err], + format_buffer(dl_err_buf, sizeof(dl_err_buf), "%s: %s", dl_errors[err], linker_get_error()); dl_err_str = (const char *)&dl_err_buf[0]; }; |
