public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Szabolcs Nagy <szabolcs.nagy@arm.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH v2 5/5] Linux: Consolidate auxiliary vector parsing
Date: Fri, 11 Feb 2022 18:32:44 +0100	[thread overview]
Message-ID: <87v8xls403.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20220211123110.GB2692478@arm.com> (Szabolcs Nagy's message of "Fri, 11 Feb 2022 12:31:10 +0000")

* Szabolcs Nagy:

> this seems to use memset now on aarch64 before irelative
> relocs are resolved in static binaries.
>
> which causes infinite loops in the iplt (i've also seen
> segfaults in the build log).
>
> i wonder what is a clean fix...

I've reverted this for now.  I missed the “static” part before; I think
our build environment is not really set up for such redirects.  Maybe
the easiest/cleanest way for now is to use an explicit initialization
loop for !SHARED, plus -fno-tree-loop-distribute-patterns.

> char seen_auxval[AT_MINSIGSTKSZ+1] = {0};
> 
> would not trigger memset (on aarch64).
> 
> as a bonus with such an array we can distinguish auxv unset and auxv 0.

The current code does not need that because it writes the default
values first:

  auxv_values[AT_ENTRY] = (ElfW(Addr)) ENTRY_POINT;
  auxv_values[AT_PAGESZ] = EXEC_PAGESIZE;
  auxv_values[AT_FPUCW] = _FPU_DEFAULT;

On the reader side, we would need to write

  if (seen_auxval[AT_CLKTCK])
    GLRO(dl_clktck) = auxv_values[AT_CLKTCK];

and

  if (seen_auxval[AT_FPUCW])
    auxv_values[AT_FPUCW] = auxv_values[AT_FPUCW];
  else
    auxv_values[AT_FPUCW] = _FPU_DEFAULT;

, which does not look like an improvement to me (neither
maintenance-wise nor code-size-wise).

Thanks,
Florian


  parent reply	other threads:[~2022-02-11 17:32 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
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 [this message]
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=87v8xls403.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=szabolcs.nagy@arm.com \
    /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).