A patch for dl-profile

H . J . Lu hjl@lucon.org
Wed May 16 21:29:00 GMT 2001


The current ld.so will segfault if the profile data file is wrong:

# LD_PROFILE=libc.so.6 ls
/var/tmp/libc.so.6.profile: file is no correct profile data file for `libc.so.6'
zsh: 11010 segmentation fault  LD_PROFILE=libc.so.6 ls

This patch will terminate ld.so before segfault.


H.J.
---
2001-05-16  H.J. Lu  <hjl@gnu.org>

	* elf/dl-profile.c (_dl_start_profile): Make incorrect date
	file a fatal error.

--- elf/dl-profile.c.bad	Tue Feb 27 22:22:10 2001
+++ elf/dl-profile.c	Wed May 16 20:56:52 2001
@@ -316,9 +316,9 @@ _dl_start_profile (struct link_map *map,
       if (addr != NULL)
 	__munmap ((void *) addr, expected_size);
 
-      _dl_error_printf ("%s: file is no correct profile data file for `%s'\n",
+      _dl_fatal_printf ("%s: file is no correct profile data file for `%s'\n",
 			filename, _dl_profile);
-      return;
+      /* NOTREACHED */
     }
 
   addr = (struct gmon_hdr *) __mmap (NULL, expected_size, PROT_READ|PROT_WRITE,



More information about the Libc-alpha mailing list