From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2219 invoked by alias); 17 Mar 2015 23:55:34 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 2210 invoked by uid 89); 17 Mar 2015 23:55:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KAM_FROM_URIBL_PCCC,RCVD_IN_DNSWL_NONE,SPF_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: BLU004-OMC2S27.hotmail.com Received: from blu004-omc2s27.hotmail.com (HELO BLU004-OMC2S27.hotmail.com) (65.55.111.102) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA256 encrypted) ESMTPS; Tue, 17 Mar 2015 23:55:32 +0000 Received: from BLU436-SMTP136 ([65.55.111.72]) by BLU004-OMC2S27.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Tue, 17 Mar 2015 16:54:51 -0700 X-TMN: [Zd0M0LbpX6YaBRpUhLchtSdBZgFWpQN1] Message-ID: Date: Tue, 17 Mar 2015 23:55:00 -0000 From: Chen Gang User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: binutils@sourceware.org Subject: [PATCH] ld/ldmain.c (main): Use %F instead of %X for einfo(). Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-SW-Source: 2015-03/txt/msg00228.txt.bz2 When src or dst is NULL, the next fread or fwrite will cause segment fault, so we need treat it as fatal case in einfo(). 2015-03-18 Chen Gang * ldmain.c (main): Use %F instead of %X for einfo(). --- ld/ChangeLog | 4 ++++ ld/ldmain.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 0f8fbc4..72202c2 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,7 @@ +2015-03-18 Chen Gang + + * ldmain.c (main): Use %F instead of %X for einfo(). + 2015-03-02 Alan Modra * ld.texinfo (Options <-z nocopyreloc>): Rewrite. diff --git a/ld/ldmain.c b/ld/ldmain.c index 4b41288..6674a80 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -484,10 +484,10 @@ main (int argc, char **argv) dst = fopen (dst_name, FOPEN_WB); if (!src) - einfo (_("%X%P: unable to open for source of copy `%s'\n"), + einfo (_("%P%F: unable to open for source of copy `%s'\n"), output_filename); if (!dst) - einfo (_("%X%P: unable to open for destination of copy `%s'\n"), + einfo (_("%P%F: unable to open for destination of copy `%s'\n"), dst_name); while ((l = fread (buf, 1, bsize, src)) > 0) { -- 1.9.3