public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Andrew Cagney <ac131313@redhat.com>
Cc: gdb@sources.redhat.com
Subject: Re: gdb support for Linux vsyscall DSO
Date: Sat, 10 May 2003 19:42:00 -0000	[thread overview]
Message-ID: <200305101942.h4AJgoe32699@magilla.sf.frob.com> (raw)
In-Reply-To: Daniel Jacobowitz's message of  Saturday, 10 May 2003 14:13:48 -0400 <20030510181348.GA14436@nevyn.them.org>

For some reason I didn't see Andrew's message in my mailbox, though I see
it in the mailing list archives (I'm not on the mailing list myself).


> On Sat, May 10, 2003 at 01:24:39PM -0400, Andrew Cagney wrote:
> > Roland,
> > 
> > How exactly does this vsyscall memory region(1) come to be?  For 
> > instance, how does GLIBC come to know where it is - GLIBC would need the 
> > region's address to perform a syscall to find the regions address.  If 
> > the underlying mechanism is explained (this is far from a tranditional 
> > lib*.so), GDB developers will be in a better position to judge the best 
> > way of handling this.
> 
> It's created initially by the kernel, and its address is passed via the
> auxilliary vector on the stack, and read by ld.so.  Roland explained
> later in his essay about some ways to get at the aux vector.

The memory is always there.  As I explained near the end of my long
message, the kernel tells the program where to find it with the
AT_SYSINFO_EHDR (and AT_SYSINFO, which is now redundant) elements in the
aux vector on the stack at at startup.

The glibc dynamic linker code sets up its own data structures for the
vsyscall DSO as if it had been mapped itself.  There is no special case in
glibc that points at the eh_frame info.  Exception handling in libgcc
already uses a dynamic linker callback to see the phdrs of all DSOs in core
and follow their PT_GNU_EH_FRAME pointers.  The vsyscall DSO's eh_frame
info is found by this mechanism like other DSOs' are.  

> > Is there, for instance, anything to prevent GDB locating the symbol (in 
> > GLIBC) that points at the vsyscall area and then using that?  Similar 
> > for any mapped in eh_frame region.  Assuming that GDB has a well defined 
> > trigger point for knowing when the symbol can be referenced - but GDB 
> > would need that anyway.

Nothing prevents it but class.  The vsyscall DSO is a Linux kernel feature,
not a glibc feature.  It isn't proper layering for the support for it to
depend on glibc internals.  There are any number of things that could be
done simpler by presuming the form of glibc internals and requiring they be
there.  That doesn't make them the right things to do.


I said "the purpose of the vsyscall DSO for me is to make the gdb support
possible".  Perhaps that gave the wrong impression.  The gdb issue is what
made me personally really interested in implementing it, but was only one
of many factors leading to the choice of having an ELF DSO image provided
by the kernel.  The DSO plan is here to stay and does not exist solely for
the benefit of gdb.


Thanks,
Roland

  reply	other threads:[~2003-05-10 19:42 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-09  9:45 gdb/dwarf-frame.c Roland McGrath
2003-05-09 13:41 ` gdb/dwarf-frame.c Daniel Jacobowitz
2003-05-09 14:10   ` gdb/dwarf-frame.c Elena Zannoni
2003-05-09 14:56     ` NPTL thread support H. J. Lu
2003-05-09 15:44       ` Elena Zannoni
     [not found]         ` <20030509091522.A2960@lucon.org>
     [not found]           ` <16059.55278.841645.134311@localhost.redhat.com>
2003-05-11 20:46             ` H. J. Lu
2003-05-12 19:24               ` J. Johnston
2003-05-12 20:08                 ` H. J. Lu
2003-05-12 20:15                   ` David Carlton
2003-05-12 21:09                     ` Andrew Cagney
2003-05-12 21:18                       ` David Carlton
2003-05-12 21:23                         ` Daniel Jacobowitz
2003-05-12 20:17                   ` Elena Zannoni
2003-05-09 17:01     ` gdb/dwarf-frame.c Andrew Cagney
2003-05-09 17:08       ` gdb/dwarf-frame.c Elena Zannoni
2003-05-09 19:43       ` gdb/dwarf-frame.c Mark Kettenis
2003-05-09 21:19         ` gdb/dwarf-frame.c Roland McGrath
2003-05-09 21:48           ` gdb/dwarf-frame.c Elena Zannoni
2003-05-09 22:17             ` gdb/dwarf-frame.c Roland McGrath
2003-05-09 21:54           ` gdb/dwarf-frame.c Andrew Cagney
2003-05-09 21:58           ` gdb/dwarf-frame.c Daniel Jacobowitz
2003-05-09 22:18             ` gdb/dwarf-frame.c Roland McGrath
2003-05-09 22:28         ` gdb/dwarf-frame.c Andrew Cagney
2003-05-09 22:33           ` gdb/dwarf-frame.c Roland McGrath
2003-05-09 20:32   ` gdb/dwarf-frame.c Roland McGrath
2003-05-09 19:36 ` gdb/dwarf-frame.c Mark Kettenis
2003-05-09 21:34   ` gdb/dwarf-frame.c Roland McGrath
2003-05-09 21:46     ` gdb/dwarf-frame.c Elena Zannoni
2003-05-10  7:07   ` gdb support for Linux vsyscall DSO Roland McGrath
2003-05-10 17:24     ` Andrew Cagney
2003-05-10 18:13       ` Daniel Jacobowitz
2003-05-10 19:42         ` Roland McGrath [this message]
2003-05-10 21:49           ` Andrew Cagney
2003-05-12 19:23             ` Andrew Cagney
2003-05-13  2:29               ` Roland McGrath
2003-05-13 16:03                 ` Andrew Cagney
2003-05-10 21:28       ` Roland McGrath
2003-05-10 17:55     ` Mark Kettenis
2003-05-10 20:27       ` Roland McGrath
2003-05-11 23:14         ` Mark Kettenis
2003-05-13  1:53           ` Roland McGrath
2003-05-15 21:26             ` Mark Kettenis
2003-05-16  2:25               ` Roland McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200305101942.h4AJgoe32699@magilla.sf.frob.com \
    --to=roland@redhat.com \
    --cc=ac131313@redhat.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).