]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
cheri: elf: make l_addr a capability
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Fri, 11 Jun 2021 07:24:29 +0000 (08:24 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Fri, 5 Aug 2022 18:45:19 +0000 (19:45 +0100)
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.

elf/link.h
include/link.h

index 88b1ad7fd014a6eef38cd6a42a271f18fedcad76..c0f255ae18a8a8fef72c562e002d0308cfd40b8d 100644 (file)
 #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.  */
 
index 0ac82d7c774f0975bbc9eaae4792e881eab67aeb..a3e4a7fc700b9bc7500753cdea9b52a13f37f7f8 100644 (file)
@@ -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.  */