Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Elena Zannoni <ezannoni@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: unwind support for Linux 2.6 vsyscall DSO
Date: Mon, 06 Oct 2003 20:24:00 -0000	[thread overview]
Message-ID: <200310062024.h96KODfk030392@magilla.sf.frob.com> (raw)
In-Reply-To: Elena Zannoni's message of  Monday, 6 October 2003 15:42:28 -0400 <16257.50596.85774.226265@localhost.redhat.com>

> Ok, reading the thread, I see that you are running pretty much into
> the same problems I am running into for PIE support.  What kind of
> information is exacty exported into the auxv file?  I am wondering if
> you also have the entry point of the program there (AT_ENTRY, looking
> at the Solaris auxv.h), because if so it may change my current way of
> looking at PIE, where I am taking the info from the /proc/pid/map
> file, which is not saved in the core file, I think, while auxv is.

Try "LD_SHOW_AUXV=1 /bin/true" (i.e. put that in the environment of any
program--it's checked by the dynamic linker).  That shows you all the
information that the kernel supplies in this fashion (you have to be using
Linux 2.6 to see AT_SYSINFO and AT_SYSINFO_EHDR in there).  AT_ENTRY is
certainly there--that's how the dynamic linker knows where to jump to start
the program after initialization.  There is also AT_PHDR, which is another
thing that gives you the runtime address of something that you know the
link-time address of (PT_PHDR).  If access to AT_ENTRY alone doesn't solve
your problem with PIE, I'd like to help figure out what else it is you
need; so please raise that in a separate thread CC'd to me.

> Anyway, this issue aside, there is a target method in gdb to process the
> various entries in the map file. I think it would be appropriate to
> translate that into something similar for reading the auxv file.

Ok.  This is what Jim suggested too.  Do you have a function signature in mind?
Perhaps:

  int (*to_get_auxv_data) (char **data, size_t *size);

that fills in a malloc'd block.  (The data will be examined briefly and
thrown away, but malloc seems like the simplest clean interface to use.)

> I agree that treating this new information as much as possible as a
> shared library will make our life easier, because all the checks are
> done in the right spots already. 

and Jim wrote:

> I think you can rely on SOLIB_ADD not being called too early.  It would
> be a bug if we ever called it before the shell execs the executable under
> debug, because we use the VMA of the .dynamic section of the executable
> file to find the dynamic structure in the inferior's memory anyway.  We
> couldn't even find the shell's shared library list.

Right, it would fail to find any list at all.  If it treats that as "empty
list" then this won't be a change from before and so it's a harmless no-op.
Are we sure that is not what is happening now?  If it is, it's harmless now
but having the auxv-reading done too early would not be harmless.

> I disagree with moving the read of auxv to bfd. Gdb already processes
> plenty of /proc files (on Solaris using 2 interfaces), and has target
> methods defined for these, so I would treat the auxv case just like the
> others.

What we have been discussing most recently is only a BFD utility function
to examine raw auxv blocks that have already been read in somehow.
i.e., a trivial helper function that these target methods would use.
It doesn't matter to me whether this is in bfd/elf.c or gdb/elfread.c.



Thanks,
Roland


  reply	other threads:[~2003-10-06 20:24 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-03  8:27 Roland McGrath
2003-10-03 23:44 ` Jim Blandy
2003-10-04  0:10   ` Roland McGrath
2003-10-04  7:28     ` Jim Blandy
2003-10-04 20:27       ` Roland McGrath
2003-10-04 21:14         ` Daniel Jacobowitz
2003-10-04 22:01           ` Roland McGrath
2003-10-04 23:28             ` Daniel Jacobowitz
2003-10-06 17:14         ` Jim Blandy
2003-10-06 19:35       ` Elena Zannoni
2003-10-06 19:31 ` Elena Zannoni
2003-10-06 20:24   ` Roland McGrath [this message]
2003-10-06 21:48     ` Elena Zannoni
2003-10-06 23:59       ` Roland McGrath
2003-10-07  0:13         ` Roland McGrath
2003-10-07  2:30           ` Elena Zannoni
2003-10-07  2:40             ` Roland McGrath
2003-10-07  2:47               ` Roland McGrath
2003-10-07  3:53           ` Andrew Cagney
2003-10-07  4:07             ` Daniel Jacobowitz
2003-10-07  4:17               ` Andrew Cagney
2003-10-07  4:28             ` Roland McGrath
2003-10-08  0:02               ` Michael Snyder
2003-10-08  0:46                 ` Roland McGrath
2003-10-08 18:27                   ` Andrew Cagney
2003-10-08 21:00               ` Andrew Cagney
2003-10-08 21:47                 ` Roland McGrath
2003-10-08 23:25                   ` Elena Zannoni
2003-10-09  0:45                     ` Roland McGrath
2003-10-08 23:10                 ` Elena Zannoni
2003-10-09  0:50                   ` Roland McGrath
2003-10-08 23:53                 ` Daniel Jacobowitz
2003-10-07  0:17         ` Daniel Jacobowitz
2003-10-07 23:54         ` Michael Snyder
2003-10-08  0:07           ` Roland McGrath
2003-10-07  4:43     ` Jim Blandy
2003-10-07  4:45       ` Roland McGrath
2003-10-09 19:58         ` Kevin Buettner
2003-10-09 20:02           ` Daniel Jacobowitz
2003-10-09 20:10             ` Jim Blandy
2003-10-09 22:20               ` Roland McGrath
2003-10-09 22:49                 ` Kevin Buettner
2003-10-10  0:12                   ` Michael Snyder
2003-10-11  1:44                   ` Roland McGrath
2003-10-09 23:04                 ` Kevin Buettner
2003-10-11  1:47                   ` Roland McGrath
2003-10-15  4:33                     ` Kevin Buettner
2003-10-09 20:21             ` Kevin Buettner
2003-10-09 20:23               ` Daniel Jacobowitz
2003-10-09 20:46                 ` Kevin Buettner
2003-10-09 22:32                   ` Roland McGrath
2003-10-09 22:46                     ` Kevin Buettner
2003-10-11  1:40                       ` Roland McGrath
2003-10-09 22:07           ` Roland McGrath
2003-10-09 22:32             ` Kevin Buettner
2003-10-07  3:33 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=200310062024.h96KODfk030392@magilla.sf.frob.com \
    --to=roland@redhat.com \
    --cc=ezannoni@redhat.com \
    --cc=gdb-patches@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