public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Kris Warkentin" <kewarken@qnx.com>
To: <Richard.Earnshaw@arm.com>
Cc: "Kevin Buettner" <kevinb@redhat.com>,
	"Gdb@Sources.Redhat.Com" <gdb@sources.redhat.com>
Subject: Re: problem with fetch_link_map_offsets
Date: Tue, 10 Jun 2003 14:53:00 -0000	[thread overview]
Message-ID: <050801c32f60$21211d10$0202040a@catdog> (raw)
In-Reply-To: <047001c32f4a$d31eead0$0202040a@catdog>

> > > Yeah but....a QNX binary is just an ordinary elf binary.  There are no
> > > special sections or magic in there for the sniffer to catch.  Hence my
> > > problem.  Perhaps it should be returning unknown so that another
sniffer
> > > (like my one liner) could get it?
> > >
> >
> > NetBSD binaries look like ordinary ELF too, as do Linux.  The only way
to
> > resolve this is to arange for the crt0.o file to contain some magic that
> > GDB can find.  Normally this is a special .note section.
> >
> > Can you not arrange for QNX binaries to have such a note and then add
> that.
>
> Perhaps.  I'll have to talk to some of the folk here.  I think it would be
> really handy to be able to recognize one of our binaries.  Thanks for the
> suggestion.

Here's a fix that works right now:  If I put the code below into
generic_elf_osabi_sniff_abi_tag_sections(), the sniffer does its job.  The
problem with this is that it will only work on dynamically linked binaries.
Convenient as a stop-gap and for a certain amount of backwards
compatability.  I think the .note.qnxnto.ident section is still a good idea
though.  I tried putting one into our crtbegin.o but then programs were core
dumping so I'm doing something wrong there.  I'll have to talk to the OS
folks.

cheers,

Kris

  /* QNX Neutrino has ldqnx.so as its linker.  */
  if (strcmp (name, ".interp") == 0 && sectsize > 0)
    {
      char *buf = alloca(sectsize);
      bfd_get_section_contents(abfd, sect, buf, 0, sectsize);
      buf[sectsize] = '\0'; /* Safety first boys and girls.  */
      if(strstr(buf, "ldqnx.so"))
        *os_ident_ptr = GDB_OSABI_QNXNTO;
      return;
    }


  parent reply	other threads:[~2003-06-10 14:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-28 20:21 Kris Warkentin
2003-04-28 21:23 ` Andrew Cagney
2003-04-29 13:27   ` Kris Warkentin
2003-04-29 15:07 ` Kevin Buettner
2003-04-29 15:25   ` Kris Warkentin
2003-04-29 16:28     ` Kevin Buettner
2003-04-29 21:18       ` Kris Warkentin
2003-06-09 21:20         ` Kris Warkentin
2003-06-09 21:34           ` Kevin Buettner
2003-06-09 21:40             ` Kris Warkentin
2003-06-10 10:12               ` Richard Earnshaw
2003-06-10 12:21                 ` Kris Warkentin
2003-06-10 12:26                   ` Richard Earnshaw
2003-06-10 14:53                   ` Kris Warkentin [this message]
2003-06-11 19:05                     ` Kris Warkentin

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='050801c32f60$21211d10$0202040a@catdog' \
    --to=kewarken@qnx.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gdb@sources.redhat.com \
    --cc=kevinb@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).