have ldso track replacement of aligned_alloc
authorRich Felker <dalias@aerifal.cx>
Thu, 11 Jun 2020 02:02:45 +0000 (22:02 -0400)
committerRich Felker <dalias@aerifal.cx>
Thu, 11 Jun 2020 02:02:45 +0000 (22:02 -0400)
this is in preparation for improving behavior of malloc interposition.

ldso/dynlink.c
src/internal/dynlink.h
src/malloc/replaced.c

index f6926919ad19762ebb24a92f38fbe81d819a85e8..d3d4ddd287fe91a23331bfd47934c9b7924e5c7b 100644 (file)
@@ -1935,6 +1935,8 @@ void __dls3(size_t *sp, size_t *auxv)
         * possibility of incomplete replacement. */
        if (find_sym(head, "malloc", 1).dso != &ldso)
                __malloc_replaced = 1;
+       if (find_sym(head, "aligned_alloc", 1).dso != &ldso)
+               __aligned_alloc_replaced = 1;
 
        /* Switch to runtime mode: any further failures in the dynamic
         * linker are a reportable failure rather than a fatal startup
index 78baa0804d4ebe2bf5520e796089722bd4627c3f..51c0639ff48bfab1adaafaed23fe95763633e477 100644 (file)
@@ -106,6 +106,7 @@ hidden void __dl_vseterr(const char *, va_list);
 hidden ptrdiff_t __tlsdesc_static(), __tlsdesc_dynamic();
 
 hidden extern int __malloc_replaced;
+hidden extern int __aligned_alloc_replaced;
 hidden void __malloc_donate(char *, char *);
 hidden int __malloc_allzerop(void *);
 
index 8acc249c8884abf8badf75c7680aeb6f201fd61a..07fce61ec08d67f39fce99e659719042ad17f356 100644 (file)
@@ -1,3 +1,4 @@
 #include "dynlink.h"
 
 int __malloc_replaced;
+int __aligned_alloc_replaced;