Commit graph

15 commits

Author SHA1 Message Date
Elliott Hughes
1e980b6bc8 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
2013-01-18 22:20:06 -08:00
Elliott Hughes
9c94fc9fbe Tone down some of the overly-verbose linker logging.
We don't need to see every dlopen(3)/dlsym(3) failure unless LD_DEBUG is on.

Change-Id: I1edfe8b72f32ff54dd30e1acf32e20d470d5e9f7
2012-11-05 09:11:43 -08:00
Elliott Hughes
61a9ccb41e Make dynamic linker debugging always available.
If you need to build your own linker to get debugging, the debugging
is never available when you need it.

Change-Id: I5ff7e55753459d49a2990f25d9aa155e0b8602e0
2012-11-02 13:46:23 -07:00
Elliott Hughes
18a206c81d More dynamic linker cleanup.
I still want to break linker_format out into its own library so we can reuse
it for malloc debugging and so forth. (There are many similar pieces of code
in bionic, but the linker's one seems to be the most complete/functional.)

Change-Id: If3721853d28937c8e821ca1d23cf200e228a409a
2012-10-30 16:35:38 -07:00
Nick Kralevich
3697b52605 Allow linker to compile with -DLINKER_DEBUG=1
Change-Id: I27e734048cbcb9ed936369115582b3c734de1280
2012-08-24 17:11:45 -07:00
Elliott Hughes
bedfe38b8b More cleanup.
Make more stuff static, remove some dead code, and fix a few typos.

Change-Id: I010b0eadeaf61e2899c37014ad1e7082c70bd510
2012-08-14 14:07:59 -07:00
David 'Digit' Turner
5c734644ee 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.
2010-02-11 10:46:48 -08:00
Dima Zavin
2e85579c34 linker: Make the errors reported by dlopen/dlsym be more useful.
Changed it so that when the linker generates error messages, they are
scribbled away into a buffer that dlfcn and friends can read from.

Since the error messages are generetad with snprintf, and snprintf
MAY call malloc during some code paths, we now link against a version
of libc that does not contain malloc/free/realloc/calloc. We then define
malloc and friends in the dynamic loader, and make them abort() if they
are ever called.

Signed-off-by: Dima Zavin <dima@android.com>
2009-05-27 20:16:19 -07:00
The Android Open Source Project
1dc9e472e1 auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
The Android Open Source Project
1767f908af auto import from //depot/cupcake/@135843 2009-03-03 18:28:13 -08:00
The Android Open Source Project
a799b53f10 auto import from //depot/cupcake/@132589 2009-03-03 14:03:51 -08:00
The Android Open Source Project
fe5745033a auto import from //depot/cupcake/@137055 2009-03-02 22:54:14 -08:00
The Android Open Source Project
9f65adf2ba auto import from //branches/cupcake/...@130745 2009-02-10 15:43:56 -08:00
The Android Open Source Project
4e468ed2eb Code drop from //branches/cupcake/...@124589 2008-12-17 18:03:48 -08:00
The Android Open Source Project
a27d2baa0c Initial Contribution 2008-10-21 07:00:00 -07:00