From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10610 invoked by alias); 25 Nov 2010 00:29:21 -0000 Received: (qmail 10600 invoked by uid 22791); 25 Nov 2010 00:29:20 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 25 Nov 2010 00:29:15 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id EBF542BAC3D; Wed, 24 Nov 2010 19:29:13 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Vyk0mjKVK1I8; Wed, 24 Nov 2010 19:29:13 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id ADDBA2BAAAC; Wed, 24 Nov 2010 19:29:13 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 8B2591457E1; Wed, 24 Nov 2010 16:29:07 -0800 (PST) From: Joel Brobecker To: gdb-patches@sourceware.org Cc: froydnj@codesourcery.com, Joel Brobecker Subject: [commit] Build failure on ppc-aix (bfd_elf_get_obj_attr_int is undefined) Date: Thu, 25 Nov 2010 00:29:00 -0000 Message-Id: <1290644939-6465-1-git-send-email-brobecker@adacore.com> In-Reply-To: <1288380041-22165-1-git-send-email-froydnj@codesourcery.com> References: <1288380041-22165-1-git-send-email-froydnj@codesourcery.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-11/txt/msg00421.txt.bz2 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 + + * 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 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