From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22176 invoked by alias); 17 Sep 2009 22:56:50 -0000 Received: (qmail 22167 invoked by uid 22791); 17 Sep 2009 22:56:49 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 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, 17 Sep 2009 22:56:44 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 2FE692BAB7E; Thu, 17 Sep 2009 18:56:43 -0400 (EDT) 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 F0CveLAfnmNh; Thu, 17 Sep 2009 18:56:43 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id CB05A2BAB57; Thu, 17 Sep 2009 18:56:42 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id AB441F592B; Thu, 17 Sep 2009 15:56:33 -0700 (PDT) Date: Thu, 17 Sep 2009 22:56:00 -0000 From: Joel Brobecker To: Hui Zhu Cc: Ulrich Weigand , gdb-patches ml , Michael Snyder Subject: Re: [RFA] Check solib bfd arch Message-ID: <20090917225633.GA29769@adacore.com> References: <200907071645.n67GjR0X001418@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="yrj/dFKFPuw6o+aM" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) 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: 2009-09/txt/msg00576.txt.bz2 --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1119 Hello, The following patch is causing trouble on sparc-solaris: > 2009-07-08 Hui Zhu > > * solib.c (solib_bfd_open): Output a warning if solib's > architecture is not compatible with inferior's architecture. I now see: (gdb) run Starting program: /[...]/sparc64/ex/task_switch warning: `/usr/platform/SUNW,Sun-Fire-V440/lib/sparcv9/libc_psr.so.1': Shared library architecture sparc:v9a is not compatible with target architecture sparc:v9. > + if (b->compatible (b, bfd_get_arch_info (abfd)) != b) In my case, b->compatible is bfd_default_compatible. the architecture is set to sparc:v9, and the shared library's architecture is sparc:v9a. The problem is that b->compatible is returning the architecture that is "more featureful" of the two, which in this case is sparc:v9a. As a result, we emit the warning. Looks to me like the check is too aggressive and should be changed to == 0. Would that be correct? 2009-09-16 Joel Brobecker * solib.c (solib_bfd_open): Relax a bit the compatibility check. Tested on sparc64-solaris. -- Joel --yrj/dFKFPuw6o+aM Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="solib.diff" Content-length: 557 diff --git a/gdb/solib.c b/gdb/solib.c index c7fd0fc..a2ad0c4 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -310,7 +310,7 @@ solib_bfd_open (char *pathname) /* Check bfd arch. */ b = gdbarch_bfd_arch_info (target_gdbarch); - if (b->compatible (b, bfd_get_arch_info (abfd)) != b) + if (!b->compatible (b, bfd_get_arch_info (abfd))) warning (_("`%s': Shared library architecture %s is not compatible " "with target architecture %s."), found_pathname, bfd_get_arch_info (abfd)->printable_name, b->printable_name); --yrj/dFKFPuw6o+aM--