about summary refs log tree commit diff
path: root/elf/rtld.c
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2022-04-20 09:54:31 +0100
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2022-11-22 14:31:25 +0000
commit0946809134764e4dc5c69f3fe464d9b3580ee83b (patch)
tree936bf6fbfd063c5ef6031091eb50aeb904cd129e /elf/rtld.c
parentb2b6a773fecd30e2404157c04f4c25ce025297b3 (diff)
downloadglibc-0946809134764e4dc5c69f3fe464d9b3580ee83b.tar.gz
glibc-0946809134764e4dc5c69f3fe464d9b3580ee83b.tar.xz
glibc-0946809134764e4dc5c69f3fe464d9b3580ee83b.zip
cheri: elf: change l_entry to be elfptr_t
It is simpler and more consistent to make l_entry a capability
throughout instead of leaving it as an address and converting before
use:

The AT_ENTRY auxv entry is specified to be a capability and a number
if internal l_entry usage is simpler if it is elfptr_t.

Functions returning a pointer to the user entry are also changed to
use elfptr_t.
Diffstat (limited to 'elf/rtld.c')
-rw-r--r--elf/rtld.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/elf/rtld.c b/elf/rtld.c
index 3e771a93d8..205df43bb2 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -384,7 +384,7 @@ extern struct rtld_global_ro _rtld_local_ro
 
 
 static void dl_main (const ElfW(Phdr) *phdr, ElfW(Word) phnum,
-		     ElfW(Addr) *user_entry, ElfW(auxv_t) *auxv);
+		     elfptr_t *user_entry, ElfW(auxv_t) *auxv);
 
 /* These two variables cannot be moved into .data.rel.ro.  */
 static struct libname_list _dl_rtld_libname;
@@ -416,15 +416,15 @@ DL_SYSINFO_IMPLEMENTATION
 #endif
 
 #ifdef DONT_USE_BOOTSTRAP_MAP
-static ElfW(Addr) _dl_start_final (void *arg);
+static elfptr_t _dl_start_final (void *arg);
 #else
 struct dl_start_final_info
 {
   struct link_map l;
   RTLD_TIMING_VAR (start_time);
 };
-static ElfW(Addr) _dl_start_final (void *arg,
-				   struct dl_start_final_info *info);
+static elfptr_t _dl_start_final (void *arg,
+				 struct dl_start_final_info *info);
 #endif
 
 /* These are defined magically by the linker.  */
@@ -446,14 +446,14 @@ RTLD_START
    this function is not inlined (see below).  */
 
 #ifdef DONT_USE_BOOTSTRAP_MAP
-static inline ElfW(Addr) __attribute__ ((always_inline))
+static inline elfptr_t __attribute__ ((always_inline))
 _dl_start_final (void *arg)
 #else
-static ElfW(Addr) __attribute__ ((noinline))
+static elfptr_t __attribute__ ((noinline))
 _dl_start_final (void *arg, struct dl_start_final_info *info)
 #endif
 {
-  ElfW(Addr) start_addr;
+  elfptr_t start_addr;
 
   /* Do not use an initializer for these members because it would
      intefere with __rtld_static_init.  */
@@ -515,7 +515,7 @@ _dl_start_final (void *arg, struct dl_start_final_info *info)
 # define bootstrap_map info.l
 #endif
 
-static ElfW(Addr) __attribute_used__
+static elfptr_t __attribute_used__
 _dl_start (void *arg)
 {
 #ifdef DONT_USE_BOOTSTRAP_MAP
@@ -1352,7 +1352,7 @@ _dl_start_args_adjust (int skip_args)
 static void
 dl_main (const ElfW(Phdr) *phdr,
 	 ElfW(Word) phnum,
-	 ElfW(Addr) *user_entry,
+	 elfptr_t *user_entry,
 	 ElfW(auxv_t) *auxv)
 {
   struct link_map *main_map;