From: Elena Zannoni <ezannoni@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA] rs6000-tdep.c: figure out e500 machine from bfd.
Date: Tue, 20 Aug 2002 15:38:00 -0000 [thread overview]
Message-ID: <15714.50288.526139.379896@localhost.redhat.com> (raw)
A powerpc executable doesn't have indications of which variant it is
meant to run on. The design choice was that in theory everything
should run on any version of the processor. For gdb's purposes we
have now a new section that is specific to e500, which can help us
identify the executable and set all the architecture dependents bits
in the correct way.
Elena
[sorry Kevin, it's almost over...:-)]
2002-08-20 Elena Zannoni <ezannoni@redhat.com>
* rs6000-tdep.c (rs6000_gdbarch_init): Figure out whether we have
an e500 executable.
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/uberbaum/gdb/rs6000-tdep.c,v
retrieving revision 1.75
diff -u -p -r1.75 rs6000-tdep.c
--- rs6000-tdep.c 20 Aug 2002 22:24:29 -0000 1.75
+++ rs6000-tdep.c 20 Aug 2002 22:36:03 -0000
@@ -2426,6 +2426,7 @@ rs6000_gdbarch_init (struct gdbarch_info
bfd abfd;
int sysv_abi;
enum gdb_osabi osabi = GDB_OSABI_UNKNOWN;
+ asection *sect;
from_xcoff_exec = info.abfd && info.abfd->format == bfd_object &&
bfd_get_flavour (info.abfd) == bfd_target_xcoff_flavour;
@@ -2499,6 +2500,20 @@ rs6000_gdbarch_init (struct gdbarch_info
tdep = xmalloc (sizeof (struct gdbarch_tdep));
tdep->wordsize = wordsize;
tdep->osabi = osabi;
+
+ /* For e500 executables, the apuinfo section is of help here. */
+ if (info.abfd)
+ {
+ sect = bfd_get_section_by_name (info.abfd, ".PPC.EMB.apuinfo");
+ if (sect)
+ {
+ arch = info.bfd_arch_info->arch;
+ mach = bfd_mach_ppc_e500;
+ bfd_default_set_arch_mach (&abfd, arch, mach);
+ info.bfd_arch_info = bfd_get_arch_info (&abfd);
+ }
+ }
+
gdbarch = gdbarch_alloc (&info, tdep);
power = arch == bfd_arch_rs6000;
next reply other threads:[~2002-08-20 22:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-20 15:38 Elena Zannoni [this message]
2002-08-20 16:31 ` Kevin Buettner
2002-08-21 15:58 ` Elena Zannoni
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=15714.50288.526139.379896@localhost.redhat.com \
--to=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