diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2023-12-06 10:24:01 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2023-12-19 13:25:45 -0300 |
commit | 2a969b53c0b02fed7e43473a92f219d737fd217a (patch) | |
tree | b55eda5dc496c260e9757a5fc3856838d85b38fd /nptl/alloca_cutoff.c | |
parent | 5275fc784c8113c84c85ca028ce621f68fe6642b (diff) | |
download | glibc-2a969b53c0b02fed7e43473a92f219d737fd217a.tar glibc-2a969b53c0b02fed7e43473a92f219d737fd217a.tar.gz glibc-2a969b53c0b02fed7e43473a92f219d737fd217a.tar.bz2 glibc-2a969b53c0b02fed7e43473a92f219d737fd217a.zip |
elf: Do not duplicate the GLIBC_TUNABLES string
The tunable parsing duplicates the tunable environment variable so it
null-terminates each one since it simplifies the later parsing. It has
the drawback of adding another point of failure (__minimal_malloc
failing), and the memory copy requires tuning the compiler to avoid mem
operations calls.
The parsing now tracks the tunable start and its size. The
dl-tunable-parse.h adds helper functions to help parsing, like a strcmp
that also checks for size and an iterator for suboptions that are
comma-separated (used on hwcap parsing by x86, powerpc, and s390x).
Since the environment variable is allocated on the stack by the kernel,
it is safe to keep the references to the suboptions for later parsing
of string tunables (as done by set_hwcaps by multiple architectures).
Checked on x86_64-linux-gnu, powerpc64le-linux-gnu, and
aarch64-linux-gnu.
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Diffstat (limited to 'nptl/alloca_cutoff.c')
0 files changed, 0 insertions, 0 deletions