mirror of
git://sourceware.org/git/glibc.git
synced 2025-04-12 14:21:18 +08:00
The section mark a memory region that should not be sealed if GNU_PROPERTY_MEMORY_SEAL attribute is present. PT_GNU_MUTABLE section names start with ".gnu.mutable" and are maximum page aligned and have a size of maximum page size. For instance the code: #define GNU_MUTABLE_SECTION_NAME ".gnu.mutable" unsigned char mutable_array1[64] __attribute__ ((section (GNU_MUTABLE_SECTION_NAME))) = { 0 }; unsigned char mutable_array2[32] __attribute__ ((section (GNU_MUTABLE_SECTION_NAME))) = { 0 }; places both 'mutable_array1' and 'mutable_array2' on a page aligned memory region in a size of a page (the alignment and size can be change with -Wl,-z,max-page-size= linker option). The linker sets the alignment and size to make it easier to loader to avoid sealing the area (since mseal only work on multiple of page size areas), and to simplify the userland process to change protection of either seal the area after initialization.