From: "Kris Warkentin" <kewarken@qnx.com>
To: "Kris Warkentin" <kewarken@qnx.com>,
"Andrew Cagney" <ac131313@redhat.com>
Cc: <binutils@sources.redhat.com>, <gdb@sources.redhat.com>
Subject: Re: Adding QNX core-file support to bfd
Date: Wed, 29 Jan 2003 17:48:00 -0000 [thread overview]
Message-ID: <151901c2c7be$84b2f6f0$0202040a@catdog> (raw)
In-Reply-To: <101601c2c634$c78ab2f0$0202040a@catdog>
> > > Right now, we have a special elfcore_grok_qnx_note() function that is
> called
> > > in elf.c in much the same way as elfcore_grok_netbsd_note() is called
> (check
> > > the namedata for a string and call the function if it matches).
> >
> > It looks like a dispatch table is needed so that both the QNX and can
> > have their support conditionally linked in.
>
> This would be a good idea. All we need to do is check if the namedata is
> "QNX" (NetBSD looks for "NetBSD-CORE"). Perhaps something like:
>
> if( elfcore_grok_special_note && core_namedata_str && strncmp(in.namedata,
> core_namedata_str, strlen(core_namedata_str)) == 0){
> if(!elfcore_grok_special_note(abfd, &in))
> goto error;
> }
>
> Then a target just initializes elfcore_grok_special_note and
> core_namedata_str and all it's other functionality can be in a separate
> object.
I'm having trouble coming up with a nice way to do this. Two problems:
1) Where do I initialize things like this? Conceivably it could be done in
the 'core_file_p' function but in our case though, we're just using the
generic elf32 stuff. The other problem is that I'm not sure when
core_file_p gets called. Our core file support is in elfcore_read_notes()
in elf.c. We don't have any special code other than that to recognize a QNX
core.
2) How do I deal with the situation when bfd is configured for all targets?
What I had thought to do was to set up a list of alternative core-file
recognition patterns and the corresponding function hooks and then the
target could add its own entries to the list. That way elfcore_read_notes()
could just run through the list to see what type of core it has.
What about struct elf_backend_data? We could add a special 'grok_note
function hook' field which elfcore_grok_note() could check first. It still
leaves me with the problem of where to initialize the backend data but I
think it might be a cleaner solution.
cheers,
Kris
prev parent reply other threads:[~2003-01-29 17:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-23 22:06 Kris Warkentin
2003-01-24 8:51 ` Nick Clifton
2003-01-24 15:08 ` Kris Warkentin
2003-01-27 17:19 ` Andrew Cagney
2003-01-27 18:49 ` Kris Warkentin
2003-01-29 17:48 ` Kris Warkentin [this message]
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='151901c2c7be$84b2f6f0$0202040a@catdog' \
--to=kewarken@qnx.com \
--cc=ac131313@redhat.com \
--cc=binutils@sources.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