From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109057 invoked by alias); 28 Sep 2018 15:39:09 -0000 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 Received: (qmail 109037 invoked by uid 89); 28 Sep 2018 15:39:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:2018090, H*f:sk:aceede4, H*f:sk:20b65fc X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 28 Sep 2018 15:39:07 +0000 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1584C445C4; Fri, 28 Sep 2018 15:39:06 +0000 (UTC) Received: from [10.36.117.72] (ovpn-117-72.ams2.redhat.com [10.36.117.72]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DFB352010DA7; Fri, 28 Sep 2018 15:39:04 +0000 (UTC) Subject: Re: [PATCH 0/4] OpenRISC binutils updates and new relocs To: Stafford Horne Cc: Richard Henderson , binutils@sourceware.org, GDB patches , Openrisc References: <20180821143823.16985-1-shorne@gmail.com> <20180908213515.GN4594@lianli.shorne-pla.net> <20180918095234.GP4594@lianli.shorne-pla.net> <20b65fc3-5bbb-6e77-f598-4582204ee0e5@redhat.com> <20180927060756.GB3318@lianli.shorne-pla.net> From: Nick Clifton Openpgp: preference=signencrypt Message-ID: <271e3bfa-4958-0387-9a82-ecfdb58f1e26@redhat.com> Date: Fri, 28 Sep 2018 15:39:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180927060756.GB3318@lianli.shorne-pla.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-09/txt/msg00901.txt.bz2 Hi Stafford, > To produce these errors I need to change the code, Using abort we see: > > /home/shorne/work/gnu-toolchain/local/lib/gcc/or1k-elf/9.0.0/../../../../or1k-elf/bin/ld: \ > BFD (GNU Binutils) 2.31.51.20180927 internal error, \ > aborting at ../../binutils-gdb/bfd/elf32-or1k.c:1152 in or1k_final_link_relocate > There is no segmentation fault. Sorry, you are right - the abort does not trigger a segmentation fault. > I agree, it is more nice to create a message > inform which error triggered the issue. > > Is something like this ok? > > default: > _bfd_error_handler > (_("%pB: Unknown complain on overflow value on howto specified %d"), > input_bfd, (int) howto->complain_on_overflow); > abort(); > > i.e. _bfd_error_handler() followed by abort(). I couldn't really see a way to > _bfd_error_handler() to actually cause the program to exit. Depending upon where you are in your code, if you have access to the link_info structure you can use its einfo() routine instead of bfd_error_handler. This has the advantage that it allows a %X formatting directive, which causes the program to terminate with an error exit code. But otherwise, if there is no reasonable way to return to the caller, then caryr on using abort. Adding the error messages still helps though. Cheers Nick