From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10657 invoked by alias); 19 Aug 2011 09:42:21 -0000 Received: (qmail 10641 invoked by uid 22791); 19 Aug 2011 09:42:20 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-fx0-f41.google.com (HELO mail-fx0-f41.google.com) (209.85.161.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 19 Aug 2011 09:42:06 +0000 Received: by fxg9 with SMTP id 9so2273785fxg.0 for ; Fri, 19 Aug 2011 02:42:04 -0700 (PDT) Received: by 10.223.76.202 with SMTP id d10mr2636313fak.106.1313746924658; Fri, 19 Aug 2011 02:42:04 -0700 (PDT) Received: from richards-thinkpad.stglab.manchester.uk.ibm.com (gbibp9ph1--blueice3n2.emea.ibm.com [195.212.29.84]) by mx.google.com with ESMTPS id c5sm146831fai.44.2011.08.19.02.42.03 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 19 Aug 2011 02:42:03 -0700 (PDT) From: Richard Sandiford To: "Maciej W. Rozycki" Mail-Followup-To: "Maciej W. Rozycki" ,binutils@sourceware.org, gdb-patches@sourceware.org, rdsandiford@googlemail.com Cc: binutils@sourceware.org, gdb-patches@sourceware.org Subject: Re: [PATCH] MIPS/BFD: Fix assertions with SGI IRIX files References: Date: Fri, 19 Aug 2011 09:42:00 -0000 In-Reply-To: (Maciej W. Rozycki's message of "Thu, 18 Aug 2011 17:40:41 +0100 (BST)") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2011-08/txt/msg00366.txt.bz2 "Maciej W. Rozycki" writes: > Hello, > > If an SGI IRIX ELF variation binary (also produced by binutils for some > target configurations) is loaded into GDB configured for the traditional > MIPS ELF variation, then a load of assertion failures is spat. They > actually come from BFD being confused. > > As no user input, however unreasonable, should ever trigger assertions > and this is simply a case of an unsupported binary format, here's a fix to > convert the offending code to do proper error reporting instead. > > Verified manually with GDB, the error messages are produced. I was > unable to trigger this problem with the linker, even though this piece of > code looks reachable within to me. How about just dropping the assertions? SHN_MIPS_TEXT and SHN_MIPS_DATA are easy to handle, and it looks like the code will behave sensibly regardless of SGI_COMPAT. I realise you might be thinking that the user would like to know that they have the "wrong" emulation. But if this is the only detectable difference, it's better just to carry on. If there are other detectable differences that cause real problems, we should try to diagnose the problem there instead. A patch to remove the assertions is pre-approved if you agree that's OK. Richard