From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH v2 3/5] Linux: Remove DL_FIND_ARG_COMPONENTS
Date: Tue, 8 Feb 2022 17:12:21 -0300 [thread overview]
Message-ID: <b23df6a1-0cce-7354-c3a3-19376f5fd470@linaro.org> (raw)
In-Reply-To: <9bec36d1dd2abe94ec402c22c213f1aac6350aed.1643886336.git.fweimer@redhat.com>
On 03/02/2022 08:08, Florian Weimer via Libc-alpha wrote:
> The generic definition is always used since the Native Client
> port has been removed.
LGTM, thanks.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
> ---
> sysdeps/unix/sysv/linux/dl-sysdep.c | 25 ++++++++++---------------
> 1 file changed, 10 insertions(+), 15 deletions(-)
>
> diff --git a/sysdeps/unix/sysv/linux/dl-sysdep.c b/sysdeps/unix/sysv/linux/dl-sysdep.c
> index 72aa109f2f..a13e0ea7ad 100644
> --- a/sysdeps/unix/sysv/linux/dl-sysdep.c
> +++ b/sysdeps/unix/sysv/linux/dl-sysdep.c
> @@ -59,19 +59,6 @@ void *__libc_stack_end attribute_relro = NULL;
> rtld_hidden_data_def(__libc_stack_end)
> void *_dl_random attribute_relro = NULL;
>
> -#ifndef DL_FIND_ARG_COMPONENTS
> -# define DL_FIND_ARG_COMPONENTS(cookie, argc, argv, envp, auxp) \
> - do { \
> - void **_tmp; \
> - (argc) = *(long int *) cookie; \
> - (argv) = (char **) ((long int *) cookie + 1); \
> - (envp) = (argv) + (argc) + 1; \
> - for (_tmp = (void **) (envp); *_tmp; ++_tmp) \
> - continue; \
> - (auxp) = (void *) ++_tmp; \
> - } while (0)
> -#endif
> -
> #ifndef DL_STACK_END
> # define DL_STACK_END(cookie) ((void *) (cookie))
> #endif
> @@ -90,8 +77,16 @@ _dl_sysdep_start (void **start_argptr,
> #endif
>
> __libc_stack_end = DL_STACK_END (start_argptr);
> - DL_FIND_ARG_COMPONENTS (start_argptr, _dl_argc, _dl_argv, _environ,
> - GLRO(dl_auxv));
> + _dl_argc = (intptr_t) *start_argptr;
> + _dl_argv = (char **) (start_argptr + 1); /* Necessary aliasing violation. */
> + _environ = _dl_argv + _dl_argc + 1;
> + for (char **tmp = _environ + 1; ; ++tmp)
> + if (*tmp == NULL)
> + {
> + /* Another necessary aliasing violation. */
> + GLRO(dl_auxv) = (ElfW(auxv_t) *) (tmp + 1);
> + break;
> + }
>
> user_entry = (ElfW(Addr)) ENTRY_POINT;
> GLRO(dl_platform) = NULL; /* Default to nothing known about the platform. */
next prev parent reply other threads:[~2022-02-08 20:12 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-03 11:08 [PATCH v2 0/5] Linux: Auxiliary vector parsing cleanups Florian Weimer
2022-02-03 11:08 ` [PATCH v2 1/5] elf: Merge dl-sysdep.c into the Linux version Florian Weimer
2022-02-08 20:09 ` Adhemerval Zanella
2022-02-03 11:08 ` [PATCH v2 2/5] Linux: Remove HAVE_AUX_SECURE, HAVE_AUX_XID, HAVE_AUX_PAGESIZE Florian Weimer
2022-02-08 20:11 ` Adhemerval Zanella
2022-02-03 11:08 ` [PATCH v2 3/5] Linux: Remove DL_FIND_ARG_COMPONENTS Florian Weimer
2022-02-08 20:12 ` Adhemerval Zanella [this message]
2022-02-03 11:08 ` [PATCH v2 4/5] Linux: Assume that NEED_DL_SYSINFO_DSO is always defined Florian Weimer
2022-02-08 20:13 ` Adhemerval Zanella
2022-02-03 11:08 ` [PATCH v2 5/5] Linux: Consolidate auxiliary vector parsing Florian Weimer
2022-02-08 20:19 ` Adhemerval Zanella
2022-02-08 20:34 ` Florian Weimer
2022-02-08 22:57 ` Adhemerval Zanella
2022-02-10 10:54 ` Florian Weimer
2022-02-10 11:29 ` Adhemerval Zanella
2022-02-10 11:31 ` Florian Weimer
2022-02-10 11:40 ` Adhemerval Zanella
2022-02-10 11:46 ` Adhemerval Zanella
2022-02-11 12:31 ` Szabolcs Nagy
2022-02-11 12:47 ` Adhemerval Zanella
2022-02-11 13:24 ` Szabolcs Nagy
2022-02-11 13:48 ` Adhemerval Zanella
2022-02-11 14:42 ` H.J. Lu
2022-02-11 14:56 ` Florian Weimer
2022-02-11 13:49 ` Florian Weimer
2022-02-11 14:17 ` Adhemerval Zanella
2022-02-11 14:29 ` Szabolcs Nagy
2022-02-11 18:15 ` Adhemerval Zanella
2022-02-11 17:32 ` Florian Weimer
2022-02-11 17:49 ` Szabolcs Nagy
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=b23df6a1-0cce-7354-c3a3-19376f5fd470@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=fweimer@redhat.com \
--cc=libc-alpha@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).