From: Ian Lance Taylor <ian@airs.com>
To: Roland McGrath <roland@redhat.com>
Cc: Nick Clifton <nickc@redhat.com>,
binutils@sources.redhat.com, gdb-patches@sources.redhat.com
Subject: Re: bfd function to read ELF file image from memory
Date: Mon, 19 May 2003 20:30:00 -0000 [thread overview]
Message-ID: <m38yt2he7t.fsf@gossamer.airs.com> (raw)
In-Reply-To: <200305192023.h4JKNt512940@magilla.sf.frob.com>
Roland McGrath <roland@redhat.com> writes:
> > > Still, I would just to have one calling interface that handles
> > > 32-bit and 64-bit ELF. To implement that front-end function I need
> > > a compile-time check I can use in elfcode.h that tells me whether
> > > 32-bit and/or 64-bit targets are being built. What works?
> >
> > You can check "#if ARCH_SIZE == 64" or "#if ARCH_SIZE == 32".
>
> I must be misunderstanding you, or else that can't be right. I asked about
> how front-end source code can know whether it needs to call just the 32-bit
> function from the 32-bit compile of elfcode.h, just the 64-bit function
> from the 64-bit compile of elfcode.h, or switch between the two at runtime
> based on bfd_get_arch_size.
I doubt there are any publically visible functions with name changes
from 32-bit to 64-bit. But there are certainly functions like
bfd_get_gp_size() which look at the BFD to decide where to get the
backend specific information. You could do something like that,
assuming you put the appropriate hook in the elf_backend_data struct,
which is less intrusive than putting it in the bfd_target struct.
Ian
next prev parent reply other threads:[~2003-05-19 20:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-14 1:28 Roland McGrath
2003-05-16 11:24 ` Nick Clifton
2003-05-16 21:30 ` Roland McGrath
2003-05-19 10:29 ` Nick Clifton
2003-05-19 20:24 ` Roland McGrath
2003-05-19 20:30 ` Ian Lance Taylor [this message]
2003-05-19 20:46 ` Roland McGrath
2003-05-17 5:39 ` Andrew Cagney
-- strict thread matches above, loose matches on Subject: below --
2003-05-14 1:20 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=m38yt2he7t.fsf@gossamer.airs.com \
--to=ian@airs.com \
--cc=binutils@sources.redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=nickc@redhat.com \
--cc=roland@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