Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: aristovski@qnx.com, gdb-patches@sources.redhat.com
Subject: Re: [patch] solib-svr4.c - allow reading linkmap info from core 	without  executable
Date: Fri, 19 Jun 2009 14:56:00 -0000	[thread overview]
Message-ID: <20090619145624.GA14310@caradoc.them.org> (raw)
In-Reply-To: <200906191442.n5JEg4QW029005@brahms.sibelius.xs4all.nl>

On Fri, Jun 19, 2009 at 04:42:04PM +0200, Mark Kettenis wrote:
> > From: Aleksandar Ristovski <aristovski@qnx.com>
> > Date:  Fri, 19 Jun 2009 10:16:26 -0400
> > 
> > Pedro Alves wrote:
> > > 
> > > I was thinking on pushing the elf check a bit down instead,
> > > like the below.  However, having now tested this, I see that
> > > this doesn't work in most of the cores I have here (x86_64-linux).
> > > In most cases I see, the segment that would contain the program
> > > headers, as indicated by auxv info, isn't included in the
> > > core...
> > > 
> > > (objdump -h)
> > > Idx Name          Size      VMA               LMA               File off  Algn
> > >   :
> > >   6 load1         00000000  0000000000400000  0000000000000000  000008f8  2**0
> > >                   ALLOC, READONLY, CODE
> > >   :
> > > 
> 
> I'm somewhat amazed that the Linux kernel doesn't dump the auxv stuff.
> Without the auxv data, debugging core dumps of PIE executables will be
> impossible.
> 
> Perhaps the kernel does include the information in the does, but bfd
> doesn't have the necessary code to turn it into an .auxv section?

That works fine:

drow@caradoc:~% readelf -n core

Notes at offset 0x00000430 with length 0x00000344:
  Owner         Data size       Description
  CORE          0x00000150      NT_PRSTATUS (prstatus structure)
  CORE          0x00000088      NT_PRPSINFO (prpsinfo structure)
  CORE          0x00000130      NT_AUXV (auxiliary vector)

drow@caradoc:~% objdump -h core

core:     file format elf64-x86-64

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 note0         00000344  0000000000000000  0000000000000000  00000430  2**0
                  CONTENTS, READONLY
  1 .reg/14342    000000d8  0000000000000000  0000000000000000  000004b4  2**2
                  CONTENTS
  2 .reg          000000d8  0000000000000000  0000000000000000  000004b4  2**2
                  CONTENTS
  3 .auxv         00000130  0000000000000000  0000000000000000  00000644  2**3
                  CONTENTS

But reading it again, Pedro said "the segment that would contain the
program headers, as indicated by auxv info".  That's probably not
dumped by default, as it's read-only.

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2009-06-19 14:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-29 20:42 Aleksandar Ristovski
2009-06-10 22:07 ` Pedro Alves
2009-06-11 13:39   ` Aleksandar Ristovski
2009-06-18 14:04     ` Aleksandar Ristovski
2009-06-18 23:03     ` Pedro Alves
2009-06-19 14:16       ` Aleksandar Ristovski
2009-06-19 14:42         ` Mark Kettenis
2009-06-19 14:56           ` Daniel Jacobowitz [this message]
2009-06-19 15:00           ` Pedro Alves
2009-06-19 16:03             ` Aleksandar Ristovski
2009-06-20  0:17               ` Pedro Alves

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=20090619145624.GA14310@caradoc.them.org \
    --to=drow@false.org \
    --cc=aristovski@qnx.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mark.kettenis@xs4all.nl \
    /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