diff options
author | Alex Xu (Hello71) <alex_y_xu@yahoo.ca> | 2022-06-30 13:52:43 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2022-07-02 16:12:04 -0400 |
commit | 63c67053a3e42e9dff788de432f82ff07d4d772a (patch) | |
tree | 5914eb049f159c85f362e296f0822cf00c298ea3 /src/thread/sh/syscall_cp.s | |
parent | a23a3da29bcca8d179d1e4de7d059639716a5c1e (diff) | |
download | musl-63c67053a3e42e9dff788de432f82ff07d4d772a.tar.gz musl-63c67053a3e42e9dff788de432f82ff07d4d772a.tar.bz2 musl-63c67053a3e42e9dff788de432f82ff07d4d772a.tar.xz musl-63c67053a3e42e9dff788de432f82ff07d4d772a.zip |
in early stage ldso before __dls2b, call mprotect with __syscall
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: e13a2b8953ef ("implement PT_GNU_RELRO support")
Diffstat (limited to 'src/thread/sh/syscall_cp.s')
0 files changed, 0 insertions, 0 deletions