about summary refs log tree commit diff
path: root/sysdeps/mach/hurd/dl-sysdep.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-11-17 02:33:47 +0000
committerRoland McGrath <roland@gnu.org>1995-11-17 02:33:47 +0000
commit4cb202902d23b3c487016e516c70640c774b90d8 (patch)
treeb72eec9b2a05cae1051a8ef6a1d272c85d707f92 /sysdeps/mach/hurd/dl-sysdep.c
parent8738e7f8b0c6d6254a31450dc528bddc8bdae0f7 (diff)
downloadglibc-4cb202902d23b3c487016e516c70640c774b90d8.tar.gz
glibc-4cb202902d23b3c487016e516c70640c774b90d8.tar.xz
glibc-4cb202902d23b3c487016e516c70640c774b90d8.zip
Thu Nov 16 06:07:49 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> cvs/libc-951117
	* sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start_cleanup): New
	function.
	(_dl_sysdep_start): Move cleanup code there.

	* Makeconfig (default-rpath): New variable.
	(link-libc): Use it.
	* elf/Makefile (ld.so): Pass -rpath=$(default-rpath).
	* elf/rtld.c (_dl_rpath): New variable.
	(_dl_start): Set it from rtld_map's DT_RPATH.
	Call _dl_setup_hash on rtld_map.
	(dl_main): Cache address of _exit in variable before relocating,
	and use that in later calls.  Call _dl_sysdep_start_cleanup before
	relocating.  Keep track of dependency order while loading; remove
	rtld_map from chain, and reinsert in proper order if there is a
	dependency on it.

	* sysdeps/generic/Makefile (make_siglist): Pass
	-DSIGNUM_H=... with config's signum.h location.
	* sysdeps/generic/make_siglist.c: Include SIGNUM_H to define
	signal numbers.
	(HAVE_STRSIGNAL, HAVE_PSIGNAL): Define these before including signame.c
	(main): Deansideclize output.

	* elf/dl-load.c (_dl_map_object): Use _dl_rpath variable in place
	of DEFAULT_RPATH macro.
	* elf/Makefile: Undo last change.

	* sysdeps/mach/hurd/dl-sysdep.c (free): Don't abort, just nop.
Diffstat (limited to 'sysdeps/mach/hurd/dl-sysdep.c')
-rw-r--r--sysdeps/mach/hurd/dl-sysdep.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index 0144958766..f8997fe025 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -159,12 +159,6 @@ unfmh();			/* XXX */
 		  _dl_hurd_data->phdrsz / sizeof (Elf32_Phdr),
 		  &_dl_hurd_data->user_entry);
 
-      /* Deallocate the reply port and task port rights acquired by
-	 __mach_init.  We are done with them now, and the user will
-	 reacquire them for himself when he wants them.  */
-      __mig_dealloc_reply_port (MACH_PORT_NULL);
-      __mach_port_deallocate (__mach_task_self (), __mach_task_self_);
-
       if (_dl_skip_args && _dl_argv[-_dl_skip_args] == (char *) p)
 	{
 	  /* We are ignoring the first few arguments, but we have no Hurd
@@ -198,6 +192,16 @@ fmh();				/* XXX */
   LOSE;
   abort ();
 }
+
+void
+_dl_sysdep_start_cleanup (void)
+{
+  /* Deallocate the reply port and task port rights acquired by
+     __mach_init.  We are done with them now, and the user will
+     reacquire them for himself when he wants them.  */
+  __mig_dealloc_reply_port (MACH_PORT_NULL);
+  __mach_port_deallocate (__mach_task_self (), __mach_task_self_);
+}
 
 int
 _dl_sysdep_open_zero_fill (void)
@@ -567,13 +571,14 @@ malloc (size_t n)
   ptr += n;
   return block;
 }
-
 weak_symbol (malloc)
 
-/* These should never be called.  */
+/* This should never be called.  */
 void *realloc (void *ptr, size_t n) { ptr += n; abort (); }
-void free (void *ptr) { ptr = ptr; abort (); }
 weak_symbol (realloc)
+
+/* This will rarely be called.  */
+void free (void *ptr) { ptr = ptr; }
 weak_symbol (free)
 
 /* Avoid signal frobnication in setjmp/longjmp.  */