aboutsummaryrefslogtreecommitdiff
path: root/elf/rtld.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-05-09 07:03:38 +0000
committerRoland McGrath <roland@gnu.org>1995-05-09 07:03:38 +0000
commit273d56ce89f26233cb7a703c542d2732adbea87d (patch)
treee489d7e9e6cd644a5d0d85d4b39a8c75692e3633 /elf/rtld.c
parent421f82e5cc8f81ab003247d771bcecbad799be85 (diff)
downloadglibc-273d56ce89f26233cb7a703c542d2732adbea87d.tar
glibc-273d56ce89f26233cb7a703c542d2732adbea87d.tar.gz
glibc-273d56ce89f26233cb7a703c542d2732adbea87d.tar.bz2
glibc-273d56ce89f26233cb7a703c542d2732adbea87d.zip
(__data_start): Define this symbol as the first thing in .data.
Diffstat (limited to 'elf/rtld.c')
-rw-r--r--elf/rtld.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/elf/rtld.c b/elf/rtld.c
index 0605336603..85f258a948 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -261,3 +261,27 @@ void
_dl_r_debug_state (void)
{
}
+
+#ifndef NDEBUG
+
+/* Define (weakly) our own assert failure function which doesn't use stdio.
+ If we are linked into the user program (-ldl), the normal __assert_fail
+ defn can override this one. */
+
+#include "../stdio/_itoa.h"
+
+void
+__assert_fail (const char *assertion,
+ const char *file, unsigned int line, const char *function)
+{
+ char buf[64];
+ buf[sizeof buf - 1] = '\0';
+ _dl_sysdep_fatal ("BUG IN DYNAMIC LINKER ld.so: ",
+ file, ": ", _itoa (line, buf + sizeof buf - 1, 10, 0),
+ ": ", function ?: "", function ? ": " : "",
+ "Assertion `", assertion, "' failed!\n");
+
+}
+weak_symbol (__assert_fail)
+
+#endif