about summary refs log tree commit diff
path: root/sysdeps/aarch64/dl-prop.h
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2023-12-21 23:05:10 +0000
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2024-02-13 10:29:18 +0000
commitdeded666b363b18c93ee6baed7dcf32551158eca (patch)
tree12fa0670b0ecba07418fe3394b6091eb7f702c90 /sysdeps/aarch64/dl-prop.h
parent92cd77cd36137d81ac9500f595f0c4d0c3c6539d (diff)
downloadglibc-deded666b363b18c93ee6baed7dcf32551158eca.tar.gz
glibc-deded666b363b18c93ee6baed7dcf32551158eca.tar.xz
glibc-deded666b363b18c93ee6baed7dcf32551158eca.zip
aarch64: handling gcs marking
Diffstat (limited to 'sysdeps/aarch64/dl-prop.h')
-rw-r--r--sysdeps/aarch64/dl-prop.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/sysdeps/aarch64/dl-prop.h b/sysdeps/aarch64/dl-prop.h
index df05c0211d..72ac11aec0 100644
--- a/sysdeps/aarch64/dl-prop.h
+++ b/sysdeps/aarch64/dl-prop.h
@@ -24,16 +24,21 @@ extern void _dl_bti_protect (struct link_map *, int) attribute_hidden;
 extern void _dl_bti_check (struct link_map *, const char *)
     attribute_hidden;
 
+extern void _dl_gcs_check (struct link_map *, const char *)
+    attribute_hidden;
+
 static inline void __attribute__ ((always_inline))
 _rtld_main_check (struct link_map *m, const char *program)
 {
   _dl_bti_check (m, program);
+  _dl_gcs_check (m, program);
 }
 
 static inline void __attribute__ ((always_inline))
 _dl_open_check (struct link_map *m)
 {
   _dl_bti_check (m, NULL);
+  _dl_gcs_check (m, NULL);
 }
 
 static inline void __attribute__ ((always_inline))
@@ -45,10 +50,6 @@ static inline int
 _dl_process_gnu_property (struct link_map *l, int fd, uint32_t type,
 			  uint32_t datasz, void *data)
 {
-  if (!GLRO(dl_aarch64_cpu_features).bti)
-    /* Skip note processing.  */
-    return 0;
-
   if (type == GNU_PROPERTY_AARCH64_FEATURE_1_AND)
     {
       /* Stop if the property note is ill-formed.  */
@@ -57,7 +58,11 @@ _dl_process_gnu_property (struct link_map *l, int fd, uint32_t type,
 
       unsigned int feature_1 = *(unsigned int *) data;
       if (feature_1 & GNU_PROPERTY_AARCH64_FEATURE_1_BTI)
-	_dl_bti_protect (l, fd);
+	if (GLRO(dl_aarch64_cpu_features).bti)
+	  _dl_bti_protect (l, fd);
+
+      if (feature_1 & GNU_PROPERTY_AARCH64_FEATURE_1_GCS)
+	l->l_mach.gcs = 1;
 
       /* Stop if we processed the property note.  */
       return 0;