From patchwork Tue Nov 15 19:31:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 60667 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0FDB3392AC2A for ; Tue, 15 Nov 2022 19:33:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0FDB3392AC2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668540797; bh=IyRmB5hBqi5mJL0WIdBMoMMljDU1Z5lE/PJtpVqWItI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=cJ3+ZTrz9avyw1IOhw2iA3+dbZ+p3bfNsxIY3qnhgo6qkW7RNFKdbZsCmzokrcDwC vTbX3zsQufQTYg9x1YIR2JHa1s8cHmVYBbMJ6ZDPEYv/kFQPr6nA306jwRRdAfCOeM SJ6oNxXzMEXd4nR63ycz7K5EQ9+/wY+2hiRdyjtA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by sourceware.org (Postfix) with ESMTPS id 856F738AA240 for ; Tue, 15 Nov 2022 19:32:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 856F738AA240 Received: by mail-oi1-x235.google.com with SMTP id t62so15918115oib.12 for ; Tue, 15 Nov 2022 11:32:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IyRmB5hBqi5mJL0WIdBMoMMljDU1Z5lE/PJtpVqWItI=; b=wVvqjZKCYq4NIhUUYsrm1kRPRNpXyW0gpV7TnitOJs1XWph6qWmoP7kBr7BIGo9qD4 Bl62L6LwQLnHU50L5QKRYpoyRGzxYG6OIYPVxdkBvTL9zrYQY1MQUvd7+vzu48tS/CJv ABWx8DLZJuVrO0elV0RpYe02td8UlyXS5FGU0yC/gNgJ46NT2jw5ErHLy9zC8EtNBKxI ikwr0T86DYK2FVLovs9VT6r9eNFHQ3vF2tVJ1qMGTZuVtPDjl0dWL1gpzeE73sM86Lou k5Ut28SenTIWF4MMlD6vkEQOGh1MYwK23JJ1z4XxNKwaxIqDh7lMcB3wIYVq5AD7Qext +Uqw== X-Gm-Message-State: ANoB5pnvZakEe+KWxMPOrK6L9nH1WstE+Ldl34HP3L96KThElwTt3jrn b8D70F0JANZs4GsuLFHT6t0BE+r0bZW+gGsV X-Google-Smtp-Source: AA0mqf6s2du9ZMCpaWVzKxUE19k69MUeo8imHS4jyqrpMEXiiL0msyr8zHWkdVojuzvIt+4BuC/4Qw== X-Received: by 2002:a05:6808:15a8:b0:354:b824:b599 with SMTP id t40-20020a05680815a800b00354b824b599mr1114434oiw.176.1668540727714; Tue, 15 Nov 2022 11:32:07 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c1:1164:573d:c7d8:ae8e:e2eb]) by smtp.gmail.com with ESMTPSA id f7-20020a9d2c07000000b00660e833baddsm5705231otb.29.2022.11.15.11.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 11:32:07 -0800 (PST) To: libc-alpha@sourceware.org, Fangrui Song Subject: [PATCH 3/7] stdlib: Move _IO_cleanup to call_function_static_weak Date: Tue, 15 Nov 2022 16:31:55 -0300 Message-Id: <20221115193159.173838-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221115193159.173838-1-adhemerval.zanella@linaro.org> References: <20221115193159.173838-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" --- Makerules | 3 --- libio/genops.c | 2 -- stdlib/exit.c | 6 ++---- 3 files changed, 2 insertions(+), 9 deletions(-) Reviewed-by: Florian Weimer diff --git a/Makerules b/Makerules index a41491429e..3226b7a12b 100644 --- a/Makerules +++ b/Makerules @@ -568,9 +568,6 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules PROVIDE(__start___libc_subfreeres = .);\ __libc_subfreeres : { *(__libc_subfreeres) }\ PROVIDE(__stop___libc_subfreeres = .);\ - PROVIDE(__start___libc_atexit = .);\ - __libc_atexit : { *(__libc_atexit) }\ - PROVIDE(__stop___libc_atexit = .);\ PROVIDE(__start___libc_IO_vtables = .);\ __libc_IO_vtables : { *(__libc_IO_vtables) }\ PROVIDE(__stop___libc_IO_vtables = .);\ diff --git a/libio/genops.c b/libio/genops.c index 1b629eb695..8a7fc4f7c5 100644 --- a/libio/genops.c +++ b/libio/genops.c @@ -1115,5 +1115,3 @@ _IO_list_resetlock (void) #endif } libc_hidden_def (_IO_list_resetlock) - -text_set_element(__libc_atexit, _IO_cleanup); diff --git a/stdlib/exit.c b/stdlib/exit.c index 10c44e1449..98579fbda8 100644 --- a/stdlib/exit.c +++ b/stdlib/exit.c @@ -20,11 +20,9 @@ #include #include #include +#include #include "exit.h" -#include "set-hooks.h" -DEFINE_HOOK (__libc_atexit, (void)) - /* Initialize the flag that indicates exit function processing is complete. See concurrency notes in stdlib/exit.h where __exit_funcs_lock is declared. */ @@ -128,7 +126,7 @@ __run_exit_handlers (int status, struct exit_function_list **listp, __libc_lock_unlock (__exit_funcs_lock); if (run_list_atexit) - RUN_HOOK (__libc_atexit, ()); + call_function_static_weak (_IO_cleanup); _exit (status); }