mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-06 23:02:10 +03:00
63c67053a3
if LTO is enabled, gcc hoists the call to ___errno_location outside the
loop even though the access to errno is gated behind head != &ldso
because ___errno_location is marked __attribute__((const)). this causes
the program to crash because TLS is not yet initialized when called from
__dls2. this is also possible if LTO is not enabled; even though gcc 11
doesn't do it, it is still wrong to use errno here.
since the start and end are already aligned, we can simply call
__syscall instead of using global errno.
Fixes:
|
||
---|---|---|
.. | ||
dlstart.c | ||
dynlink.c |