AArch64: Prioritise init_have_lse_atomics constructor [PR 105708]
authorWilco Dijkstra <wilco.dijkstra@arm.com>
Wed, 25 May 2022 13:29:03 +0000 (14:29 +0100)
committerWilco Dijkstra <wdijkstr@arm.com>
Wed, 25 May 2022 14:53:30 +0000 (15:53 +0100)
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

index fc875b7..33b97c8 100644 (file)
@@ -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);