summaryrefslogtreecommitdiff
path: root/ldso/ldso/ldso.c
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-03-31 00:20:50 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:35 +0200
commit6ac83250f28be17add6324129cf5890ca9920701 (patch)
tree85f1198326934961fd1875a1638f784fd1d0a700 /ldso/ldso/ldso.c
parent41494ee200f2d4f038b0fe7c79e83a7f45f8b4cd (diff)
ldso: use _dl_strdup and _dl_dprintf only in ld-uClibc.so
Add support for %p to _dl_dprintf for later corrections in debug messages. Disable _dl_debug_file if LD debugging is not enabled and change it's use to 2. The use of dprintf in elfinterp.c will spit out warnings, will be fixed in the reworked ldso. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'ldso/ldso/ldso.c')
-rw-r--r--ldso/ldso/ldso.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index d3891e269..becabd39b 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -241,7 +241,7 @@ void *_dl_malloc(size_t size)
_dl_mmap_zero = _dl_malloc_addr = _dl_mmap((void *) 0, rounded_size,
PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_UNINITIALIZE, -1, 0);
if (_dl_mmap_check_error(_dl_mmap_zero)) {
- _dl_dprintf(_dl_debug_file, "%s: mmap of a spare page failed!\n", _dl_progname);
+ _dl_dprintf(2, "%s: mmap of a spare page failed!\n", _dl_progname);
_dl_exit(20);
}
}
@@ -465,7 +465,7 @@ void *_dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
#ifndef __LDSO_STANDALONE_SUPPORT__
if (_start == (void *) auxvt[AT_ENTRY].a_un.a_val) {
- _dl_dprintf(_dl_debug_file, "Standalone execution is not enabled\n");
+ _dl_dprintf(2, "Standalone execution is not enabled\n");
_dl_exit(1);
}
#endif
@@ -579,7 +579,7 @@ of this helper program; chances are you did not intend to run this program.\n\
*/
app_tpnt = _dl_load_elf_shared_library(_dl_secure, &rpnt, _dl_progname);
if (!app_tpnt) {
- _dl_dprintf(_dl_debug_file, "can't load '%s'\n", _dl_progname);
+ _dl_dprintf(2, "can't load '%s'\n", _dl_progname);
_dl_exit(16);
}
/*
@@ -674,7 +674,7 @@ of this helper program; chances are you did not intend to run this program.\n\
}
#else
if (app_tpnt->dynamic_info[DT_TEXTREL]) {
- _dl_dprintf(_dl_debug_file, "Can't modify application's text section; use the GCC option -fPIE for position-independent executables.\n");
+ _dl_dprintf(2, "Can't modify application's text section; use the GCC option -fPIE for position-independent executables.\n");
_dl_exit(1);
}
#endif
@@ -737,7 +737,7 @@ of this helper program; chances are you did not intend to run this program.\n\
_dl_debug_early("Found TLS header for application program\n");
break;
#else
- _dl_dprintf(_dl_debug_file, "Program uses unsupported TLS data!\n");
+ _dl_dprintf(2, "Program uses unsupported TLS data!\n");
_dl_exit(1);
#endif
}
@@ -827,7 +827,7 @@ of this helper program; chances are you did not intend to run this program.\n\
#ifndef __LDSO_LDD_SUPPORT__
if (trace_loaded_objects) {
- _dl_dprintf(_dl_debug_file, "Use the ldd provided by uClibc\n");
+ _dl_dprintf(2, "Use the ldd provided by uClibc\n");
_dl_exit(1);
}
#endif
@@ -883,7 +883,7 @@ of this helper program; chances are you did not intend to run this program.\n\
else
#endif
{
- _dl_dprintf(_dl_debug_file, "%s: library '%s' "
+ _dl_dprintf(2, "%s: library '%s' "
"from LD_PRELOAD can't be preloaded: ignored.\n",
_dl_progname, str);
}
@@ -928,7 +928,7 @@ of this helper program; chances are you did not intend to run this program.\n\
}
if ((fd = _dl_open(LDSO_PRELOAD, O_RDONLY, 0)) < 0) {
- _dl_dprintf(_dl_debug_file, "%s: can't open file '%s'\n",
+ _dl_dprintf(2, "%s: can't open file '%s'\n",
_dl_progname, LDSO_PRELOAD);
break;
}
@@ -937,7 +937,7 @@ of this helper program; chances are you did not intend to run this program.\n\
PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
_dl_close(fd);
if (preload == (caddr_t) -1) {
- _dl_dprintf(_dl_debug_file, "%s:%i: can't map '%s'\n",
+ _dl_dprintf(2, "%s:%i: can't map '%s'\n",
_dl_progname, __LINE__, LDSO_PRELOAD);
break;
}
@@ -976,7 +976,7 @@ of this helper program; chances are you did not intend to run this program.\n\
else
# endif
{
- _dl_dprintf(_dl_debug_file, "%s: can't load library '%s'\n", _dl_progname, cp2);
+ _dl_dprintf(2, "%s: can't load library '%s'\n", _dl_progname, cp2);
_dl_exit(15);
}
} else {
@@ -1037,7 +1037,7 @@ of this helper program; chances are you did not intend to run this program.\n\
} else
#endif
{
- _dl_dprintf(_dl_debug_file, "%s: can't load library '%s'\n", _dl_progname, lpntstr);
+ _dl_dprintf(2, "%s: can't load library '%s'\n", _dl_progname, lpntstr);
_dl_exit(16);
}
}