about summary refs log tree commit diff
path: root/elf/dl-misc.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-03-06 17:21:43 +0000
committerUlrich Drepper <drepper@redhat.com>1998-03-06 17:21:43 +0000
commit7dea968e78d0903e5f6069f2bf72a9961f49465f (patch)
tree20dd8ba18cd1960f9c60d8ae73adea86de2a253e /elf/dl-misc.c
parent4b7814cf8a55c034f34e02c14207bb271b3aee50 (diff)
downloadglibc-7dea968e78d0903e5f6069f2bf72a9961f49465f.tar.gz
glibc-7dea968e78d0903e5f6069f2bf72a9961f49465f.tar.xz
glibc-7dea968e78d0903e5f6069f2bf72a9961f49465f.zip
Update.
1998-03-06 17:04  Ulrich Drepper  <drepper@cygnus.com>

	* libc.map: Add _dl_debug_impcalls, _dl_debug_fd, _dl_sysdep_output,
	__libc_start_main.
	* csu/Makefile (routines): Add libc-start.
	* elf/dl-error.c: Remove declaration of _dl_argv.  Include <unitsd.h>.
	* elf/dl-lookup.c: Likewise.
	* elf/dl-version.c: Likewise.
	* sysdeps/i386/dl-machine.h: Likewise.
	* elf/link.h: Declare _dl_argv, _dl_debug_fd.
	Declare _dl_sysdep_output.  Make _dl_sysdep_fatal, _dl_sysdep_error and
	_dl_sysdep_message macros which use _dl_sysdep_output.
	* elf/dl-fini.c: Write out which destructor is called while debugging.
	* elf/dl-init.c: Likewise for constructor.
	* elf/dl-load.c: Use _dl_debug_message instead of _dl_sysdep_message.
	* elf/dl-misc.c: Remove _dl_sysdep_fatal, _dl_sysdep_error and
	_dl_sysdep_message.  Add _dl_sysdep_output.
	* elf/rtld.c: Recognize LD_DEBUG_OUTPUT.  Set _dl_debug_fd if
	this file can be opened.
	For LD_DEBUG=libs also set _dl_debug_impcalls.
	* sysdeps/generic/dl-cache.c: Include unistd.h.
	* sysdeps/generic/libc-start.c: New file.
	* sysdeps/i386/elf/start.S: Don't call main directly, call
	* sysdeps/unix/sysv/linux/libc-start.c: New file.
	__libc_start_main instead.

	* elf/Makefile ($(objpfx)ld.so): Add $(load-map-file) as dependency.
Diffstat (limited to 'elf/dl-misc.c')
-rw-r--r--elf/dl-misc.c38
1 files changed, 4 insertions, 34 deletions
diff --git a/elf/dl-misc.c b/elf/dl-misc.c
index 86a0c6309d..90288525f4 100644
--- a/elf/dl-misc.c
+++ b/elf/dl-misc.c
@@ -74,42 +74,12 @@ _dl_sysdep_read_whole_file (const char *file, size_t *sizep, int prot)
 }
 
 
-void
-_dl_sysdep_fatal (const char *msg, ...)
-{
-  va_list ap;
-
-  va_start (ap, msg);
-  do
-    {
-      size_t len = strlen (msg);
-      __write (STDERR_FILENO, msg, len);
-      msg = va_arg (ap, const char *);
-    } while (msg);
-  va_end (ap);
-
-  _exit (127);
-}
-
-
-void
-_dl_sysdep_error (const char *msg, ...)
-{
-  va_list ap;
-
-  va_start (ap, msg);
-  do
-    {
-      size_t len = strlen (msg);
-      __write (STDERR_FILENO, msg, len);
-      msg = va_arg (ap, const char *);
-    } while (msg);
-  va_end (ap);
-}
+/* Descriptor to write debug messages to.  */
+int _dl_debug_fd;
 
 
 void
-_dl_sysdep_message (const char *msg, ...)
+_dl_sysdep_output (int fd, const char *msg, ...)
 {
   va_list ap;
 
@@ -117,7 +87,7 @@ _dl_sysdep_message (const char *msg, ...)
   do
     {
       size_t len = strlen (msg);
-      __write (STDOUT_FILENO, msg, len);
+      __write (fd, msg, len);
       msg = va_arg (ap, const char *);
     } while (msg);
   va_end (ap);