This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [patch] Fix vDSO l_name for GDB's: Can't read pathname forload map: Input/output error.
- From: Daniel Jacobowitz <drow at false dot org>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Sun, 4 Oct 2009 18:01:25 -0400
- Subject: Re: [patch] Fix vDSO l_name for GDB's: Can't read pathname forload map: Input/output error.
- References: <20091004161706.GA27450@host0.dyn.jankratochvil.net>
On Sun, Oct 04, 2009 at 06:17:06PM +0200, Jan Kratochvil wrote:
> else
> {
> /* Create a link_map for the executable itself.
> - This will be what dlopen on "" returns. */
> - main_map = _dl_new_object ((char *) "", "", lt_executable, NULL,
> + This will be what dlopen on "" returns.
> +
> + The memory pointed to by l_name should be accessible also from the
> + dumped core files where shared readonly segments are not present. */
> + main_map = _dl_new_object (&char_zero, "", lt_executable, NULL,
> __RTLD_OPENEXEC, LM_ID_BASE);
> assert (main_map != NULL);
> assert (main_map == GL(dl_ns)[LM_ID_BASE]._ns_loaded);
This only works by luck - because the static variable is likely to be
on a page with something else that caused a copy-on-write...
--
Daniel Jacobowitz
CodeSourcery