public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/arm/morello/main] cheri: elf: change l_entry to be elfptr_t
@ 2022-11-23 14:47 Szabolcs Nagy
0 siblings, 0 replies; 3+ 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=0946809134764e4dc5c69f3fe464d9b3580ee83b
commit 0946809134764e4dc5c69f3fe464d9b3580ee83b
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date: Wed Apr 20 09:54:31 2022 +0100
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.
Diff:
---
elf/rtld.c | 18 +++++++++---------
include/link.h | 2 +-
sysdeps/generic/ldsodefs.h | 4 ++--
sysdeps/unix/sysv/linux/dl-sysdep.c | 6 +++---
4 files changed, 15 insertions(+), 15 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;
diff --git a/include/link.h b/include/link.h
index 79c8a57690..a3548a7a93 100644
--- a/include/link.h
+++ b/include/link.h
@@ -133,7 +133,7 @@ struct link_map
ElfW(Dyn) *l_info[DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM
+ DT_EXTRANUM + DT_VALNUM + DT_ADDRNUM];
const ElfW(Phdr) *l_phdr; /* Pointer to program header table in core. */
- ElfW(Addr) l_entry; /* Entry point location. */
+ elfptr_t l_entry; /* Entry point location. */
ElfW(Half) l_phnum; /* Number of program header entries. */
ElfW(Half) l_ldnum; /* Number of dynamic segment entries. */
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index f8cd388e62..4c407e4f24 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -1161,10 +1161,10 @@ extern void *_dl_sysdep_read_whole_file (const char *file, size_t *sizep,
After this, file access calls and getenv must work. This is responsible
for setting __libc_enable_secure if we need to be secure (e.g. setuid),
and for setting _dl_argc and _dl_argv, and then calling _dl_main. */
-extern ElfW(Addr) _dl_sysdep_start (void **start_argptr,
+extern elfptr_t _dl_sysdep_start (void **start_argptr,
void (*dl_main) (const ElfW(Phdr) *phdr,
ElfW(Word) phnum,
- ElfW(Addr) *user_entry,
+ elfptr_t *user_entry,
ElfW(auxv_t) *auxv))
attribute_hidden;
diff --git a/sysdeps/unix/sysv/linux/dl-sysdep.c b/sysdeps/unix/sysv/linux/dl-sysdep.c
index 9e15c5bf69..b77d7fbb0e 100644
--- a/sysdeps/unix/sysv/linux/dl-sysdep.c
+++ b/sysdeps/unix/sysv/linux/dl-sysdep.c
@@ -67,7 +67,7 @@ struct dl_main_arguments
{
const ElfW(Phdr) *phdr;
ElfW(Word) phnum;
- ElfW(Addr) user_entry;
+ elfptr_t user_entry;
};
/* Separate function, so that dl_main can be called without the large
@@ -95,10 +95,10 @@ _dl_sysdep_parse_arguments (void **start_argptr,
args->user_entry = auxv_values[AT_ENTRY];
}
-ElfW(Addr)
+elfptr_t
_dl_sysdep_start (void **start_argptr,
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))
{
__libc_stack_end = DL_STACK_END (start_argptr);
^ permalink raw reply [flat|nested] 3+ messages in thread
* [glibc/arm/morello/main] cheri: elf: change l_entry to be elfptr_t
@ 2022-10-27 13:57 Szabolcs Nagy
0 siblings, 0 replies; 3+ 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=50bbdb94d32a75a577f393bf58cbc14f67d2fbea
commit 50bbdb94d32a75a577f393bf58cbc14f67d2fbea
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date: Wed Apr 20 09:54:31 2022 +0100
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.
Diff:
---
elf/rtld.c | 18 +++++++++---------
include/link.h | 2 +-
sysdeps/generic/ldsodefs.h | 4 ++--
sysdeps/unix/sysv/linux/dl-sysdep.c | 6 +++---
4 files changed, 15 insertions(+), 15 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;
diff --git a/include/link.h b/include/link.h
index 79c8a57690..a3548a7a93 100644
--- a/include/link.h
+++ b/include/link.h
@@ -133,7 +133,7 @@ struct link_map
ElfW(Dyn) *l_info[DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM
+ DT_EXTRANUM + DT_VALNUM + DT_ADDRNUM];
const ElfW(Phdr) *l_phdr; /* Pointer to program header table in core. */
- ElfW(Addr) l_entry; /* Entry point location. */
+ elfptr_t l_entry; /* Entry point location. */
ElfW(Half) l_phnum; /* Number of program header entries. */
ElfW(Half) l_ldnum; /* Number of dynamic segment entries. */
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index f8cd388e62..4c407e4f24 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -1161,10 +1161,10 @@ extern void *_dl_sysdep_read_whole_file (const char *file, size_t *sizep,
After this, file access calls and getenv must work. This is responsible
for setting __libc_enable_secure if we need to be secure (e.g. setuid),
and for setting _dl_argc and _dl_argv, and then calling _dl_main. */
-extern ElfW(Addr) _dl_sysdep_start (void **start_argptr,
+extern elfptr_t _dl_sysdep_start (void **start_argptr,
void (*dl_main) (const ElfW(Phdr) *phdr,
ElfW(Word) phnum,
- ElfW(Addr) *user_entry,
+ elfptr_t *user_entry,
ElfW(auxv_t) *auxv))
attribute_hidden;
diff --git a/sysdeps/unix/sysv/linux/dl-sysdep.c b/sysdeps/unix/sysv/linux/dl-sysdep.c
index 9e15c5bf69..b77d7fbb0e 100644
--- a/sysdeps/unix/sysv/linux/dl-sysdep.c
+++ b/sysdeps/unix/sysv/linux/dl-sysdep.c
@@ -67,7 +67,7 @@ struct dl_main_arguments
{
const ElfW(Phdr) *phdr;
ElfW(Word) phnum;
- ElfW(Addr) user_entry;
+ elfptr_t user_entry;
};
/* Separate function, so that dl_main can be called without the large
@@ -95,10 +95,10 @@ _dl_sysdep_parse_arguments (void **start_argptr,
args->user_entry = auxv_values[AT_ENTRY];
}
-ElfW(Addr)
+elfptr_t
_dl_sysdep_start (void **start_argptr,
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))
{
__libc_stack_end = DL_STACK_END (start_argptr);
^ permalink raw reply [flat|nested] 3+ messages in thread
* [glibc/arm/morello/main] cheri: elf: change l_entry to be elfptr_t
@ 2022-10-26 15:19 Szabolcs Nagy
0 siblings, 0 replies; 3+ messages in thread
From: Szabolcs Nagy @ 2022-10-26 15:19 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0618e0602c1097dc687b1f515902e9fa81b0ffec
commit 0618e0602c1097dc687b1f515902e9fa81b0ffec
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date: Wed Apr 20 09:54:31 2022 +0100
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.
Diff:
---
elf/rtld.c | 18 +++++++++---------
include/link.h | 2 +-
sysdeps/generic/ldsodefs.h | 4 ++--
sysdeps/unix/sysv/linux/dl-sysdep.c | 6 +++---
4 files changed, 15 insertions(+), 15 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;
diff --git a/include/link.h b/include/link.h
index 79c8a57690..a3548a7a93 100644
--- a/include/link.h
+++ b/include/link.h
@@ -133,7 +133,7 @@ struct link_map
ElfW(Dyn) *l_info[DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM
+ DT_EXTRANUM + DT_VALNUM + DT_ADDRNUM];
const ElfW(Phdr) *l_phdr; /* Pointer to program header table in core. */
- ElfW(Addr) l_entry; /* Entry point location. */
+ elfptr_t l_entry; /* Entry point location. */
ElfW(Half) l_phnum; /* Number of program header entries. */
ElfW(Half) l_ldnum; /* Number of dynamic segment entries. */
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index f8cd388e62..4c407e4f24 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -1161,10 +1161,10 @@ extern void *_dl_sysdep_read_whole_file (const char *file, size_t *sizep,
After this, file access calls and getenv must work. This is responsible
for setting __libc_enable_secure if we need to be secure (e.g. setuid),
and for setting _dl_argc and _dl_argv, and then calling _dl_main. */
-extern ElfW(Addr) _dl_sysdep_start (void **start_argptr,
+extern elfptr_t _dl_sysdep_start (void **start_argptr,
void (*dl_main) (const ElfW(Phdr) *phdr,
ElfW(Word) phnum,
- ElfW(Addr) *user_entry,
+ elfptr_t *user_entry,
ElfW(auxv_t) *auxv))
attribute_hidden;
diff --git a/sysdeps/unix/sysv/linux/dl-sysdep.c b/sysdeps/unix/sysv/linux/dl-sysdep.c
index 9e15c5bf69..b77d7fbb0e 100644
--- a/sysdeps/unix/sysv/linux/dl-sysdep.c
+++ b/sysdeps/unix/sysv/linux/dl-sysdep.c
@@ -67,7 +67,7 @@ struct dl_main_arguments
{
const ElfW(Phdr) *phdr;
ElfW(Word) phnum;
- ElfW(Addr) user_entry;
+ elfptr_t user_entry;
};
/* Separate function, so that dl_main can be called without the large
@@ -95,10 +95,10 @@ _dl_sysdep_parse_arguments (void **start_argptr,
args->user_entry = auxv_values[AT_ENTRY];
}
-ElfW(Addr)
+elfptr_t
_dl_sysdep_start (void **start_argptr,
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))
{
__libc_stack_end = DL_STACK_END (start_argptr);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-23 14:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-23 14:47 [glibc/arm/morello/main] cheri: elf: change l_entry to be elfptr_t Szabolcs Nagy
-- strict thread matches above, loose matches on Subject: below --
2022-10-27 13:57 Szabolcs Nagy
2022-10-26 15:19 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).