about summary refs log tree commit diff
path: root/sysdeps/generic/libc-start.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>1998-04-06 19:08:46 +0000
committerRichard Henderson <rth@redhat.com>1998-04-06 19:08:46 +0000
commit4194bc660f0768b1e0999f4e0a7723a35b00953c (patch)
tree7576ff43a34860662e9cc8f9b6438cd2ff0ac31e /sysdeps/generic/libc-start.c
parenta55400166da3b4713ea9258be7ee739bdbd2d607 (diff)
downloadglibc-4194bc660f0768b1e0999f4e0a7723a35b00953c.tar.gz
glibc-4194bc660f0768b1e0999f4e0a7723a35b00953c.tar.xz
glibc-4194bc660f0768b1e0999f4e0a7723a35b00953c.zip
* elf/dl-runtime.c (fixup, profile_fixup): The final arg to _dl_lookup_*symbol is DL_LOOKUP_NOPLT not ELF_MACHINE_JMP_SLOT. * elf/elf.h (EM_SPARC64): Remove. (EM_SPARC32PLUS, EM_SPARCV9): Add. (HWCAP_SPARC_V9): Add. * elf/ldsodefs.h (_dl_hwcap): Declare. * sysdeps/sparc/sparc32/dl-machine.h (_dl_hwcap, _dl_hwcap_mask): Weaken so dlopen from static progies works. (WEAKADDR): New macro. (elf_machine_matches_host): Accept EM_SPARC32PLUS on a v9 cpu. (LD_SO_PRELOAD): New macro. (elf_machine_fixup_plt): Cope with weak _dl_hwcap. (elf_machine_rela): Weaken _dl_rtld_map. * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Rename __libc_clone to __clone, and remove the later's alias. * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c: Copy to/from the kernel's structure.
1998-04-06  Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz>

	* elf/dl-runtime.c (fixup, profile_fixup): The final arg to
	_dl_lookup_*symbol is DL_LOOKUP_NOPLT not ELF_MACHINE_JMP_SLOT.

	* elf/elf.h (EM_SPARC64): Remove.
	(EM_SPARC32PLUS, EM_SPARCV9): Add.
	(HWCAP_SPARC_V9): Add.

	* elf/ldsodefs.h (_dl_hwcap): Declare.
	* sysdeps/sparc/sparc32/dl-machine.h (_dl_hwcap, _dl_hwcap_mask):
	Weaken so dlopen from static progies works.
	(WEAKADDR): New macro.
	(elf_machine_matches_host): Accept EM_SPARC32PLUS on a v9 cpu.
	(LD_SO_PRELOAD): New macro.
	(elf_machine_fixup_plt): Cope with weak _dl_hwcap.
	(elf_machine_rela): Weaken _dl_rtld_map.

	* sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Rename __libc_clone
	to __clone, and remove the later's alias.
	* sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.

	* sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c: Copy to/from
	the kernel's structure.

	* sysdeps/generic/libc-start.c: Allow init and fini to be null.
Diffstat (limited to 'sysdeps/generic/libc-start.c')
-rw-r--r--sysdeps/generic/libc-start.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sysdeps/generic/libc-start.c b/sysdeps/generic/libc-start.c
index 2e777a84d2..3225a7ce5d 100644
--- a/sysdeps/generic/libc-start.c
+++ b/sysdeps/generic/libc-start.c
@@ -40,13 +40,13 @@ __libc_start_main (int (*main) (int, char **, char **), int argc,
   __libc_multiple_libcs = dummy_addr && !_dl_starting_up;
 #endif
 
+  /* Set the global _environ variable correctly.  */
+  __environ = &argv[argc + 1];
+
   /* Register the destructor of the dynamic linker if there is any.  */
   if (rtld_fini != NULL)
     atexit (rtld_fini);
 
-  /* Set the global _environ variable correctly.  */
-  __environ = &argv[argc + 1];
-
   /* Call the initializer of the libc.  */
 #ifdef PIC
   if (_dl_debug_impcalls)
@@ -54,15 +54,17 @@ __libc_start_main (int (*main) (int, char **, char **), int argc,
 #endif
   __libc_init_first (argc, argv, __environ);
 
-  /* Call the initializer of the program.  */
+  /* Register the destructor of the program, if any.  */
+  if (fini)
+    atexit (fini);
+
+  /* Call the initializer of the program, if any.  */
 #ifdef PIC
   if (_dl_debug_impcalls)
     _dl_debug_message (1, "\ninitialize program: ", argv[0], "\n\n", NULL);
 #endif
-  (*init) ();
-
-  /* Register the destructor of the program.  */
-  atexit (fini);
+  if (init)
+    (*init) ();
 
 #ifdef PIC
   if (_dl_debug_impcalls)