about summary refs log tree commit diff
path: root/absl/debugging/internal/vdso_support.h
diff options
context:
space:
mode:
Diffstat (limited to 'absl/debugging/internal/vdso_support.h')
-rw-r--r--absl/debugging/internal/vdso_support.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/absl/debugging/internal/vdso_support.h b/absl/debugging/internal/vdso_support.h
index 870a60a4109c..8002c7405fad 100644
--- a/absl/debugging/internal/vdso_support.h
+++ b/absl/debugging/internal/vdso_support.h
@@ -41,6 +41,7 @@
 
 #include <atomic>
 
+#include "absl/base/attributes.h"
 #include "absl/debugging/internal/elf_mem_image.h"
 
 #ifdef ABSL_HAVE_ELF_MEM_IMAGE
@@ -132,7 +133,7 @@ class VDSOSupport {
 
   // This function pointer may point to InitAndGetCPU,
   // GetCPUViaSyscall, or __vdso_getcpu at different stages of initialization.
-  static std::atomic<GetCpuFn> getcpu_fn_;
+  ABSL_CONST_INIT static std::atomic<GetCpuFn> getcpu_fn_;
 
   friend int GetCPU(void);  // Needs access to getcpu_fn_.