Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Cc: froydnj@codesourcery.com,	Joel Brobecker <brobecker@adacore.com>
Subject: [commit] Build failure on ppc-aix (bfd_elf_get_obj_attr_int is undefined)
Date: Thu, 25 Nov 2010 00:29:00 -0000	[thread overview]
Message-ID: <1290644939-6465-1-git-send-email-brobecker@adacore.com> (raw)
In-Reply-To: <1288380041-22165-1-git-send-email-froydnj@codesourcery.com>

Hello,

The following change introduced an unconditional use of a bfd/ELF routine:

        * rs6000-tdep.c (bfd_uses_spe_extensions): New function.
        (rs6000_gdbarch_init): Call it.

However, bfd_uses_spe_extensions should only be used when BFD has been built
with ELF support.  The typical way of checking that in GDB is to use
the HAVE_ELF macro.

I think that the attached patch handles things the proper way:
  - If ELF is supported, then using the attribute;
  - Otherwise, just skip that test, and use the other methods.

Nathan, if you could test this patch on your end of things, to make sure
I didn't break anything, that'd be great.

gdb/ChangeLog:

        * rs6000-tdep.c (bfd_uses_spe_extensions): Use bfd_elf_get_obj_attr_int
        only if HAVE_ELF is defined.

In the meantime, I have checked this patch in, since if fixes a build
failure.  Tested on ppc-aix as well as x86_64-linux (kind of useless,
but since I did include that patch in the batch of testing...).

---
 gdb/ChangeLog     |    5 +++++
 gdb/rs6000-tdep.c |    2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 03bf65d..869b8d7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2010-11-24  Joel Brobecker  <brobecker@adacore.com>
+
+	* rs6000-tdep.c (bfd_uses_spe_extensions): Use bfd_elf_get_obj_attr_int
+	only if HAVE_ELF is defined.
+
 2010-11-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	Code cleanup.
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 53c3f4c..81a99b6 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -3376,6 +3376,7 @@ bfd_uses_spe_extensions (bfd *abfd)
   if (!abfd)
     return 0;
 
+#ifdef HAVE_ELF
   /* Using Tag_GNU_Power_ABI_Vector here is a bit of a hack, as the user
      could be using the SPE vector abi without actually using any spe
      bits whatsoever.  But it's close enough for now.  */
@@ -3383,6 +3384,7 @@ bfd_uses_spe_extensions (bfd *abfd)
 					 Tag_GNU_Power_ABI_Vector);
   if (vector_abi == 3)
     return 1;
+#endif
 
   sect = bfd_get_section_by_name (abfd, ".PPC.EMB.apuinfo");
   if (!sect)
-- 
1.7.1


  parent reply	other threads:[~2010-11-25  0:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-29 19:27 [PATCH] fix debugging code compiled for newer PPC BookE processors Nathan Froyd
2010-11-02 18:23 ` Joel Brobecker
2010-11-02 18:46   ` Nathan Froyd
2010-11-02 18:53     ` Joel Brobecker
2010-11-25  0:29 ` Joel Brobecker [this message]
2010-11-29 22:06   ` [commit] Build failure on ppc-aix (bfd_elf_get_obj_attr_int is undefined) Nathan Froyd

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=1290644939-6465-1-git-send-email-brobecker@adacore.com \
    --to=brobecker@adacore.com \
    --cc=froydnj@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /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