From patchwork Wed Jan 11 06:06:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 41761 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3150221wrt; Tue, 10 Jan 2023 22:06:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXtLdyBOFLIlc48pVt2dqTCQ3XztT8YQn8mgjE1t6nrWBalqOKL+2r+OqHx5aeui7+qTmUme X-Received: by 2002:a17:907:d50e:b0:7c1:5982:d729 with SMTP id wb14-20020a170907d50e00b007c15982d729mr70632986ejc.56.1673417200074; Tue, 10 Jan 2023 22:06:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673417200; cv=none; d=google.com; s=arc-20160816; b=GAOYJclyp2aDT/oxKg9EAf6mmCn4rgKvvFWoW7CP+OCquKGDfSc6PmbnxT4AvhtkZB Cbm9/dfPXTQyldn9QyYYMg/xeqITQp5x3wi8FZyrmGtdpii3gyYaVP3+/H61PV5z8z3j 0+0Tgtp0kJXuh+iQp2HYnVVGGBNqHrQTcOCGmmNRaxr0EDrKQXIp3Nb+x0pLabQv02Bk IpzEzM2HmyRbn+xrRQcZNfh6iVj7Py5147N4jCLZysqegfS71PbEN54asOuLVZY9BjOM 84a79VRYCxSserMG/B0Py6/8GBPCGHYk74tdhBctwUUvCFIj4HXgXEhlZSP5SO8CQnri kUig== 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=9qAWSaVLkQ2ViPw8gK3xh1Ijgx/qCDMwLN2Ug+zlmiA=; b=qAFMK2gcP3HUoVsQwhuiuCSj23/IOWfhoa7omnRGqqUsSonzwPVxMSe2Fq/FmVB/2b Fo9bFv483SbsOb7U7XRrP+20ZKMAvNAhABjaG1xW1x4hub1CqzbmpF3GA74Mr+QsVk4M RdZhFJls2R2Gh861kpBYNAs8YYhmeZwEN/L7Tb5tq1777yHEtu89sn8R8jSbtXDgTUvH 6G6fuNSNc/jv1eUnG9C06bs6tdJMljC3y7vOvVnHjDiQRH1RemSamzOckC7OMhFDWnF9 RAifFY20JPSuUTV4fQi/iyKuHgguWwYa5mzqP1H/rptwphP/gGMM0iUteWUpk/yY1odn IV+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=aS8XtlSI; 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 ga24-20020a1709070c1800b0084d4e42ffcesi7021830ejc.13.2023.01.10.22.06.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 22:06:40 -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=aS8XtlSI; 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 D74C83858414 for ; Wed, 11 Jan 2023 06:06:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D74C83858414 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673417198; bh=9qAWSaVLkQ2ViPw8gK3xh1Ijgx/qCDMwLN2Ug+zlmiA=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=aS8XtlSIo8+a0qogajzoorgC+dFyemNC8xw1+5O5KhCygPty3tRAWQ2GxRZzPILLP dlaYmC0upz6KKe9aYfeoCVrkm9bF+ZildgPu7u1FwhRsaXYoPpTylmFnZqdWSysyla lezibO5qnRwSZEAq+28ftZDpUwcSrBZ0RukZXZbU= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id 89F8E3858CDA for ; Wed, 11 Jan 2023 06:06:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 89F8E3858CDA Received: by mail-pl1-x62a.google.com with SMTP id c6so15728170pls.4 for ; Tue, 10 Jan 2023 22:06:30 -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=9qAWSaVLkQ2ViPw8gK3xh1Ijgx/qCDMwLN2Ug+zlmiA=; b=sU//QtSKmBaOGLpMVoi4a3pKXaPQ3lMIf37/YqXTEz7iHrZkbEy3F2CCQfHHch9cBA cwZdljm7akzIq8/GTXWtb1jvwq5vBbP3ubhimUqXaD6v+wqFRnf/Dj6dKaEA4y32+zvv lgJaqNo7JfyNp7ijJj4dEoU7QxjZrJqpDxwSI3agsxoIi72KuwNiGEiKuoc96xvx8lCX ND+NR5YY7AQ4nuEI/PRDs399GATjISbRggHpGonzqr0n0pdkeClGDnA0zqTOXbReCZWB McObLu0AmmSbpteITKSoUovNuGZn2gPA6m2mbBDnDnvmfIrPN+xsktTyX11pS1MYb3U4 LTkQ== X-Gm-Message-State: AFqh2kpCzfdFqHcHh+ezE859xVZl0MB5Udw1jE5DsI7aXWmnhbkRmFVw N6IU2S5EpUqG4vlOMoTWez35hb/0nwo= X-Received: by 2002:a17:90a:dd90:b0:228:e263:f873 with SMTP id l16-20020a17090add9000b00228e263f873mr1556132pjv.44.1673417189534; Tue, 10 Jan 2023 22:06:29 -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 q3-20020a17090a2e0300b0020ae09e9724sm7968174pjd.53.2023.01.10.22.06.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 22:06:28 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 4F3891142D81; Wed, 11 Jan 2023 16:36:26 +1030 (ACDT) Date: Wed, 11 Jan 2023 16:36:26 +1030 To: binutils@sourceware.org Subject: now_seg after closing output file Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3035.8 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?1754705113859790910?= X-GMAIL-MSGID: =?utf-8?q?1754705113859790910?= now_seg, a pointer into the output file sections, isn't valid after the output file is closed. gas doesn't and shouldn't use now_seg after this point of course, but let's be safe. * output-file.c (output_file_close): Clear now_seg and now_subseg. diff --git a/gas/output-file.c b/gas/output-file.c index 127dc735703..0c3a8115bb1 100644 --- a/gas/output-file.c +++ b/gas/output-file.c @@ -99,6 +99,8 @@ output_file_close (void) res = bfd_cache_close_all (); else res = bfd_close (obfd); + now_seg = NULL; + now_subseg = 0; filename = out_file_name; out_file_name = NULL;