diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2022-09-07 10:38:29 +0100 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2022-11-22 14:31:25 +0000 |
commit | 90c5142f771b318dc905faf02162a01b8f546460 (patch) | |
tree | 485c3f79027b74dd7f9548abc446b8f8e77ec139 /sysdeps | |
parent | 055042833f84bad40aacb4f952eae63351cf5fb3 (diff) | |
download | glibc-90c5142f771b318dc905faf02162a01b8f546460.tar.gz glibc-90c5142f771b318dc905faf02162a01b8f546460.tar.xz glibc-90c5142f771b318dc905faf02162a01b8f546460.zip |
cheri: Setup RX, RW capabilities for static linking
At least tls image access requires RX capability of the main link_map.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/unix/sysv/linux/dl-parse_auxv.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/dl-parse_auxv.h b/sysdeps/unix/sysv/linux/dl-parse_auxv.h index 48ca7736a0..a0770b4412 100644 --- a/sysdeps/unix/sysv/linux/dl-parse_auxv.h +++ b/sysdeps/unix/sysv/linux/dl-parse_auxv.h @@ -22,7 +22,12 @@ #include <ldsodefs.h> #include <link.h> -typedef elfptr_t dl_parse_auxv_t[AT_MINSIGSTKSZ + 1]; +#ifdef __CHERI_PURE_CAPABILITY__ +# define AT_MAX AT_ENVP +#else +# define AT_MAX AT_MINSIGSTKSZ +#endif +typedef elfptr_t dl_parse_auxv_t[AT_MAX + 1]; /* Copy the auxiliary vector into AUXV_VALUES and set up GLRO variables. */ @@ -39,7 +44,7 @@ void _dl_parse_auxv (ElfW(auxv_t) *av, dl_parse_auxv_t auxv_values) auxv_values[AT_MINSIGSTKSZ] = CONSTANT_MINSIGSTKSZ; for (; av->a_type != AT_NULL; av++) - if (av->a_type <= AT_MINSIGSTKSZ) + if (av->a_type <= AT_MAX) auxv_values[av->a_type] = av->a_un.a_val; GLRO(dl_pagesize) = auxv_values[AT_PAGESZ]; |