From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x62a.google.com with SMTP id c6so15728170pls.4 for ; Tue, 10 Jan 2023 22:06:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=9qAWSaVLkQ2ViPw8gK3xh1Ijgx/qCDMwLN2Ug+zlmiA=; b=UjNq3t1A0r6kiZpa9n/Wd8OAEiblAf22do8Xx8P4iClvgcK9TdgMTCFQ54+lyY61Ok r43EG8x6hFAxtvqaZ72uyz48REX2gwQ5QqNaVLEuiMqO9GMhH10CWC6FBnRIsdFZaM2X vIp5LeV+H/1PwiiZG0SWjVuiaXXYvA7/2wdzsrvt+oiOIOaNYqtCccqB+VjMI1pIAuSm LKgEMkRIe2zyF2lqoujwOU4hzmJIe2pVJvPPg1oCwUZ16gm40VFU0ckZagog1MNNHM+g X2hB7oaTzPm2nJf3kOjpMlyyYbLnsN9ZEK9XBmYxdcjtbzi/oOla4WSBkrZEMV0E3SJq jYxA== 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-Google-Smtp-Source: AMrXdXvz6xHZs+/Okf0yU+TX+6YxdJpDGnXUSRomm/lCSYanLOFifRMfJUlu4VwzZ7GP8nVlCfXatA== 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 From: Alan Modra To: binutils@sourceware.org Subject: now_seg after closing output file Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 List-Id: 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; -- Alan Modra Australia Development Lab, IBM