public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Szabolcs Nagy <nsz@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/arm/morello/main] cheri: elf: make l_addr a capability
Date: Fri,  5 Aug 2022 19:34:09 +0000 (GMT)	[thread overview]
Message-ID: <20220805193409.25C143857363@sourceware.org> (raw)

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

commit a4f02d3f689e7ef8de6efb396ada210519ab315e
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Fri Jun 11 08:24:29 2021 +0100

    cheri: elf: make l_addr a capability
    
    l_addr should be a capability on Morello. This is synchronized with the
    same variable in gdb.
    
    Use elfptr_t when ElfW(Addr) represents a runtime pointer that may be
    dereferenced.

Diff:
---
 elf/link.h     | 6 ++++++
 include/link.h | 5 +++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/elf/link.h b/elf/link.h
index 88b1ad7fd0..c0f255ae18 100644
--- a/elf/link.h
+++ b/elf/link.h
@@ -34,6 +34,12 @@
 #include <bits/elfclass.h>		/* Defines __ELF_NATIVE_CLASS.  */
 #include <bits/link.h>
 
+#ifdef __CHERI_PURE_CAPABILITY__
+typedef uintptr_t elfptr_t;
+#else
+typedef ElfW(Addr) elfptr_t;
+#endif
+
 /* The legacy rendezvous structure used by the run-time dynamic linker to
    communicate details of shared object loading to the debugger.  */
 
diff --git a/include/link.h b/include/link.h
index 0ac82d7c77..a3e4a7fc70 100644
--- a/include/link.h
+++ b/include/link.h
@@ -83,6 +83,7 @@ struct r_search_path_struct
 extern struct r_search_path_struct __rtld_search_dirs attribute_hidden;
 extern struct r_search_path_struct __rtld_env_path_list attribute_hidden;
 
+
 /* Structure describing a loaded shared object.  The `l_next' and `l_prev'
    members form a chain of all the shared objects loaded at startup.
 
@@ -96,9 +97,9 @@ struct link_map
   {
     /* These first few members are part of the protocol with the debugger.
        This is the same format used in SVR4.  */
-
-    ElfW(Addr) l_addr;		/* Difference between the address in the ELF
+    elfptr_t l_addr;		/* Difference between the address in the ELF
 				   file and the addresses in memory.  */
+
     char *l_name;		/* Absolute file name object was found in.  */
     ElfW(Dyn) *l_ld;		/* Dynamic section of the shared object.  */
     struct link_map *l_next, *l_prev; /* Chain of loaded objects.  */


                 reply	other threads:[~2022-08-05 19:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220805193409.25C143857363@sourceware.org \
    --to=nsz@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).