From 75c4e4909ae2667f56487434f99c2915b4570794 Mon Sep 17 00:00:00 2001 From: Wilco Dijkstra Date: Wed, 25 May 2022 14:29:03 +0100 Subject: [PATCH] AArch64: Prioritise init_have_lse_atomics constructor [PR 105708] Increase the priority of the init_have_lse_atomics constructor so it runs before other constructors. This improves chances that rr works when LSE atomics are supported. libgcc/ PR libgcc/105708 * config/aarch64/lse-init.c: Increase constructor priority. --- libgcc/config/aarch64/lse-init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libgcc/config/aarch64/lse-init.c b/libgcc/config/aarch64/lse-init.c index fc875b7fe80e9..33b97c8d76689 100644 --- a/libgcc/config/aarch64/lse-init.c +++ b/libgcc/config/aarch64/lse-init.c @@ -38,7 +38,9 @@ _Bool __aarch64_have_lse_atomics unsigned long int __getauxval (unsigned long int); -static void __attribute__((constructor)) +/* Use a higher priority to ensure it runs before user constructors + and library constructors with priority 100. */ +static void __attribute__((constructor (90))) init_have_lse_atomics (void) { unsigned long hwcap = __getauxval (AT_HWCAP);