Update getauxval.c

This commit is contained in:
Vitaly Baranov 2021-08-12 12:10:37 +03:00 committed by GitHub
parent 242d8e1861
commit 9243e89150
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,10 +49,13 @@ static unsigned long __auxv_init(unsigned long type)
if (secure_idx != ((size_t) -1)) if (secure_idx != ((size_t) -1))
__auxv_secure = __auxv[secure_idx]; __auxv_secure = __auxv[secure_idx];
// Now we've initialized __auxv, next time getauxval() will only call __get_auxval().
a_cas_p(&getauxval_func, (void *)__auxv_init, (void *)__getauxval); a_cas_p(&getauxval_func, (void *)__auxv_init, (void *)__getauxval);
return __getauxval(type); return __getauxval(type);
} }
// First time getauxval() will call __auxv_init().
static void * volatile getauxval_func = (void *)__auxv_init; static void * volatile getauxval_func = (void *)__auxv_init;
unsigned long getauxval(unsigned long type) unsigned long getauxval(unsigned long type)