[PATCH v9 15/19] aarch64: Ignore GCS property of ld.so

Yury Khrustalev yury.khrustalev@arm.com
Fri Jan 17 17:41:15 GMT 2025


From: Szabolcs Nagy <szabolcs.nagy@arm.com>

check_gcs is called for each dependency of a DSO, but the GNU property
of the ld.so is not processed so ldso->l_mach.gcs may not be correct.
Just assume ld.so is GCS compatible independently of the ELF marking.

Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
---
 sysdeps/aarch64/dl-gcs.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sysdeps/aarch64/dl-gcs.c b/sysdeps/aarch64/dl-gcs.c
index 9e4efa1051..bf8eabbed8 100644
--- a/sysdeps/aarch64/dl-gcs.c
+++ b/sysdeps/aarch64/dl-gcs.c
@@ -55,6 +55,11 @@ unsupported (void)
 static bool
 check_gcs (struct link_map *l, const char *program, bool enforced)
 {
+#ifdef SHARED
+  /* Ignore GCS marking on ld.so: its properties are not processed.  */
+  if (is_rtld_link_map (l->l_real))
+    return true;
+#endif
   /* Binary is marked, all good.  */
   if (l->l_mach.gcs)
     return true;
-- 
2.39.5



More information about the Libc-alpha mailing list