]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
TODO(sprof): cheri: disable profiling shared libraries
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 12 May 2022 08:05:30 +0000 (09:05 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 27 Oct 2022 13:46:54 +0000 (14:46 +0100)
This is needed now to avoid referencing abort in ld.so.

TODO: Fixing shared library profiling for capabilities requires
type fixes so capabilities are not stored into shared memory
(maybe purecap layout can match the lp64 one and then no file format
and external tooling change is required.)
TODO: Proper fix also depends on _dl_runtime_profile plt entry

elf/dl-profile.c

index ec57e3a96552ae6460c22a0fcc819b85d486c0da..2cb66e83c62a23992f63bd987eb07563de47166e 100644 (file)
@@ -182,6 +182,9 @@ static unsigned int log_hashfraction;
 void
 _dl_start_profile (void)
 {
+#ifdef __CHERI_PURE_CAPABILITY__
+  __libc_fatal ("Profiling is not supported on capability architectures.");
+#else
   char *filename;
   int fd;
   struct __stat64_t64 st;
@@ -482,6 +485,7 @@ _dl_start_profile (void)
 
   /* Turn on profiling.  */
   running = 1;
+#endif
 }