Message ID | 20230515144815.3939017-1-bugaevc@gmail.com |
---|---|
Headers | show |
Series | .text.subsections for some questionable benefit | expand |
On Mon, May 15, 2023 at 10:48 AM 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..