From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x936.google.com (mail-ua1-x936.google.com [IPv6:2607:f8b0:4864:20::936]) by sourceware.org (Postfix) with ESMTPS id 0BE123858D37 for ; Mon, 15 May 2023 15:33:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0BE123858D37 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=rodriguez.im Authentication-Results: sourceware.org; spf=none smtp.mailfrom=cristianrodriguez.net Received: by mail-ua1-x936.google.com with SMTP id a1e0cc1a2514c-783a0c413a5so79105241.1 for ; Mon, 15 May 2023 08:33:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rodriguez.im; s=google; t=1684164802; x=1686756802; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JToOm1JI7SKepfwuDhl455E+h2dqczbv+pnyxZVJvnU=; b=MXr4ForVxlv9Pi4EWBNeV0ibEa0GKSq0+NMq5umpsmQO7uCs77m2HDcDSRarXMmGY0 vVsSXTWUW2Oz9qrkeJ4FcwKHjcVIS5DQFKrpPFsozdcPRPOycUHYOEnAMGARI2wR2NXs /DPPtdVSB2u1Jyk8IqRVS4i6yx+M4vnwctyRM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684164802; x=1686756802; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JToOm1JI7SKepfwuDhl455E+h2dqczbv+pnyxZVJvnU=; b=FxwB/dnswiKm/nn5F3ewWlh85in6Y7tm3gY1rRiZIxmQ9+11Do8uNFT8cB0grAKhvc Tgd9H5TFEqLhVp94KezI2no+IivmOsdntG0gnyWXevUOyD5BddPA+sDEKbVufdHjo3uH XuxztctVgWRKH/NkreOXM4az6cKIVAXC9kseQ21mOr+l4NEA0dGcNhAK2pP33+belFRr hHW1VWEsipwhcDhHiRFyk5ojkS9hXGjU7d7LyEVNx2/jH8lUgwlXPf/3WUIfkIwb19cn 2+rnLHsmWgF4msse42KeHve2Rg+LYQwzC8Ctp4KGXofvwEhUqgTtk6Fov8atJt6vs5IE hETg== X-Gm-Message-State: AC+VfDwkL83rZOWM63/mpfmjxgNeOaVT/FFfCHlVRBtG8SAlTL/h+ScF P/MWB437oF1tpAms6O0r+QwN6JjmStbWTBP5yCO4IG4Ir8qqqmFHgM4= X-Google-Smtp-Source: ACHHUZ5vUxLmh9oT2dzqKx4AWu7IhYeHH09SiCJY2M/qOTuZVagr+4GnznzJyLv3gXsxipLfM2flQg7F+o9xfNBsLfk= X-Received: by 2002:a67:fe02:0:b0:434:7415:e0b1 with SMTP id l2-20020a67fe02000000b004347415e0b1mr13590269vsr.3.1684164802324; Mon, 15 May 2023 08:33:22 -0700 (PDT) MIME-Version: 1.0 References: <20230515144815.3939017-1-bugaevc@gmail.com> In-Reply-To: <20230515144815.3939017-1-bugaevc@gmail.com> From: =?UTF-8?Q?Cristian_Rodr=C3=ADguez?= Date: Mon, 15 May 2023 11:33:11 -0400 Message-ID: Subject: Re: [RFC PATCH 0/6] .text.subsections for some questionable benefit To: Sergey Bugaev Cc: libc-alpha@sourceware.org Content-Type: multipart/alternative; boundary="000000000000c93e6305fbbd2c66" X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000c93e6305fbbd2c66 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, May 15, 2023 at 10:48=E2=80=AFAM Sergey Bugaev via Libc-alpha < libc-alpha@sourceware.org> wrote: > > One more thing: the Linux kernel has a somewhat similar thing with > __init and __exit macros, which place the annotated function into > .init.text and .exit.text. They then do further tricks with this, such > (potentially?) unmapping the pages containing .init.text after startup > is completed. The SerenityOS Kernel similarly has UNMAP_AFTER_INIT > (and READONLY_AFTER_INIT, which is like attribute_relro). > > This not only for functions but variables is a sorely missed compiler/linker extension that will be very useful to have, many programs need single use routines that never ought to be called again.. or ro_after_init variables, not just the kernel or libc.. --000000000000c93e6305fbbd2c66--