For Google b/8315591, experimental implementation of dlopen_with_offset.
Forward-ported from cl/59286541, cl/59438930
(ppluzhnikov, google-local)
+
+malloc/malloc.c
+ports/sysdeps/unix/sysv/linux/aarch64/nptl/localplt.data
+sysdeps/generic/localplt.data
+sysdeps/unix/sysv/linux/i386/nptl/localplt.data
+sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/localplt.data
+ For b/5732800, expose calls from malloc to mmap, munmap, and sbrk.
+ Forward ported from cl/42670015, with changes.
+ (ppluzhnikov, google-local)
/* Definition for getting more memory from the OS. */
+#if 0 /* Google-local: b/5732800: make calls go through PLT instead. */
#define MORECORE (*__morecore)
#define MORECORE_FAILURE 0
+#else
+#define __mmap mmap
+#define __munmap munmap
+#define __mremap mremap
+#define __mprotect mprotect
+#define MORECORE sbrk
+#define MORECORE_FAILURE -1
+#endif
void * __default_morecore (ptrdiff_t);
void *(*__morecore)(ptrdiff_t) = __default_morecore;