mirror of
https://github.com/fluencelabs/musl
synced 2025-06-25 20:51:53 +00:00
save AT_HWCAP from auxv for subsequent use in machine-specific code
it's expected that this will be needed/useful only in asm, so I've given it its own symbol that can be addressed in pc-relative ways from asm rather than adding a field in the __libc structure which would require hard-coding the offset wherever it's used.
This commit is contained in:
1
src/env/__init_security.c
vendored
1
src/env/__init_security.c
vendored
@ -23,6 +23,7 @@ void __init_security(size_t *auxv)
|
||||
#endif
|
||||
|
||||
for (; auxv[0]; auxv+=2) if (auxv[0]<AUX_CNT) aux[auxv[0]] = auxv[1];
|
||||
__hwcap = aux[AT_HWCAP];
|
||||
if (aux[AT_UID]==aux[AT_EUID] && aux[AT_GID]==aux[AT_EGID]
|
||||
&& !aux[AT_SECURE]) return;
|
||||
|
||||
|
@ -13,3 +13,5 @@ struct __libc __libc;
|
||||
#ifdef BROKEN_VISIBILITY
|
||||
__asm__(".hidden __libc");
|
||||
#endif
|
||||
|
||||
size_t __hwcap;
|
||||
|
@ -18,6 +18,7 @@ struct __libc {
|
||||
int ofl_lock[2];
|
||||
};
|
||||
|
||||
extern size_t __hwcap;
|
||||
|
||||
#if !defined(__PIC__) || 100*__GNUC__+__GNUC_MINOR__ >= 303 || defined(__PCC__) || defined(__TINYC__)
|
||||
|
||||
|
Reference in New Issue
Block a user