public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/arm/morello/main] aarch64: morello: fix ldconfig for purecap abi
@ 2022-08-05 19:36 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-08-05 19:36 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c755eefac5059eef147d3aadccc3eecf8acb3706

commit c755eefac5059eef147d3aadccc3eecf8acb3706
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Fri Jul 15 08:15:02 2022 +0100

    aarch64: morello: fix ldconfig for purecap abi
    
    Add purecap ld cache flag. Add the purecap ld.so name to known names.
    Handle lib64c system library paths. And set the purecap abi flag on
    cache entries.

Diff:
---
 elf/cache.c                                | 3 +++
 sysdeps/generic/ldconfig.h                 | 1 +
 sysdeps/unix/sysv/linux/aarch64/dl-cache.h | 9 +++++++++
 sysdeps/unix/sysv/linux/aarch64/ldconfig.h | 2 ++
 sysdeps/unix/sysv/linux/arm/readelflib.c   | 9 ++++++++-
 5 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/elf/cache.c b/elf/cache.c
index 3d7d3a67bf..664ca6ac39 100644
--- a/elf/cache.c
+++ b/elf/cache.c
@@ -210,6 +210,9 @@ print_entry (const char *lib, int flag, uint64_t hwcap,
     case FLAG_AARCH64_LIB64:
       fputs (",AArch64", stdout);
       break;
+    case FLAG_AARCH64_PURECAP:
+      fputs (",purecap", stdout);
+      break;
     /* Uses the ARM soft-float ABI.  */
     case FLAG_ARM_LIBSF:
       fputs (",soft-float", stdout);
diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h
index 7cc898db61..5a9e0589d9 100644
--- a/sysdeps/generic/ldconfig.h
+++ b/sysdeps/generic/ldconfig.h
@@ -45,6 +45,7 @@
 #define FLAG_MIPS64_LIBN64_NAN2008	0x0e00
 #define FLAG_RISCV_FLOAT_ABI_SOFT	0x0f00
 #define FLAG_RISCV_FLOAT_ABI_DOUBLE	0x1000
+#define FLAG_AARCH64_PURECAP		0x1100
 
 /* Name of auxiliary cache.  */
 #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache"
diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-cache.h b/sysdeps/unix/sysv/linux/aarch64/dl-cache.h
index a35d04bc93..e456d8df30 100644
--- a/sysdeps/unix/sysv/linux/aarch64/dl-cache.h
+++ b/sysdeps/unix/sysv/linux/aarch64/dl-cache.h
@@ -20,6 +20,8 @@
 
 #ifdef __LP64__
 # define _DL_CACHE_DEFAULT_ID    (FLAG_AARCH64_LIB64 | FLAG_ELF_LIBC6)
+#elif defined __CHERI_PURE_CAPABILITY__
+# define _DL_CACHE_DEFAULT_ID    (FLAG_AARCH64_PURECAP | FLAG_ELF_LIBC6)
 #else
 # define _DL_CACHE_DEFAULT_ID    (FLAG_AARCH64_LIB32 | FLAG_ELF_LIBC6)
 #endif
@@ -38,6 +40,11 @@
 	  len -= 2;						\
 	  path[len] = '\0';					\
 	}							\
+      if (len >= 7 && ! memcmp (path + len - 7, "/lib64c", 7))	\
+	{							\
+	  len -= 3;						\
+	  path[len] = '\0';					\
+	}							\
       if (len >= 9 && ! memcmp (path + len - 9, "/libilp32", 9))\
 	{							\
 	  len -= 5;						\
@@ -48,6 +55,8 @@
 	{							\
 	  memcpy (path + len, "64", 3);				\
 	  add_dir (path);					\
+	  memcpy (path + len, "64c", 4);			\
+	  add_dir (path);					\
 	  memcpy (path + len, "ilp32", 6);			\
 	  add_dir (path);					\
 	}							\
diff --git a/sysdeps/unix/sysv/linux/aarch64/ldconfig.h b/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
index 5cbfb32714..29920f7438 100644
--- a/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
+++ b/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
@@ -21,6 +21,8 @@
 #define SYSDEP_KNOWN_INTERPRETER_NAMES \
   { "/lib/ld-linux-aarch64.so.1", FLAG_ELF_LIBC6 }, \
   { "/lib/ld-linux-aarch64_be.so.1", FLAG_ELF_LIBC6 }, \
+  { "/lib/ld-linux-aarch64_purecap.so.1", FLAG_ELF_LIBC6 }, \
+  { "/lib/ld-linux-aarch64_be_purecap.so.1", FLAG_ELF_LIBC6 }, \
   { "/lib/ld-linux-aarch64_ilp32.so.1", FLAG_ELF_LIBC6 }, \
   { "/lib/ld-linux-aarch64_be_ilp32.so.1", FLAG_ELF_LIBC6 }, \
   { "/lib/ld-linux.so.3", FLAG_ELF_LIBC6 }, \
diff --git a/sysdeps/unix/sysv/linux/arm/readelflib.c b/sysdeps/unix/sysv/linux/arm/readelflib.c
index d4956e2d25..62d4e137c6 100644
--- a/sysdeps/unix/sysv/linux/arm/readelflib.c
+++ b/sysdeps/unix/sysv/linux/arm/readelflib.c
@@ -55,11 +55,18 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
     }
   else
     {
+      Elf64_Ehdr *elf64_header = (Elf64_Ehdr *) elf_header;
+
       ret = process_elf64_file (file_name, lib, flag, isa_level, soname,
 				file_contents, file_length);
       /* AArch64 libraries are always libc.so.6+.  */
       if (!ret)
-	*flag = FLAG_AARCH64_LIB64|FLAG_ELF_LIBC6;
+	{
+	  if (elf64_header->e_flags & EF_AARCH64_CHERI_PURECAP)
+	    *flag = FLAG_AARCH64_PURECAP|FLAG_ELF_LIBC6;
+	  else
+	    *flag = FLAG_AARCH64_LIB64|FLAG_ELF_LIBC6;
+	}
     }
   return ret;
 }


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [glibc/arm/morello/main] aarch64: morello: fix ldconfig for purecap abi
@ 2022-11-23 14:47 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-11-23 14:47 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=41965d796f93c63f3756ea59d93a9daaa76388f5

commit 41965d796f93c63f3756ea59d93a9daaa76388f5
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Fri Jul 15 08:15:02 2022 +0100

    aarch64: morello: fix ldconfig for purecap abi
    
    Add purecap ld cache flag. Add the purecap ld.so name to known names.
    Handle lib64c system library paths. And set the purecap abi flag on
    cache entries.

Diff:
---
 elf/cache.c                                | 3 +++
 sysdeps/generic/ldconfig.h                 | 1 +
 sysdeps/unix/sysv/linux/aarch64/dl-cache.h | 9 +++++++++
 sysdeps/unix/sysv/linux/aarch64/ldconfig.h | 2 ++
 sysdeps/unix/sysv/linux/arm/readelflib.c   | 9 ++++++++-
 5 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/elf/cache.c b/elf/cache.c
index 3d7d3a67bf..664ca6ac39 100644
--- a/elf/cache.c
+++ b/elf/cache.c
@@ -210,6 +210,9 @@ print_entry (const char *lib, int flag, uint64_t hwcap,
     case FLAG_AARCH64_LIB64:
       fputs (",AArch64", stdout);
       break;
+    case FLAG_AARCH64_PURECAP:
+      fputs (",purecap", stdout);
+      break;
     /* Uses the ARM soft-float ABI.  */
     case FLAG_ARM_LIBSF:
       fputs (",soft-float", stdout);
diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h
index 7cc898db61..5a9e0589d9 100644
--- a/sysdeps/generic/ldconfig.h
+++ b/sysdeps/generic/ldconfig.h
@@ -45,6 +45,7 @@
 #define FLAG_MIPS64_LIBN64_NAN2008	0x0e00
 #define FLAG_RISCV_FLOAT_ABI_SOFT	0x0f00
 #define FLAG_RISCV_FLOAT_ABI_DOUBLE	0x1000
+#define FLAG_AARCH64_PURECAP		0x1100
 
 /* Name of auxiliary cache.  */
 #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache"
diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-cache.h b/sysdeps/unix/sysv/linux/aarch64/dl-cache.h
index a35d04bc93..e456d8df30 100644
--- a/sysdeps/unix/sysv/linux/aarch64/dl-cache.h
+++ b/sysdeps/unix/sysv/linux/aarch64/dl-cache.h
@@ -20,6 +20,8 @@
 
 #ifdef __LP64__
 # define _DL_CACHE_DEFAULT_ID    (FLAG_AARCH64_LIB64 | FLAG_ELF_LIBC6)
+#elif defined __CHERI_PURE_CAPABILITY__
+# define _DL_CACHE_DEFAULT_ID    (FLAG_AARCH64_PURECAP | FLAG_ELF_LIBC6)
 #else
 # define _DL_CACHE_DEFAULT_ID    (FLAG_AARCH64_LIB32 | FLAG_ELF_LIBC6)
 #endif
@@ -38,6 +40,11 @@
 	  len -= 2;						\
 	  path[len] = '\0';					\
 	}							\
+      if (len >= 7 && ! memcmp (path + len - 7, "/lib64c", 7))	\
+	{							\
+	  len -= 3;						\
+	  path[len] = '\0';					\
+	}							\
       if (len >= 9 && ! memcmp (path + len - 9, "/libilp32", 9))\
 	{							\
 	  len -= 5;						\
@@ -48,6 +55,8 @@
 	{							\
 	  memcpy (path + len, "64", 3);				\
 	  add_dir (path);					\
+	  memcpy (path + len, "64c", 4);			\
+	  add_dir (path);					\
 	  memcpy (path + len, "ilp32", 6);			\
 	  add_dir (path);					\
 	}							\
diff --git a/sysdeps/unix/sysv/linux/aarch64/ldconfig.h b/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
index 5cbfb32714..29920f7438 100644
--- a/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
+++ b/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
@@ -21,6 +21,8 @@
 #define SYSDEP_KNOWN_INTERPRETER_NAMES \
   { "/lib/ld-linux-aarch64.so.1", FLAG_ELF_LIBC6 }, \
   { "/lib/ld-linux-aarch64_be.so.1", FLAG_ELF_LIBC6 }, \
+  { "/lib/ld-linux-aarch64_purecap.so.1", FLAG_ELF_LIBC6 }, \
+  { "/lib/ld-linux-aarch64_be_purecap.so.1", FLAG_ELF_LIBC6 }, \
   { "/lib/ld-linux-aarch64_ilp32.so.1", FLAG_ELF_LIBC6 }, \
   { "/lib/ld-linux-aarch64_be_ilp32.so.1", FLAG_ELF_LIBC6 }, \
   { "/lib/ld-linux.so.3", FLAG_ELF_LIBC6 }, \
diff --git a/sysdeps/unix/sysv/linux/arm/readelflib.c b/sysdeps/unix/sysv/linux/arm/readelflib.c
index d4956e2d25..62d4e137c6 100644
--- a/sysdeps/unix/sysv/linux/arm/readelflib.c
+++ b/sysdeps/unix/sysv/linux/arm/readelflib.c
@@ -55,11 +55,18 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
     }
   else
     {
+      Elf64_Ehdr *elf64_header = (Elf64_Ehdr *) elf_header;
+
       ret = process_elf64_file (file_name, lib, flag, isa_level, soname,
 				file_contents, file_length);
       /* AArch64 libraries are always libc.so.6+.  */
       if (!ret)
-	*flag = FLAG_AARCH64_LIB64|FLAG_ELF_LIBC6;
+	{
+	  if (elf64_header->e_flags & EF_AARCH64_CHERI_PURECAP)
+	    *flag = FLAG_AARCH64_PURECAP|FLAG_ELF_LIBC6;
+	  else
+	    *flag = FLAG_AARCH64_LIB64|FLAG_ELF_LIBC6;
+	}
     }
   return ret;
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [glibc/arm/morello/main] aarch64: morello: fix ldconfig for purecap abi
@ 2022-10-27 13:57 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-10-27 13:57 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7beb22bd94af7e1c7faae3a6c13a2db85af0e216

commit 7beb22bd94af7e1c7faae3a6c13a2db85af0e216
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Fri Jul 15 08:15:02 2022 +0100

    aarch64: morello: fix ldconfig for purecap abi
    
    Add purecap ld cache flag. Add the purecap ld.so name to known names.
    Handle lib64c system library paths. And set the purecap abi flag on
    cache entries.

Diff:
---
 elf/cache.c                                | 3 +++
 sysdeps/generic/ldconfig.h                 | 1 +
 sysdeps/unix/sysv/linux/aarch64/dl-cache.h | 9 +++++++++
 sysdeps/unix/sysv/linux/aarch64/ldconfig.h | 2 ++
 sysdeps/unix/sysv/linux/arm/readelflib.c   | 9 ++++++++-
 5 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/elf/cache.c b/elf/cache.c
index 3d7d3a67bf..664ca6ac39 100644
--- a/elf/cache.c
+++ b/elf/cache.c
@@ -210,6 +210,9 @@ print_entry (const char *lib, int flag, uint64_t hwcap,
     case FLAG_AARCH64_LIB64:
       fputs (",AArch64", stdout);
       break;
+    case FLAG_AARCH64_PURECAP:
+      fputs (",purecap", stdout);
+      break;
     /* Uses the ARM soft-float ABI.  */
     case FLAG_ARM_LIBSF:
       fputs (",soft-float", stdout);
diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h
index 7cc898db61..5a9e0589d9 100644
--- a/sysdeps/generic/ldconfig.h
+++ b/sysdeps/generic/ldconfig.h
@@ -45,6 +45,7 @@
 #define FLAG_MIPS64_LIBN64_NAN2008	0x0e00
 #define FLAG_RISCV_FLOAT_ABI_SOFT	0x0f00
 #define FLAG_RISCV_FLOAT_ABI_DOUBLE	0x1000
+#define FLAG_AARCH64_PURECAP		0x1100
 
 /* Name of auxiliary cache.  */
 #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache"
diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-cache.h b/sysdeps/unix/sysv/linux/aarch64/dl-cache.h
index a35d04bc93..e456d8df30 100644
--- a/sysdeps/unix/sysv/linux/aarch64/dl-cache.h
+++ b/sysdeps/unix/sysv/linux/aarch64/dl-cache.h
@@ -20,6 +20,8 @@
 
 #ifdef __LP64__
 # define _DL_CACHE_DEFAULT_ID    (FLAG_AARCH64_LIB64 | FLAG_ELF_LIBC6)
+#elif defined __CHERI_PURE_CAPABILITY__
+# define _DL_CACHE_DEFAULT_ID    (FLAG_AARCH64_PURECAP | FLAG_ELF_LIBC6)
 #else
 # define _DL_CACHE_DEFAULT_ID    (FLAG_AARCH64_LIB32 | FLAG_ELF_LIBC6)
 #endif
@@ -38,6 +40,11 @@
 	  len -= 2;						\
 	  path[len] = '\0';					\
 	}							\
+      if (len >= 7 && ! memcmp (path + len - 7, "/lib64c", 7))	\
+	{							\
+	  len -= 3;						\
+	  path[len] = '\0';					\
+	}							\
       if (len >= 9 && ! memcmp (path + len - 9, "/libilp32", 9))\
 	{							\
 	  len -= 5;						\
@@ -48,6 +55,8 @@
 	{							\
 	  memcpy (path + len, "64", 3);				\
 	  add_dir (path);					\
+	  memcpy (path + len, "64c", 4);			\
+	  add_dir (path);					\
 	  memcpy (path + len, "ilp32", 6);			\
 	  add_dir (path);					\
 	}							\
diff --git a/sysdeps/unix/sysv/linux/aarch64/ldconfig.h b/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
index 5cbfb32714..29920f7438 100644
--- a/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
+++ b/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
@@ -21,6 +21,8 @@
 #define SYSDEP_KNOWN_INTERPRETER_NAMES \
   { "/lib/ld-linux-aarch64.so.1", FLAG_ELF_LIBC6 }, \
   { "/lib/ld-linux-aarch64_be.so.1", FLAG_ELF_LIBC6 }, \
+  { "/lib/ld-linux-aarch64_purecap.so.1", FLAG_ELF_LIBC6 }, \
+  { "/lib/ld-linux-aarch64_be_purecap.so.1", FLAG_ELF_LIBC6 }, \
   { "/lib/ld-linux-aarch64_ilp32.so.1", FLAG_ELF_LIBC6 }, \
   { "/lib/ld-linux-aarch64_be_ilp32.so.1", FLAG_ELF_LIBC6 }, \
   { "/lib/ld-linux.so.3", FLAG_ELF_LIBC6 }, \
diff --git a/sysdeps/unix/sysv/linux/arm/readelflib.c b/sysdeps/unix/sysv/linux/arm/readelflib.c
index d4956e2d25..62d4e137c6 100644
--- a/sysdeps/unix/sysv/linux/arm/readelflib.c
+++ b/sysdeps/unix/sysv/linux/arm/readelflib.c
@@ -55,11 +55,18 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
     }
   else
     {
+      Elf64_Ehdr *elf64_header = (Elf64_Ehdr *) elf_header;
+
       ret = process_elf64_file (file_name, lib, flag, isa_level, soname,
 				file_contents, file_length);
       /* AArch64 libraries are always libc.so.6+.  */
       if (!ret)
-	*flag = FLAG_AARCH64_LIB64|FLAG_ELF_LIBC6;
+	{
+	  if (elf64_header->e_flags & EF_AARCH64_CHERI_PURECAP)
+	    *flag = FLAG_AARCH64_PURECAP|FLAG_ELF_LIBC6;
+	  else
+	    *flag = FLAG_AARCH64_LIB64|FLAG_ELF_LIBC6;
+	}
     }
   return ret;
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [glibc/arm/morello/main] aarch64: morello: fix ldconfig for purecap abi
@ 2022-10-26 15:18 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-10-26 15:18 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9fb3ee213fa3a9b5ebd578f8a4fb92bdb693e0e4

commit 9fb3ee213fa3a9b5ebd578f8a4fb92bdb693e0e4
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Fri Jul 15 08:15:02 2022 +0100

    aarch64: morello: fix ldconfig for purecap abi
    
    Add purecap ld cache flag. Add the purecap ld.so name to known names.
    Handle lib64c system library paths. And set the purecap abi flag on
    cache entries.

Diff:
---
 elf/cache.c                                | 3 +++
 sysdeps/generic/ldconfig.h                 | 1 +
 sysdeps/unix/sysv/linux/aarch64/dl-cache.h | 9 +++++++++
 sysdeps/unix/sysv/linux/aarch64/ldconfig.h | 2 ++
 sysdeps/unix/sysv/linux/arm/readelflib.c   | 9 ++++++++-
 5 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/elf/cache.c b/elf/cache.c
index 3d7d3a67bf..664ca6ac39 100644
--- a/elf/cache.c
+++ b/elf/cache.c
@@ -210,6 +210,9 @@ print_entry (const char *lib, int flag, uint64_t hwcap,
     case FLAG_AARCH64_LIB64:
       fputs (",AArch64", stdout);
       break;
+    case FLAG_AARCH64_PURECAP:
+      fputs (",purecap", stdout);
+      break;
     /* Uses the ARM soft-float ABI.  */
     case FLAG_ARM_LIBSF:
       fputs (",soft-float", stdout);
diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h
index 7cc898db61..5a9e0589d9 100644
--- a/sysdeps/generic/ldconfig.h
+++ b/sysdeps/generic/ldconfig.h
@@ -45,6 +45,7 @@
 #define FLAG_MIPS64_LIBN64_NAN2008	0x0e00
 #define FLAG_RISCV_FLOAT_ABI_SOFT	0x0f00
 #define FLAG_RISCV_FLOAT_ABI_DOUBLE	0x1000
+#define FLAG_AARCH64_PURECAP		0x1100
 
 /* Name of auxiliary cache.  */
 #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache"
diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-cache.h b/sysdeps/unix/sysv/linux/aarch64/dl-cache.h
index a35d04bc93..e456d8df30 100644
--- a/sysdeps/unix/sysv/linux/aarch64/dl-cache.h
+++ b/sysdeps/unix/sysv/linux/aarch64/dl-cache.h
@@ -20,6 +20,8 @@
 
 #ifdef __LP64__
 # define _DL_CACHE_DEFAULT_ID    (FLAG_AARCH64_LIB64 | FLAG_ELF_LIBC6)
+#elif defined __CHERI_PURE_CAPABILITY__
+# define _DL_CACHE_DEFAULT_ID    (FLAG_AARCH64_PURECAP | FLAG_ELF_LIBC6)
 #else
 # define _DL_CACHE_DEFAULT_ID    (FLAG_AARCH64_LIB32 | FLAG_ELF_LIBC6)
 #endif
@@ -38,6 +40,11 @@
 	  len -= 2;						\
 	  path[len] = '\0';					\
 	}							\
+      if (len >= 7 && ! memcmp (path + len - 7, "/lib64c", 7))	\
+	{							\
+	  len -= 3;						\
+	  path[len] = '\0';					\
+	}							\
       if (len >= 9 && ! memcmp (path + len - 9, "/libilp32", 9))\
 	{							\
 	  len -= 5;						\
@@ -48,6 +55,8 @@
 	{							\
 	  memcpy (path + len, "64", 3);				\
 	  add_dir (path);					\
+	  memcpy (path + len, "64c", 4);			\
+	  add_dir (path);					\
 	  memcpy (path + len, "ilp32", 6);			\
 	  add_dir (path);					\
 	}							\
diff --git a/sysdeps/unix/sysv/linux/aarch64/ldconfig.h b/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
index 5cbfb32714..29920f7438 100644
--- a/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
+++ b/sysdeps/unix/sysv/linux/aarch64/ldconfig.h
@@ -21,6 +21,8 @@
 #define SYSDEP_KNOWN_INTERPRETER_NAMES \
   { "/lib/ld-linux-aarch64.so.1", FLAG_ELF_LIBC6 }, \
   { "/lib/ld-linux-aarch64_be.so.1", FLAG_ELF_LIBC6 }, \
+  { "/lib/ld-linux-aarch64_purecap.so.1", FLAG_ELF_LIBC6 }, \
+  { "/lib/ld-linux-aarch64_be_purecap.so.1", FLAG_ELF_LIBC6 }, \
   { "/lib/ld-linux-aarch64_ilp32.so.1", FLAG_ELF_LIBC6 }, \
   { "/lib/ld-linux-aarch64_be_ilp32.so.1", FLAG_ELF_LIBC6 }, \
   { "/lib/ld-linux.so.3", FLAG_ELF_LIBC6 }, \
diff --git a/sysdeps/unix/sysv/linux/arm/readelflib.c b/sysdeps/unix/sysv/linux/arm/readelflib.c
index d4956e2d25..62d4e137c6 100644
--- a/sysdeps/unix/sysv/linux/arm/readelflib.c
+++ b/sysdeps/unix/sysv/linux/arm/readelflib.c
@@ -55,11 +55,18 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
     }
   else
     {
+      Elf64_Ehdr *elf64_header = (Elf64_Ehdr *) elf_header;
+
       ret = process_elf64_file (file_name, lib, flag, isa_level, soname,
 				file_contents, file_length);
       /* AArch64 libraries are always libc.so.6+.  */
       if (!ret)
-	*flag = FLAG_AARCH64_LIB64|FLAG_ELF_LIBC6;
+	{
+	  if (elf64_header->e_flags & EF_AARCH64_CHERI_PURECAP)
+	    *flag = FLAG_AARCH64_PURECAP|FLAG_ELF_LIBC6;
+	  else
+	    *flag = FLAG_AARCH64_LIB64|FLAG_ELF_LIBC6;
+	}
     }
   return ret;
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-23 14:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-05 19:36 [glibc/arm/morello/main] aarch64: morello: fix ldconfig for purecap abi Szabolcs Nagy
2022-10-26 15:18 Szabolcs Nagy
2022-10-27 13:57 Szabolcs Nagy
2022-11-23 14:47 Szabolcs Nagy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).