On 9/26/18 1:59 AM, Florian Weimer wrote: > * rth: > >> diff --git a/libgcc/config/aarch64/lse.c b/libgcc/config/aarch64/lse.c >> new file mode 100644 >> index 00000000000..20f4bde741f >> --- /dev/null >> +++ b/libgcc/config/aarch64/lse.c > >> +static void __attribute__((constructor)) >> +init_have_atomics(void) >> +{ >> + unsigned long hwcap = getauxval(AT_HWCAP); >> + __aa64_have_atomics = (hwcap & HWCAP_ATOMICS) != 0; >> +} > > Is there an expectation that it is possible to use the atomics in IFUNC > resolvers? Then this needs an explanation why it is safe to run with > the other kind of atomics until the initialization of > __aa64_have_atomics has happened.
Yes. The explanation is simple, in that the !have_atomics path is also atomic. It will simply use the slower load/store-exclusive path. Perhaps, despite the official ARMv8.1-Atomics name, LSE was in fact a better choice for a name after all, as its lack does not imply a lack of atomicity. And a comment, to be sure. > (GNU style requires a space before a parenthesis, at least in a function > call or function declarator.) Yes, of course. It's no longer automatic for my fingers and eyes. r~