]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
allocate_once: Apply asm redirection before first use
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 25 Oct 2022 13:42:16 +0000 (10:42 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 1 Nov 2022 12:51:10 +0000 (09:51 -0300)
Compilers may not be able to apply asm redirections to functions
after these functions are used for the first time, e.g. clang 15.

Reviewed-by: Fangrui Song <maskray@google.com>
include/allocate_once.h

index a487d641d5871060523f608ed3b6efb792fc0312..d8cc08824c248843741af8df4a9fef1aa689f70f 100644 (file)
@@ -27,6 +27,9 @@ void *__libc_allocate_once_slow (void **__place,
                                  void (*__deallocate) (void *__closure,
                                                        void *__ptr),
                                  void *__closure);
+#ifndef _ISOMAC
+libc_hidden_proto (__libc_allocate_once_slow)
+#endif
 
 /* Return an a pointer to an allocated and initialized data structure.
    If this function returns a non-NULL value, the caller can assume
@@ -88,8 +91,4 @@ allocate_once (void **__place, void *(*__allocate) (void *__closure),
                                       __closure);
 }
 
-#ifndef _ISOMAC
-libc_hidden_proto (__libc_allocate_once_slow)
-#endif
-
 #endif /* _ALLOCATE_ONCE_H */