From patchwork Sat Dec 17 08:13:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 34198 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1411386wrn; Sat, 17 Dec 2022 00:13:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf4vVNDvmyLTrWodZ3Zh4UWggTup2nPPe8jkWWVLELLxvDf3pnuwCXh3sRK+vneHO5MpgPSH X-Received: by 2002:a17:906:3917:b0:7bf:1081:9472 with SMTP id f23-20020a170906391700b007bf10819472mr27480295eje.69.1671264810144; Sat, 17 Dec 2022 00:13:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671264810; cv=none; d=google.com; s=arc-20160816; b=o6oVkpYZ/EbQlcw57e6imBfSSA6NnD8ogxqgAwnCrm7jLQ2AnAPxAh2v3z1s3QGh/g rQju3+BhdXeGG3yiVBD3Jw30aS3SoCp4I9bzop4dgdsJu0vCpTXe4kmhtfPZXtyvzH6S axiWAOs+/Cba3pWuTr4UztCT4lJjQnRlWAiF/2aoFQQKloXepaPYw1tb2F0HHLFmw+Ts BE+IXyMsaeRwpb4EiiNjjHHHatDIhp+VRciVxTWoMhO/nj8v598gCSmztafMmfp0lIIi 53Ufm/ZgO3OKlU8SGgQyW3pkS4EDAMro7mJIp8g7EgBmRxs1DN42to3TDZSzl+b7CEvN gDKg== 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=eqk+oFKmw6qb81zYtxDMBZkxlugQ3i9AvQU0GD3lgiI=; b=D7xHjNXFtkiTFNSHXmIDsLEGrk3bxWBbnAskFme87QmAO5UEgHR/cFCcdK0Q1g0MSk OKj9z5o+A8gUXYD4xNpRF2uburxVTArEPsndHVZtJjiOOv8iVtF7WZpNqZXNsGFY/9fV vhf73PKqhst+kXjXP3D6LoFHYVIBn1qruA/9t+fkb2kSusAoFk0XIzf7mdW761FbmO7t ZVQOqsoZUa5wsOR5st+pMYF7y5OAsJNHsURPQS37HqVDEJ5o78Dw9+YZQGShjN1tmRCC rfv6CFSNhowjWK+q0N3WLnhOujtTK3je/MsFT0NjxDrEMFbYDNpHnn5QBUHVb6QhvjVr VSWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=PQn6kYoN; 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 x17-20020a170906805100b007a072b8240csi3359916ejw.927.2022.12.17.00.13.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Dec 2022 00:13:30 -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=PQn6kYoN; 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 43A903947419 for ; Sat, 17 Dec 2022 08:13:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 43A903947419 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1671264807; bh=eqk+oFKmw6qb81zYtxDMBZkxlugQ3i9AvQU0GD3lgiI=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=PQn6kYoNW++pVNj8aPL+7h1gCHrZuJWzCcOoD4JDtfl43DTPz0Hrt68ia76bxl++G yjjOC0oIBxB0wYnP++KAySVvyBtz+0ykntAXyfsACpyN6i4Lpcp4ei5yt9baZNqqVA hAvW7/QXzv2mB34xq3nTF+E3Zf2lyjeki39OusVk= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 95A8E394740B for ; Sat, 17 Dec 2022 08:13:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 95A8E394740B Received: by mail-pf1-x430.google.com with SMTP id c13so3208196pfp.5 for ; Sat, 17 Dec 2022 00:13:15 -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=eqk+oFKmw6qb81zYtxDMBZkxlugQ3i9AvQU0GD3lgiI=; b=TLjTerbzAi3t9QeoTiq88oWulbWPV8VUQq8l6etv4oRksQF5PvyB2Pv7lIoR2kvBFA AvUv3njpJOC2DJppygz2p7XQWj842EPfiwLB0nk99nhhgfnlIXirjEk25RoU8pvHJ9oB gsu7ogQQ0SX1LZ6L5j4mjwwWYYfWGsMxy7ahDe/nfz2V6ebXkl7IRZPckgrCuOAXlhOl OoiYzfxnKgr0KXc26z6td0Hdqu2XtDjrTZnjfBoy3dqaUxSoWDjDtStVAo/GXdrSr2Ep cBW1gTU/RsKzDOAAORDN5oCqKfWpT/mvkUdSEDCTk8fqDkca812bfavaUWN7usrX36gL tauQ== X-Gm-Message-State: ANoB5pmt9K9KIRl1XyRcQYI4LlwR4rDVRPXMluJjU94isb4+ShAQpYHG T+H4DrFAbEFyJD/VbjqkjuLLEE4XSTM= X-Received: by 2002:aa7:96d4:0:b0:576:8e8d:6675 with SMTP id h20-20020aa796d4000000b005768e8d6675mr39364599pfq.19.1671264794354; Sat, 17 Dec 2022 00:13:14 -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 c197-20020a621cce000000b00573a9d13e9esm2670558pfc.36.2022.12.17.00.13.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Dec 2022 00:13:13 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 6F8391142DEE; Sat, 17 Dec 2022 18:43:11 +1030 (ACDT) Date: Sat, 17 Dec 2022 18:43:11 +1030 To: binutils@sourceware.org Subject: asan: elf.c:12621:18: applying zero offset to null pointer Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3035.9 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?1752448169681549974?= X-GMAIL-MSGID: =?utf-8?q?1752448169681549974?= That's this line in elf_parse_notes: while (p < buf + size) * elf.c (_bfd_elf_make_section_from_shdr): Don't call elf_parse_notes when sh_size is zero. diff --git a/bfd/elf.c b/bfd/elf.c index 5548efc44e4..7317c52faaa 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -1110,7 +1110,7 @@ _bfd_elf_make_section_from_shdr (bfd *abfd, /* We do not parse the PT_NOTE segments as we are interested even in the separate debug info files which may have the segments offsets corrupted. PT_NOTEs from the core files are currently not parsed using BFD. */ - if (hdr->sh_type == SHT_NOTE) + if (hdr->sh_type == SHT_NOTE && hdr->sh_size != 0) { bfd_byte *contents;