public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH v2 5/5] Linux: Consolidate auxiliary vector parsing
Date: Tue, 8 Feb 2022 19:57:58 -0300	[thread overview]
Message-ID: <86eead09-64ac-b12f-4c24-ae6e4e12c4ff@linaro.org> (raw)
In-Reply-To: <87v8xp3xng.fsf@oldenburg.str.redhat.com>



On 08/02/2022 17:34, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>>> diff --git a/sysdeps/unix/sysv/linux/dl-parse_auxv.h b/sysdeps/unix/sysv/linux/dl-parse_auxv.h
>>> new file mode 100644
>>> index 0000000000..f450c6c5ce
>>> --- /dev/null
>>> +++ b/sysdeps/unix/sysv/linux/dl-parse_auxv.h
> 
>>> +typedef ElfW(Addr) dl_parse_auxv_t[AT_MINSIGSTKSZ + 1];
>>> +
>>> +/* Copy the auxiliary vector into AUX_VALUES and set up GLRO
>>> +   variables.  */
>>> +static inline
>>> +void _dl_parse_auxv (ElfW(auxv_t) *av, dl_parse_auxv_t auxv_values)
>>> +{
>>> +  auxv_values[AT_ENTRY] =  (ElfW(Addr)) ENTRY_POINT;
>>
>> Extra whitespace.
> 
> Fxied.
> 
>>> +  auxv_values[AT_PAGESZ] = EXEC_PAGESIZE;
>>> +  auxv_values[AT_FPUCW] = _FPU_DEFAULT;
>>> +
>>> +  /* NB: Default to a constant CONSTANT_MINSIGSTKSZ.  */
>>> +  _Static_assert (__builtin_constant_p (CONSTANT_MINSIGSTKSZ),
>>> +                  "CONSTANT_MINSIGSTKSZ is constant");
>>
>> Shouldn't it warn that CONSTANT_MINSIGSTKSZ is not a constant?
> 
> Sorry, would please rephrase?  Should I change this to
> ""CONSTANT_MINSIGSTKSZ is not constant"?

Yeah because on a the _Static_assert failure the resulting message seems
to the opposite of what triggered it.

> 
>>> +  auxv_values[AT_MINSIGSTKSZ] = CONSTANT_MINSIGSTKSZ;
>>> +
>>> +  for (; av->a_type != AT_NULL; av++)
>>> +    if (av->a_type <= AT_MINSIGSTKSZ)
>>> +      auxv_values[av->a_type] = av->a_un.a_val;
>>> +
>>> +  GLRO(dl_pagesize) = auxv_values[AT_PAGESZ];
>>> +  __libc_enable_secure = auxv_values[AT_SECURE];
>>> +  GLRO(dl_platform) = (void *) auxv_values[AT_PLATFORM];
>>> +  GLRO(dl_hwcap) = auxv_values[AT_HWCAP];
>>> +  GLRO(dl_hwcap2) = auxv_values[AT_HWCAP2];
>>> +  GLRO(dl_clktck) = auxv_values[AT_CLKTCK];
>>> +  GLRO(dl_fpu_control) = auxv_values[AT_FPUCW];
>>> +  _dl_random = (void *) auxv_values[AT_RANDOM];
>>> +  GLRO(dl_minsigstacksize) = auxv_values[AT_MINSIGSTKSZ];
>>> +  GLRO(dl_sysinfo_dso) = (void *) auxv_values[AT_SYSINFO_EHDR];
>>> +#ifdef NEED_DL_SYSINFO
>>
>> I think you can now assume NEED_DL_SYSINFO is always defined.
> 
> NEED_DL_SYSINFO is only defined by i386 and ia64, only
> NEED_DL_SYSINFO_DSO is always defined on Linux.

Indeed, my confusion here.

> 
> Thanks,
> Florian
> 

  reply	other threads:[~2022-02-08 22:58 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
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 [this message]
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=86eead09-64ac-b12f-4c24-ae6e4e12c4ff@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).