For b/5732800, expose calls from malloc to mmap,munmap, etc. (Forward-ported from cl/42670015)

This commit is contained in:
Brooks Moses 2014-03-13 16:21:31 -07:00
parent 17c46147bc
commit e2172e072d
6 changed files with 38 additions and 0 deletions

View File

@ -278,3 +278,12 @@ sysdeps/generic/ldsodefs.h
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)

View File

@ -398,8 +398,17 @@ __malloc_assert (const char *assertion, const char *file, unsigned int line,
/* 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;

View File

@ -5,7 +5,12 @@ libc.so: calloc
libc.so: free
libc.so: malloc
libc.so: memalign
libc.so: mmap
libc.so: mprotect
libc.so: mremap
libc.so: munmap
libc.so: realloc
libc.so: sbrk
libc.so: __signbit
libc.so: __signbitl
libm.so: matherr

View File

@ -5,5 +5,10 @@ libc.so: calloc
libc.so: free
libc.so: malloc
libc.so: memalign
libc.so: mmap
libc.so: mprotect
libc.so: mremap
libc.so: munmap
libc.so: realloc
libc.so: sbrk
libm.so: matherr

View File

@ -3,5 +3,10 @@ libc.so: calloc
libc.so: free
libc.so: malloc
libc.so: memalign
libc.so: mmap
libc.so: mprotect
libc.so: mremap
libc.so: munmap
libc.so: realloc
libc.so: sbrk
libm.so: matherr

View File

@ -2,5 +2,10 @@ libc.so: calloc
libc.so: free
libc.so: malloc
libc.so: memalign
libc.so: mmap
libc.so: mprotect
libc.so: mremap
libc.so: munmap
libc.so: realloc
libc.so: sbrk
libm.so: matherr