aboutsummaryrefslogtreecommitdiffstats
path: root/linker/linker.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-01-17 18:36:06 -0800
committerElliott Hughes <enh@google.com>2013-01-18 22:20:06 -0800
commit1e980b6bc8315d00a07312b25486531247abd98c (patch)
tree539f2c0c63fca27d5eb6ba184d658bb0e11a32d9 /linker/linker.cpp
parente4ca88d9fa8757e4fb4056fcafa5bc15b406a2fd (diff)
downloadandroid_bionic-1e980b6bc8315d00a07312b25486531247abd98c.tar.gz
android_bionic-1e980b6bc8315d00a07312b25486531247abd98c.tar.bz2
android_bionic-1e980b6bc8315d00a07312b25486531247abd98c.zip
Fix the duplication in the debugging code.
We had two copies of the backtrace code, and two copies of the libcorkscrew /proc/pid/maps code. This patch gets us down to one. We also had hacks so we could log in the malloc debugging code. This patch pulls the non-allocating "printf" code out of the dynamic linker so everyone can share. This patch also makes the leak diagnostics easier to read, and makes it possible to paste them directly into the 'stack' tool (by using relative PCs). This patch also fixes the stdio standard stream leak that was causing a leak warning every time tf_daemon ran. Bug: 7291287 Change-Id: I66e4083ac2c5606c8d2737cb45c8ac8a32c7cfe8
Diffstat (limited to 'linker/linker.cpp')
-rwxr-xr-xlinker/linker.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 0a89b7224..c8a2a84d8 100755
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -41,13 +41,13 @@
// Private C library headers.
#include <private/bionic_tls.h>
+#include <private/debug_format.h>
#include <private/logd.h>
#include <private/ScopedPthreadMutexLocker.h>
#include "linker.h"
#include "linker_debug.h"
#include "linker_environ.h"
-#include "linker_format.h"
#include "linker_phdr.h"
/* Assume average path length of 64 and max 8 paths */
@@ -159,7 +159,7 @@ static char tmp_err_buf[768];
static char __linker_dl_err_buf[768];
#define DL_ERR(fmt, x...) \
do { \
- format_buffer(__linker_dl_err_buf, sizeof(__linker_dl_err_buf), fmt, ##x); \
+ __libc_format_buffer(__linker_dl_err_buf, sizeof(__linker_dl_err_buf), fmt, ##x); \
/* If LD_DEBUG is set high enough, send every dlerror(3) message to the log. */ \
DEBUG(fmt "\n", ##x); \
} while(0)
@@ -674,7 +674,7 @@ static void dump(soinfo *si)
static int open_library_on_path(const char* name, const char* const paths[]) {
char buf[512];
for (size_t i = 0; paths[i] != NULL; ++i) {
- int n = format_buffer(buf, sizeof(buf), "%s/%s", paths[i], name);
+ int n = __libc_format_buffer(buf, sizeof(buf), "%s/%s", paths[i], name);
if (n < 0 || n >= static_cast<int>(sizeof(buf))) {
PRINT("Warning: ignoring very long library path: %s/%s\n", paths[i], name);
continue;