summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ldso/ldso/Makefile6
-rw-r--r--ldso/ldso/ldso.c10
2 files changed, 13 insertions, 3 deletions
diff --git a/ldso/ldso/Makefile b/ldso/ldso/Makefile
index 55d3f00c6..5e9a71f63 100644
--- a/ldso/ldso/Makefile
+++ b/ldso/ldso/Makefile
@@ -27,6 +27,12 @@ DOPIC=true
include $(TOPDIR)Rules.mak
LDSO_FULLNAME=ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).so
+# Enable this to enable all the code needed to support traditional ldd
+# (i.e. where the shared library loader does all the heavy lifting)
+# Since this currently only saves about 300 bytes, I'm going to leave
+# it enabled...
+XXFLAGS+= -DDL_TRACE
+
# Enable this to enable debugging output from ld.so
#XXFLAGS+= -DDL_DEBUG
#XXFLAGS+= -DDL_DEBUG_SYMBOLS
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index 36580e26a..0a08d2bf7 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -145,9 +145,7 @@ char *_dl_ldsopath = 0;
static char *_dl_not_lazy = 0;
static char *_dl_malloc_addr, *_dl_mmap_zero;
-#ifdef DL_TRACE
static char *_dl_trace_loaded_objects = 0;
-#endif
static int (*_dl_elf_main) (int, char **, char **);
static int (*_dl_elf_init) (void);
void *(*_dl_malloc_function) (int size) = NULL;
@@ -701,8 +699,12 @@ static void _dl_get_ready_to_run(struct elf_resolve *tpnt, struct elf_resolve *a
}
}
-#ifdef DL_TRACE
_dl_trace_loaded_objects = _dl_getenv("LD_TRACE_LOADED_OBJECTS", envp);
+#ifndef DL_TRACE
+ if (_dl_trace_loaded_objects) {
+ _dl_dprintf(2, "Use the ldd provided by uClibc\n");
+ _dl_exit(1);
+ }
#endif
/* OK, we now have the application in the list, and we have some
basic stuff in place. Now search through the list for other shared
@@ -944,6 +946,8 @@ static void _dl_get_ready_to_run(struct elf_resolve *tpnt, struct elf_resolve *a
if (_dl_trace_loaded_objects) {
char *_dl_warn = 0;
+ _dl_dprintf(1, "\t%s => %s (0x%x)\n", tpnt->libname + (_dl_strlen(_dl_ldsopath)) + 1,
+ tpnt->libname, tpnt->loadaddr);
_dl_warn = _dl_getenv("LD_WARN", envp);
if (!_dl_warn)
_dl_exit(0);