1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-11-02 09:33:31 +03:00

elf: Fix tunable handing with clang

Recent clang version optimizes some loops contructions to strlen [1],
which might generate function calls when self-relocation is not
already done (on tunable parsing).  Use an out-of-line function
with __attribute_optimization_barrier__ to avoid this.

[1] facd7dfc80

Reviewed-by: Sam James <sam@gentoo.org>
This commit is contained in:
Adhemerval Zanella
2025-10-17 16:13:22 -03:00
parent ff758345eb
commit 2ebfb31b35
2 changed files with 12 additions and 2 deletions

View File

@@ -35,6 +35,7 @@
/* The function might be called before the process is self-relocated. */
static size_t
__attribute_optimization_barrier__
_dl_debug_strlen (const char *s)
{
const char *p = s;