aboutsummaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2025-03-04 11:39:30 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2025-03-07 08:48:50 -0300
commit03b4f972f3f509d2d39c1126830811180ed66359 (patch)
treed1ab97636cfec956f2d5fcebc6be3497d395c7e6 /binutils/readelf.c
parent6f5e2c066bac9ad51d89f159925f9760423be2f7 (diff)
downloadbinutils-azanella/pt_gnu_mutable.zip
binutils-azanella/pt_gnu_mutable.tar.gz
binutils-azanella/pt_gnu_mutable.tar.bz2
elf: Add PT_GNU_MUTABLEazanella/pt_gnu_mutable
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: 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. Change-Id: I1304af9ec6b5b2682a1416b2b3d8d5b2c65b9f1c TODO: add tests.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index dd1871d..b1f4d5c 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -5483,6 +5483,7 @@ get_os_specific_segment_type (Filedata * filedata, unsigned long p_type)
case PT_GNU_RELRO: return "GNU_RELRO";
case PT_GNU_PROPERTY: return "GNU_PROPERTY";
case PT_GNU_SFRAME: return "GNU_SFRAME";
+ case PT_GNU_MUTABLE: return "GNU_MUTABLE";
case PT_OPENBSD_MUTABLE: return "OPENBSD_MUTABLE";
case PT_OPENBSD_RANDOMIZE: return "OPENBSD_RANDOMIZE";