From patchwork Sat Feb 11 06:12:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 55698 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1356614wrn; Fri, 10 Feb 2023 22:12:20 -0800 (PST) X-Google-Smtp-Source: AK7set+5CjkN0CXWFVlgm0KTbJlC3VzGYzrU7Ei9ZADm1VicsZvlcoZwQa3FGpELZeZ+riTr9e0h X-Received: by 2002:a50:9f85:0:b0:4ac:b69a:2f06 with SMTP id c5-20020a509f85000000b004acb69a2f06mr987713edf.0.1676095940135; Fri, 10 Feb 2023 22:12:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676095940; cv=none; d=google.com; s=arc-20160816; b=sIgmuKcW7KvyZrz21eY7npuQRau25RZrMSHNBH/Oj1S9Ws1kgtdXDCGHCO/xAxV+gm 2Te8Er+xCwfy2IDPy1VaTPEvh07VbK9Ls2DeUT4Dgcpf5ireWBe15JR3RDaNj51k1U/k FcVfMFiKf+rrciYeF58pq+HoaTHrdOSWTRTHj19K2cdttsCtB+UR6gCEgjHvI87HUExg Io6XR4amCB0Ayx/jJzuRHVOHNpwX0vBvNUlug3bPpp2CD+cSERf173Fe63rB/jyEsAK3 h+1f7eGHpPXBXXO94vDiaR/7TiLzzFPVqMGh8B4IgxBUoS96P9iRNHrU/XuJN52JqDGB TU+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=eC8CHEQm4IthKOhJXkNOeG9ZBp/blSD1Fke8pjNhO9c=; b=jjL32HhXZjNzx6W6WSOfZHkOdJRL9oky3h9bjduxQGa9krWGiWX9YIg0G7mCiIOYas GveSTqDVHhpwLQ3CtlnjDZ5E8dt/Q1n3JHwHf/MnpinyZVprlPNhj6fprgQE1wNynOgh l4vyR2d5+ZbQM0SyMn6Yk66/YWmYw6QPjnoCVgbHCsY6U5x318P+CBsKF3mmZzGranfr ZadNxnRw5AL68uJoPLl/c0xLJCMo8qIhYy8+vevqAuIyEWGPxYqfGk0y6hBa6GxUC2jM YmjOkqf5qLTaenK5m7kPZQ0pZvVkhbUS7MtNR0p9Gtl8QBxHc5D989aq7YZ7hCfY/LBT eGzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=pb0tvqmX; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id n14-20020aa7db4e000000b004ab4cfc203dsi3183807edt.380.2023.02.10.22.12.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Feb 2023 22:12:20 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=pb0tvqmX; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DC8D3385B51E for ; Sat, 11 Feb 2023 06:12:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC8D3385B51E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676095937; bh=eC8CHEQm4IthKOhJXkNOeG9ZBp/blSD1Fke8pjNhO9c=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=pb0tvqmXEHMtbOwTGHvnvnuGVOyOOW3RompMLdvkVEXpGXnCjtys9rsPrAwv93Bbb 2dzFOYQ3a/+XTnxyZpkquhY9sDLNEz5Am3RYvAn7ncDTod9YfRF1C29FLQTm8jiFRD WFjjI2Xdvn2//deG9THw9NTJ0O8BDWB3qKx0PiLw= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id AD84F3858D32 for ; Sat, 11 Feb 2023 06:12:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AD84F3858D32 Received: by mail-pl1-x630.google.com with SMTP id b5so8817289plz.5 for ; Fri, 10 Feb 2023 22:12:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eC8CHEQm4IthKOhJXkNOeG9ZBp/blSD1Fke8pjNhO9c=; b=i2oJZwSXCs2Hy9ViJqrlGiz/Mp3olJlIzHgHDYYp4StvAJRina1B5u0ayCVoTXiAPE Q3gRC2wiM8dgRKJMIAd/Vk7AEiCVtcfQQLz5flh5nc8/kdb0oAgkDHBdy6ieqQiH2Z1K f+oIqEK8QEPlNbfXtG4bAPMdlgjTQ8tXe1X9Tds4SdbZD0DCiew8szyxdB49PQXIeq3f 78YcFzNEHvri+54M62DdZMQbavQ9G0jGLy8e9MQr4iZ+xpbFPH3A1DRR7d56yXk22NhB omcUf+2zdZ37x7mbVh8w42I4RFXh2jvghihBf/vDcgPX5vTTbm28eBkcWD3LAN11URT3 8AFw== X-Gm-Message-State: AO0yUKWMHFzbfOB3D+0RFasRtytBH/X5Hqm/x5LZOUDlf1SjpQKKussh cPVtiZEWKplYuq/DkIABNNq/ryiUTLo= X-Received: by 2002:a17:902:d48e:b0:199:472b:927f with SMTP id c14-20020a170902d48e00b00199472b927fmr14486973plg.51.1676095928477; Fri, 10 Feb 2023 22:12:08 -0800 (PST) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id f4-20020a170902e98400b00185402cfedesm4233891plb.246.2023.02.10.22.12.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Feb 2023 22:12:08 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 7EDC4114001B; Sat, 11 Feb 2023 16:42:05 +1030 (ACDT) Date: Sat, 11 Feb 2023 16:42:05 +1030 To: binutils@sourceware.org Subject: .debug sections without contents Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3035.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alan Modra via Binutils From: Alan Modra Reply-To: Alan Modra Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757513976847508717?= X-GMAIL-MSGID: =?utf-8?q?1757513976847508717?= * dwarf1.c (_bfd_dwarf1_find_nearest_line): Exclude .debug sections without contents. diff --git a/bfd/dwarf1.c b/bfd/dwarf1.c index c851f674680..90461004b0a 100644 --- a/bfd/dwarf1.c +++ b/bfd/dwarf1.c @@ -510,7 +510,8 @@ _bfd_dwarf1_find_nearest_line (bfd *abfd, return false; msec = bfd_get_section_by_name (abfd, ".debug"); - if (! msec) + if (! msec + || (msec->flags & SEC_HAS_CONTENTS) == 0) /* No dwarf1 info. Note that at this point the stash has been allocated, but contains zeros, this lets future calls to this function fail quicker. */