From: Fangrui Song <maskray@google.com>
To: libc-alpha@sourceware.org, Florian Weimer <fweimer@redhat.com>,
Szabolcs Nagy <szabolcs.nagy@arm.com>
Subject: [PATCH] elf: Simplify _dl_aux_init with inhibit_loop_to_libcall
Date: Tue, 29 Mar 2022 21:11:04 -0700 [thread overview]
Message-ID: <20220330041104.931987-1-maskray@google.com> (raw)
---
elf/Makefile | 5 -----
elf/dl-support.c | 9 ++++-----
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/elf/Makefile b/elf/Makefile
index c96924e9c2..281551d380 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -160,11 +160,6 @@ ifeq (yes,$(have-loop-to-function))
CFLAGS-rtld.c += -fno-tree-loop-distribute-patterns
endif
-ifeq (yes,$(have-loop-to-function))
-# Likewise, during static library startup, memset is not yet available.
-CFLAGS-dl-support.c = -fno-tree-loop-distribute-patterns
-endif
-
# Compile rtld itself without stack protection.
# Also compile all routines in the static library that are elided from
# the shared libc because they are in libc.a in the same way.
diff --git a/elf/dl-support.c b/elf/dl-support.c
index 153dd57ad2..b886a1462c 100644
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -245,6 +245,9 @@ __rtld_lock_define_initialized_recursive (, _dl_load_tls_lock)
int _dl_clktck;
+/* Inhibit memset for auxv_values initialization because memset may not
+ be available yet. */
+inhibit_loop_to_libcall
void
_dl_aux_init (ElfW(auxv_t) *av)
{
@@ -254,11 +257,7 @@ _dl_aux_init (ElfW(auxv_t) *av)
#endif
_dl_auxv = av;
- dl_parse_auxv_t auxv_values;
- /* Use an explicit initialization loop here because memset may not
- be available yet. */
- for (int i = 0; i < array_length (auxv_values); ++i)
- auxv_values[i] = 0;
+ dl_parse_auxv_t auxv_values = { 0 };
_dl_parse_auxv (av, auxv_values);
}
#endif
--
2.35.1.1021.g381101b075-goog
next reply other threads:[~2022-03-30 4:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-30 4:11 Fangrui Song [this message]
2022-03-31 8:56 ` 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=20220330041104.931987-1-maskray@google.com \
--to=maskray@google.com \
--cc=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).