From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2428 invoked by alias); 23 Apr 2017 11:48:58 -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 2206 invoked by uid 89); 23 Apr 2017 11:48:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=lab X-HELO: mail-it0-f54.google.com Received: from mail-it0-f54.google.com (HELO mail-it0-f54.google.com) (209.85.214.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 23 Apr 2017 11:48:55 +0000 Received: by mail-it0-f54.google.com with SMTP id 70so29279213ita.0 for ; Sun, 23 Apr 2017 04:48:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=eEW5Vw3N6WUMMldInRlw2oqObqtcJvBN8U1S39DJ43E=; b=c5z5+Xu3lSHXiVZ9T89t1/QYw0QztEsRXY8e1RZsILABvNpifR4F62wz0f1zTIrQ3w m0BGEFI4nXIA6i1/M3tzqcLb7EaEdXmnafiDlDOQtF4CHoHpudKdP6rKQOYWju6gMYtE 9hEgArfOlBdiie4wgEdwLJRzf8kqM5A+uCBJYsuo5Bhoiz6qxQMuKgJz0l0l804s5cdn fbGcfTF3+/A3emIYcmMk9o+rVlf5KpcmghgeptfCNaeC0mjRRik7QZAZBSiwpkiHbpJg EcdAQUZKXbs51a0QQPlKPtju7no/V4rWVECA6CCXV8nEKuS8EEk9e29HYYYuonG/yy6e Udzw== X-Gm-Message-State: AN3rC/6DXp0Lb02DpyDEfxBaBeIsHoo43C6Kakskn5QnmyOkbiYm7tmm VEtpY1TBWPTOLX5Q X-Received: by 10.99.108.6 with SMTP id h6mr19292578pgc.188.1492948135351; Sun, 23 Apr 2017 04:48:55 -0700 (PDT) Received: from bubble.grove.modra.org (CPE-58-160-71-80.tyqh2.lon.bigpond.net.au. [58.160.71.80]) by smtp.gmail.com with ESMTPSA id e131sm25314479pfg.10.2017.04.23.04.48.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Apr 2017 04:48:54 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 0E6CDC7605; Sun, 23 Apr 2017 21:18:51 +0930 (ACST) Date: Sun, 23 Apr 2017 11:48:00 -0000 From: Alan Modra To: binutils@sourceware.org Subject: PR 21409, segfault in _bfd_dwarf2_find_nearest_line Message-ID: <20170423114850.GH24006@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg00190.txt.bz2 PR 21409 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when no symbols. diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ba2d134..7a389b1 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2017-04-23 Alan Modra + + PR 21409 + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when + no symbols. + 2017-04-21 H.J. Lu PR ld/21402 diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 132a674..0ef3e1f 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -4205,7 +4205,7 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd, looking up the function by section + offset uses the DW_AT_decl_line from the function DW_TAG_subprogram for the line, which will be the line of the function name. */ - if ((section->flags & SEC_CODE) == 0) + if (symbols != NULL && (section->flags & SEC_CODE) == 0) { asymbol **tmp; -- Alan Modra Australia Development Lab, IBM