Compare commits
83 Commits
jb-mr1.1-c
...
tools_r21
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ae762a393 | ||
|
|
9ffaabcc49 | ||
|
|
d23af23268 | ||
|
|
32ea9fe578 | ||
|
|
fb018a2dde | ||
|
|
ead7819f51 | ||
|
|
a2f596b650 | ||
|
|
42ac0e5030 | ||
|
|
c1b44ecc53 | ||
|
|
4136c3a2b7 | ||
|
|
c124baaf29 | ||
|
|
5419b94747 | ||
|
|
a9944cfe9e | ||
|
|
f8a2c51bf3 | ||
|
|
fcf901d5c0 | ||
|
|
e7e274b13a | ||
|
|
9434e8febc | ||
|
|
22d629211d | ||
|
|
db4fdf1aaf | ||
|
|
3b297c4079 | ||
|
|
417fd2334a | ||
|
|
4e75c4b2d7 | ||
|
|
1ceb9824ab | ||
|
|
b83cad7983 | ||
|
|
e5d5f7f0d8 | ||
|
|
156da96621 | ||
|
|
9a7366e894 | ||
|
|
fa7e258617 | ||
|
|
1db6f2db49 | ||
|
|
b95ad82f7d | ||
|
|
95a2a7f325 | ||
|
|
857fed50cb | ||
|
|
9017254186 | ||
|
|
b98204a9fb | ||
|
|
39d7c6072d | ||
|
|
75f4352555 | ||
|
|
7d56ccbfaa | ||
|
|
a89864a20b | ||
|
|
bb7dfcd3b8 | ||
|
|
d3bf954e9f | ||
|
|
0cc0d250fd | ||
|
|
a428bc1288 | ||
|
|
fe712e6cae | ||
|
|
31a1060a5a | ||
|
|
b650111a11 | ||
|
|
cd195eba1f | ||
|
|
774c7f54ff | ||
|
|
0fa6279f39 | ||
|
|
5b6346f6d5 | ||
|
|
bb892a1b63 | ||
|
|
d03bfe689a | ||
|
|
422b6ef92c | ||
|
|
72b08af300 | ||
|
|
f9163dd1f0 | ||
|
|
eac9eb462e | ||
|
|
fd6ca57f24 | ||
|
|
e4030e0bfc | ||
|
|
2c29bcf77f | ||
|
|
827a2604ee | ||
|
|
ac184b2142 | ||
|
|
dd9fbc8646 | ||
|
|
a48d5e5f12 | ||
|
|
8e630dacf6 | ||
|
|
855dde4426 | ||
|
|
91875dcd6e | ||
|
|
8e15b08ae2 | ||
|
|
5989ed5cb8 | ||
|
|
25937d36a0 | ||
|
|
00f339771b | ||
|
|
3307bff023 | ||
|
|
cd587701c8 | ||
|
|
0e77287209 | ||
|
|
e6dc2a664e | ||
|
|
0eb4f255d2 | ||
|
|
6e0e03c38b | ||
|
|
c746bed889 | ||
|
|
bfeb8a98b6 | ||
|
|
7b0377eda0 | ||
|
|
d769826b0d | ||
|
|
d5c654c053 | ||
|
|
3b6914bf04 | ||
|
|
c1993cac40 | ||
|
|
9c3449ecd9 |
241
libc/Android.mk
241
libc/Android.mk
@@ -8,68 +8,14 @@ libc_common_src_files := \
|
|||||||
$(syscall_src) \
|
$(syscall_src) \
|
||||||
unistd/abort.c \
|
unistd/abort.c \
|
||||||
unistd/alarm.c \
|
unistd/alarm.c \
|
||||||
unistd/brk.c \
|
|
||||||
unistd/daemon.c \
|
|
||||||
unistd/eventfd.c \
|
|
||||||
unistd/exec.c \
|
unistd/exec.c \
|
||||||
unistd/fcntl.c \
|
|
||||||
unistd/fnmatch.c \
|
unistd/fnmatch.c \
|
||||||
unistd/fstatfs.c \
|
|
||||||
unistd/ftime.c \
|
|
||||||
unistd/ftok.c \
|
|
||||||
unistd/getdtablesize.c \
|
|
||||||
unistd/gethostname.c \
|
|
||||||
unistd/getopt_long.c \
|
unistd/getopt_long.c \
|
||||||
unistd/getpgrp.c \
|
|
||||||
unistd/getpriority.c \
|
|
||||||
unistd/getpt.c \
|
|
||||||
unistd/initgroups.c \
|
|
||||||
unistd/isatty.c \
|
|
||||||
unistd/issetugid.c \
|
|
||||||
unistd/killpg.c \
|
unistd/killpg.c \
|
||||||
unistd/lseek64.c \
|
|
||||||
unistd/mmap.c \
|
|
||||||
unistd/open.c \
|
|
||||||
unistd/openat.c \
|
|
||||||
unistd/opendir.c \
|
|
||||||
unistd/pathconf.c \
|
|
||||||
unistd/perror.c \
|
|
||||||
unistd/popen.c \
|
unistd/popen.c \
|
||||||
unistd/pread.c \
|
|
||||||
unistd/pselect.c \
|
|
||||||
unistd/ptsname.c \
|
|
||||||
unistd/ptsname_r.c \
|
|
||||||
unistd/pwrite.c \
|
|
||||||
unistd/raise.c \
|
|
||||||
unistd/reboot.c \
|
|
||||||
unistd/recv.c \
|
|
||||||
unistd/sbrk.c \
|
|
||||||
unistd/send.c \
|
|
||||||
unistd/setegid.c \
|
|
||||||
unistd/setuid.c \
|
|
||||||
unistd/seteuid.c \
|
|
||||||
unistd/setreuid.c \
|
|
||||||
unistd/setresuid.c \
|
|
||||||
unistd/setpgrp.c \
|
|
||||||
unistd/sigblock.c \
|
|
||||||
unistd/siginterrupt.c \
|
|
||||||
unistd/siglist.c \
|
|
||||||
unistd/signal.c \
|
|
||||||
unistd/signame.c \
|
|
||||||
unistd/sigsetmask.c \
|
|
||||||
unistd/sigsuspend.c \
|
|
||||||
unistd/sigwait.c \
|
|
||||||
unistd/sleep.c \
|
|
||||||
unistd/statfs.c \
|
|
||||||
unistd/syslog.c \
|
unistd/syslog.c \
|
||||||
unistd/system.c \
|
unistd/system.c \
|
||||||
unistd/tcgetpgrp.c \
|
|
||||||
unistd/tcsetpgrp.c \
|
|
||||||
unistd/time.c \
|
unistd/time.c \
|
||||||
unistd/umount.c \
|
|
||||||
unistd/unlockpt.c \
|
|
||||||
unistd/usleep.c \
|
|
||||||
unistd/wait.c \
|
|
||||||
stdio/asprintf.c \
|
stdio/asprintf.c \
|
||||||
stdio/clrerr.c \
|
stdio/clrerr.c \
|
||||||
stdio/fclose.c \
|
stdio/fclose.c \
|
||||||
@@ -84,7 +30,6 @@ libc_common_src_files := \
|
|||||||
stdio/fileno.c \
|
stdio/fileno.c \
|
||||||
stdio/findfp.c \
|
stdio/findfp.c \
|
||||||
stdio/flags.c \
|
stdio/flags.c \
|
||||||
stdio/flockfile.c \
|
|
||||||
stdio/fopen.c \
|
stdio/fopen.c \
|
||||||
stdio/fprintf.c \
|
stdio/fprintf.c \
|
||||||
stdio/fpurge.c \
|
stdio/fpurge.c \
|
||||||
@@ -123,7 +68,6 @@ libc_common_src_files := \
|
|||||||
stdio/sscanf.c \
|
stdio/sscanf.c \
|
||||||
stdio/stdio.c \
|
stdio/stdio.c \
|
||||||
stdio/tempnam.c \
|
stdio/tempnam.c \
|
||||||
stdio/tmpfile.c \
|
|
||||||
stdio/tmpnam.c \
|
stdio/tmpnam.c \
|
||||||
stdio/ungetc.c \
|
stdio/ungetc.c \
|
||||||
stdio/vasprintf.c \
|
stdio/vasprintf.c \
|
||||||
@@ -136,37 +80,19 @@ libc_common_src_files := \
|
|||||||
stdio/vsscanf.c \
|
stdio/vsscanf.c \
|
||||||
stdio/wbuf.c \
|
stdio/wbuf.c \
|
||||||
stdio/wsetup.c \
|
stdio/wsetup.c \
|
||||||
stdio/__fgets_chk.c \
|
|
||||||
stdio/__snprintf_chk.c \
|
|
||||||
stdio/__sprintf_chk.c \
|
|
||||||
stdio/__vsnprintf_chk.c \
|
|
||||||
stdio/__vsprintf_chk.c \
|
|
||||||
stdlib/_rand48.c \
|
|
||||||
stdlib/assert.c \
|
stdlib/assert.c \
|
||||||
stdlib/atexit.c \
|
stdlib/atexit.c \
|
||||||
stdlib/atoi.c \
|
|
||||||
stdlib/atol.c \
|
|
||||||
stdlib/atoll.c \
|
|
||||||
stdlib/bsearch.c \
|
stdlib/bsearch.c \
|
||||||
stdlib/ctype_.c \
|
stdlib/ctype_.c \
|
||||||
stdlib/div.c \
|
stdlib/div.c \
|
||||||
stdlib/exit.c \
|
stdlib/exit.c \
|
||||||
stdlib/getenv.c \
|
stdlib/getenv.c \
|
||||||
stdlib/jrand48.c \
|
|
||||||
stdlib/ldiv.c \
|
stdlib/ldiv.c \
|
||||||
stdlib/lldiv.c \
|
stdlib/lldiv.c \
|
||||||
stdlib/locale.c \
|
|
||||||
stdlib/lrand48.c \
|
|
||||||
stdlib/mrand48.c \
|
|
||||||
stdlib/nrand48.c \
|
|
||||||
stdlib/putenv.c \
|
stdlib/putenv.c \
|
||||||
stdlib/qsort.c \
|
stdlib/qsort.c \
|
||||||
stdlib/seed48.c \
|
|
||||||
stdlib/setenv.c \
|
stdlib/setenv.c \
|
||||||
stdlib/setjmperr.c \
|
stdlib/setjmperr.c \
|
||||||
stdlib/srand48.c \
|
|
||||||
stdlib/strntoimax.c \
|
|
||||||
stdlib/strntoumax.c \
|
|
||||||
stdlib/strtod.c \
|
stdlib/strtod.c \
|
||||||
stdlib/strtoimax.c \
|
stdlib/strtoimax.c \
|
||||||
stdlib/strtol.c \
|
stdlib/strtol.c \
|
||||||
@@ -176,50 +102,29 @@ libc_common_src_files := \
|
|||||||
stdlib/strtoumax.c \
|
stdlib/strtoumax.c \
|
||||||
stdlib/tolower_.c \
|
stdlib/tolower_.c \
|
||||||
stdlib/toupper_.c \
|
stdlib/toupper_.c \
|
||||||
stdlib/wchar.c \
|
|
||||||
string/index.c \
|
string/index.c \
|
||||||
string/memccpy.c \
|
|
||||||
string/memchr.c \
|
|
||||||
string/memmem.c \
|
|
||||||
string/memrchr.c \
|
|
||||||
string/memswap.c \
|
|
||||||
string/strcasecmp.c \
|
string/strcasecmp.c \
|
||||||
string/strcasestr.c \
|
string/strcasestr.c \
|
||||||
string/strcat.c \
|
string/strcat.c \
|
||||||
string/strchr.c \
|
string/strchr.c \
|
||||||
string/strcoll.c \
|
|
||||||
string/strcspn.c \
|
string/strcspn.c \
|
||||||
string/strdup.c \
|
string/strdup.c \
|
||||||
string/strlcat.c \
|
string/strlcat.c \
|
||||||
string/strlcpy.c \
|
string/strlcpy.c \
|
||||||
string/strncat.c \
|
string/strncat.c \
|
||||||
string/strncpy.c \
|
string/strncpy.c \
|
||||||
string/strndup.c \
|
|
||||||
string/strnlen.c \
|
|
||||||
string/strpbrk.c \
|
string/strpbrk.c \
|
||||||
string/strrchr.c \
|
string/strrchr.c \
|
||||||
string/strsep.c \
|
string/strsep.c \
|
||||||
string/strspn.c \
|
string/strspn.c \
|
||||||
string/strstr.c \
|
string/strstr.c \
|
||||||
string/strtok.c \
|
string/strtok.c \
|
||||||
string/strtotimeval.c \
|
|
||||||
string/__memcpy_chk.c \
|
|
||||||
string/__memmove_chk.c \
|
|
||||||
string/__memset_chk.c \
|
|
||||||
string/__strcat_chk.c \
|
|
||||||
string/__strcpy_chk.c \
|
|
||||||
string/__strlcat_chk.c \
|
|
||||||
string/__strlcpy_chk.c \
|
|
||||||
string/__strlen_chk.c \
|
|
||||||
string/__strncat_chk.c \
|
|
||||||
string/__strncpy_chk.c \
|
|
||||||
wchar/wcpcpy.c \
|
wchar/wcpcpy.c \
|
||||||
wchar/wcpncpy.c \
|
wchar/wcpncpy.c \
|
||||||
wchar/wcscasecmp.c \
|
wchar/wcscasecmp.c \
|
||||||
wchar/wcscat.c \
|
wchar/wcscat.c \
|
||||||
wchar/wcschr.c \
|
wchar/wcschr.c \
|
||||||
wchar/wcscmp.c \
|
wchar/wcscmp.c \
|
||||||
wchar/wcscoll.c \
|
|
||||||
wchar/wcscpy.c \
|
wchar/wcscpy.c \
|
||||||
wchar/wcscspn.c \
|
wchar/wcscspn.c \
|
||||||
wchar/wcsdup.c \
|
wchar/wcsdup.c \
|
||||||
@@ -243,61 +148,148 @@ libc_common_src_files := \
|
|||||||
wchar/wmemcpy.c \
|
wchar/wmemcpy.c \
|
||||||
wchar/wmemmove.c \
|
wchar/wmemmove.c \
|
||||||
wchar/wmemset.c \
|
wchar/wmemset.c \
|
||||||
inet/bindresvport.c \
|
|
||||||
inet/inet_addr.c \
|
inet/inet_addr.c \
|
||||||
inet/inet_aton.c \
|
inet/inet_aton.c \
|
||||||
inet/inet_ntoa.c \
|
inet/inet_ntoa.c \
|
||||||
inet/inet_ntop.c \
|
inet/inet_ntop.c \
|
||||||
inet/inet_pton.c \
|
inet/inet_pton.c \
|
||||||
inet/ether_aton.c \
|
|
||||||
inet/ether_ntoa.c \
|
|
||||||
tzcode/asctime.c \
|
tzcode/asctime.c \
|
||||||
tzcode/difftime.c \
|
tzcode/difftime.c \
|
||||||
tzcode/localtime.c \
|
tzcode/localtime.c \
|
||||||
tzcode/strftime.c \
|
tzcode/strftime.c \
|
||||||
tzcode/strptime.c \
|
tzcode/strptime.c \
|
||||||
bionic/__set_errno.c \
|
|
||||||
bionic/bionic_clone.c \
|
|
||||||
bionic/cpuacct.c \
|
|
||||||
bionic/arc4random.c \
|
bionic/arc4random.c \
|
||||||
|
bionic/atoi.c \
|
||||||
|
bionic/atol.c \
|
||||||
|
bionic/atoll.c \
|
||||||
bionic/basename.c \
|
bionic/basename.c \
|
||||||
bionic/basename_r.c \
|
bionic/basename_r.c \
|
||||||
|
bionic/bindresvport.c \
|
||||||
|
bionic/bionic_clone.c \
|
||||||
|
bionic/brk.c \
|
||||||
bionic/clearenv.c \
|
bionic/clearenv.c \
|
||||||
|
bionic/cpuacct.c \
|
||||||
|
bionic/daemon.c \
|
||||||
bionic/dirname.c \
|
bionic/dirname.c \
|
||||||
bionic/dirname_r.c \
|
bionic/dirname_r.c \
|
||||||
bionic/drand48.c \
|
|
||||||
bionic/erand48.c \
|
|
||||||
bionic/err.c \
|
bionic/err.c \
|
||||||
|
bionic/ether_aton.c \
|
||||||
|
bionic/ether_ntoa.c \
|
||||||
|
bionic/eventfd.c \
|
||||||
|
bionic/fcntl.c \
|
||||||
bionic/fdprintf.c \
|
bionic/fdprintf.c \
|
||||||
|
bionic/__fgets_chk.c \
|
||||||
|
bionic/flockfile.c \
|
||||||
bionic/fork.c \
|
bionic/fork.c \
|
||||||
|
bionic/fstatfs.c \
|
||||||
|
bionic/ftime.c \
|
||||||
|
bionic/ftok.c \
|
||||||
bionic/fts.c \
|
bionic/fts.c \
|
||||||
bionic/getcwd.cpp \
|
bionic/getcwd.cpp \
|
||||||
bionic/if_nametoindex.c \
|
bionic/getdtablesize.c \
|
||||||
|
bionic/gethostname.c \
|
||||||
|
bionic/getpgrp.c \
|
||||||
|
bionic/getpriority.c \
|
||||||
|
bionic/getpt.c \
|
||||||
bionic/if_indextoname.c \
|
bionic/if_indextoname.c \
|
||||||
|
bionic/if_nametoindex.c \
|
||||||
|
bionic/initgroups.c \
|
||||||
bionic/ioctl.c \
|
bionic/ioctl.c \
|
||||||
|
bionic/isatty.c \
|
||||||
|
bionic/issetugid.c \
|
||||||
bionic/ldexp.c \
|
bionic/ldexp.c \
|
||||||
bionic/libc_init_common.c \
|
bionic/libc_init_common.c \
|
||||||
|
bionic/locale.c \
|
||||||
bionic/logd_write.c \
|
bionic/logd_write.c \
|
||||||
|
bionic/lseek64.c \
|
||||||
bionic/md5.c \
|
bionic/md5.c \
|
||||||
|
bionic/memccpy.c \
|
||||||
|
bionic/memchr.c \
|
||||||
|
bionic/__memcpy_chk.c \
|
||||||
|
bionic/memmem.c \
|
||||||
|
bionic/__memmove_chk.c \
|
||||||
bionic/memmove_words.c \
|
bionic/memmove_words.c \
|
||||||
|
bionic/memrchr.c \
|
||||||
|
bionic/__memset_chk.c \
|
||||||
|
bionic/memswap.c \
|
||||||
|
bionic/mmap.c \
|
||||||
|
bionic/openat.c \
|
||||||
|
bionic/open.c \
|
||||||
|
bionic/opendir.c \
|
||||||
|
bionic/pathconf.c \
|
||||||
|
bionic/perror.c \
|
||||||
|
bionic/pread.c \
|
||||||
|
bionic/pselect.c \
|
||||||
|
bionic/ptsname.c \
|
||||||
|
bionic/ptsname_r.c \
|
||||||
bionic/pututline.c \
|
bionic/pututline.c \
|
||||||
|
bionic/pwrite.c \
|
||||||
|
bionic/raise.c \
|
||||||
bionic/realpath.c \
|
bionic/realpath.c \
|
||||||
bionic/sched_getaffinity.c \
|
bionic/reboot.c \
|
||||||
bionic/sched_getcpu.c \
|
bionic/recv.c \
|
||||||
|
bionic/sbrk.c \
|
||||||
bionic/sched_cpualloc.c \
|
bionic/sched_cpualloc.c \
|
||||||
bionic/sched_cpucount.c \
|
bionic/sched_cpucount.c \
|
||||||
|
bionic/sched_getaffinity.c \
|
||||||
|
bionic/sched_getcpu.c \
|
||||||
bionic/semaphore.c \
|
bionic/semaphore.c \
|
||||||
|
bionic/send.c \
|
||||||
|
bionic/setegid.c \
|
||||||
|
bionic/__set_errno.c \
|
||||||
|
bionic/seteuid.c \
|
||||||
|
bionic/setpgrp.c \
|
||||||
|
bionic/setresuid.c \
|
||||||
|
bionic/setreuid.c \
|
||||||
|
bionic/setuid.c \
|
||||||
bionic/sha1.c \
|
bionic/sha1.c \
|
||||||
|
bionic/sigblock.c \
|
||||||
|
bionic/siginterrupt.c \
|
||||||
|
bionic/siglist.c \
|
||||||
|
bionic/signal.c \
|
||||||
|
bionic/signame.c \
|
||||||
|
bionic/sigsetmask.c \
|
||||||
|
bionic/sigsuspend.c \
|
||||||
|
bionic/sigwait.c \
|
||||||
|
bionic/sleep.c \
|
||||||
|
bionic/__snprintf_chk.c \
|
||||||
|
bionic/__sprintf_chk.c \
|
||||||
|
bionic/statfs.c \
|
||||||
|
bionic/__strcat_chk.c \
|
||||||
|
bionic/strcoll.c \
|
||||||
|
bionic/__strcpy_chk.c \
|
||||||
bionic/strerror.cpp \
|
bionic/strerror.cpp \
|
||||||
bionic/strerror_r.cpp \
|
bionic/strerror_r.cpp \
|
||||||
|
bionic/__strlcat_chk.c \
|
||||||
|
bionic/__strlcpy_chk.c \
|
||||||
|
bionic/__strlen_chk.c \
|
||||||
|
bionic/__strncat_chk.c \
|
||||||
|
bionic/__strncpy_chk.c \
|
||||||
|
bionic/strndup.c \
|
||||||
|
bionic/strnlen.c \
|
||||||
|
bionic/strntoimax.c \
|
||||||
|
bionic/strntoumax.c \
|
||||||
bionic/strsignal.cpp \
|
bionic/strsignal.cpp \
|
||||||
|
bionic/strtotimeval.c \
|
||||||
bionic/stubs.cpp \
|
bionic/stubs.cpp \
|
||||||
bionic/system_properties.c \
|
bionic/system_properties.c \
|
||||||
|
bionic/tcgetpgrp.c \
|
||||||
|
bionic/tcsetpgrp.c \
|
||||||
bionic/tdestroy.c \
|
bionic/tdestroy.c \
|
||||||
bionic/time64.c \
|
|
||||||
bionic/thread_atexit.c \
|
bionic/thread_atexit.c \
|
||||||
|
bionic/time64.c \
|
||||||
|
bionic/tmpfile.cpp \
|
||||||
|
bionic/__umask_chk.c \
|
||||||
|
bionic/umount.c \
|
||||||
|
bionic/unlockpt.c \
|
||||||
|
bionic/usleep.c \
|
||||||
bionic/utime.c \
|
bionic/utime.c \
|
||||||
bionic/utmp.c \
|
bionic/utmp.c \
|
||||||
|
bionic/__vsnprintf_chk.c \
|
||||||
|
bionic/__vsprintf_chk.c \
|
||||||
|
bionic/wait.c \
|
||||||
|
bionic/wchar.c \
|
||||||
|
bionic/wcscoll.c \
|
||||||
netbsd/gethnamaddr.c \
|
netbsd/gethnamaddr.c \
|
||||||
netbsd/isc/ev_timers.c \
|
netbsd/isc/ev_timers.c \
|
||||||
netbsd/isc/ev_streams.c \
|
netbsd/isc/ev_streams.c \
|
||||||
@@ -339,6 +331,17 @@ libc_upstream_netbsd_src_files := \
|
|||||||
upstream-netbsd/libc/regex/regerror.c \
|
upstream-netbsd/libc/regex/regerror.c \
|
||||||
upstream-netbsd/libc/regex/regexec.c \
|
upstream-netbsd/libc/regex/regexec.c \
|
||||||
upstream-netbsd/libc/regex/regfree.c \
|
upstream-netbsd/libc/regex/regfree.c \
|
||||||
|
upstream-netbsd/libc/stdio/getdelim.c \
|
||||||
|
upstream-netbsd/libc/stdio/getline.c \
|
||||||
|
upstream-netbsd/libc/stdlib/drand48.c \
|
||||||
|
upstream-netbsd/libc/stdlib/erand48.c \
|
||||||
|
upstream-netbsd/libc/stdlib/jrand48.c \
|
||||||
|
upstream-netbsd/libc/stdlib/lrand48.c \
|
||||||
|
upstream-netbsd/libc/stdlib/mrand48.c \
|
||||||
|
upstream-netbsd/libc/stdlib/nrand48.c \
|
||||||
|
upstream-netbsd/libc/stdlib/_rand48.c \
|
||||||
|
upstream-netbsd/libc/stdlib/seed48.c \
|
||||||
|
upstream-netbsd/libc/stdlib/srand48.c \
|
||||||
upstream-netbsd/libc/stdlib/tdelete.c \
|
upstream-netbsd/libc/stdlib/tdelete.c \
|
||||||
upstream-netbsd/libc/stdlib/tfind.c \
|
upstream-netbsd/libc/stdlib/tfind.c \
|
||||||
upstream-netbsd/libc/stdlib/tsearch.c \
|
upstream-netbsd/libc/stdlib/tsearch.c \
|
||||||
@@ -358,40 +361,40 @@ libc_upstream_netbsd_src_files := \
|
|||||||
# below.
|
# below.
|
||||||
#
|
#
|
||||||
libc_static_common_src_files := \
|
libc_static_common_src_files := \
|
||||||
unistd/sysconf.c \
|
|
||||||
bionic/__errno.c \
|
bionic/__errno.c \
|
||||||
|
bionic/sysconf.c \
|
||||||
|
|
||||||
# Architecture specific source files go here
|
# Architecture specific source files go here
|
||||||
# =========================================================
|
# =========================================================
|
||||||
ifeq ($(TARGET_ARCH),arm)
|
ifeq ($(TARGET_ARCH),arm)
|
||||||
libc_common_src_files += \
|
libc_common_src_files += \
|
||||||
arch-arm/bionic/__get_sp.S \
|
|
||||||
arch-arm/bionic/_exit_with_stack_teardown.S \
|
|
||||||
arch-arm/bionic/_setjmp.S \
|
|
||||||
arch-arm/bionic/abort_arm.S \
|
arch-arm/bionic/abort_arm.S \
|
||||||
arch-arm/bionic/atomics_arm.c \
|
arch-arm/bionic/atomics_arm.c \
|
||||||
arch-arm/bionic/clone.S \
|
arch-arm/bionic/clone.S \
|
||||||
arch-arm/bionic/eabi.c \
|
arch-arm/bionic/eabi.c \
|
||||||
|
arch-arm/bionic/_exit_with_stack_teardown.S \
|
||||||
arch-arm/bionic/ffs.S \
|
arch-arm/bionic/ffs.S \
|
||||||
arch-arm/bionic/futex_arm.S \
|
arch-arm/bionic/futex_arm.S \
|
||||||
|
arch-arm/bionic/__get_sp.S \
|
||||||
arch-arm/bionic/kill.S \
|
arch-arm/bionic/kill.S \
|
||||||
arch-arm/bionic/libgcc_compat.c \
|
arch-arm/bionic/libgcc_compat.c \
|
||||||
arch-arm/bionic/tkill.S \
|
|
||||||
arch-arm/bionic/tgkill.S \
|
|
||||||
arch-arm/bionic/memcmp.S \
|
|
||||||
arch-arm/bionic/memcmp16.S \
|
arch-arm/bionic/memcmp16.S \
|
||||||
|
arch-arm/bionic/memcmp.S \
|
||||||
arch-arm/bionic/memcpy.S \
|
arch-arm/bionic/memcpy.S \
|
||||||
arch-arm/bionic/memset.S \
|
arch-arm/bionic/memset.S \
|
||||||
|
arch-arm/bionic/_setjmp.S \
|
||||||
arch-arm/bionic/setjmp.S \
|
arch-arm/bionic/setjmp.S \
|
||||||
arch-arm/bionic/sigsetjmp.S \
|
arch-arm/bionic/sigsetjmp.S \
|
||||||
arch-arm/bionic/strlen.c.arm \
|
|
||||||
arch-arm/bionic/strcpy.S \
|
|
||||||
arch-arm/bionic/strcmp.S \
|
arch-arm/bionic/strcmp.S \
|
||||||
|
arch-arm/bionic/strcpy.S \
|
||||||
|
arch-arm/bionic/strlen.c.arm \
|
||||||
arch-arm/bionic/syscall.S \
|
arch-arm/bionic/syscall.S \
|
||||||
string/memmove.c.arm \
|
arch-arm/bionic/tgkill.S \
|
||||||
|
arch-arm/bionic/tkill.S \
|
||||||
|
bionic/memmove.c.arm \
|
||||||
|
bionic/socketcalls.c \
|
||||||
string/bcopy.c \
|
string/bcopy.c \
|
||||||
string/strncmp.c \
|
string/strncmp.c \
|
||||||
unistd/socketcalls.c
|
|
||||||
|
|
||||||
# These files need to be arm so that gdbserver
|
# These files need to be arm so that gdbserver
|
||||||
# can set breakpoints in them without messing
|
# can set breakpoints in them without messing
|
||||||
@@ -476,8 +479,8 @@ libc_common_src_files += \
|
|||||||
arch-mips/string/mips_strlen.c
|
arch-mips/string/mips_strlen.c
|
||||||
|
|
||||||
libc_common_src_files += \
|
libc_common_src_files += \
|
||||||
|
bionic/memcmp.c \
|
||||||
string/bcopy.c \
|
string/bcopy.c \
|
||||||
string/memcmp.c \
|
|
||||||
string/strcmp.c \
|
string/strcmp.c \
|
||||||
string/strcpy.c \
|
string/strcpy.c \
|
||||||
string/strncmp.c
|
string/strncmp.c
|
||||||
|
|||||||
61
libc/NOTICE
61
libc/NOTICE
@@ -438,6 +438,40 @@ SUCH DAMAGE.
|
|||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 1982, 1986, 1993
|
||||||
|
The Regents of the University of California. All rights reserved.
|
||||||
|
(c) UNIX System Laboratories, Inc.
|
||||||
|
All or some portions of this file are derived from material licensed
|
||||||
|
to the University of California by American Telephone and Telegraph
|
||||||
|
Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
||||||
|
the permission of UNIX System Laboratories, Inc.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions
|
||||||
|
are met:
|
||||||
|
1. Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
3. Neither the name of the University nor the names of its contributors
|
||||||
|
may be used to endorse or promote products derived from this software
|
||||||
|
without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||||
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||||
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGE.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 1983, 1987, 1989
|
Copyright (c) 1983, 1987, 1989
|
||||||
The Regents of the University of California. All rights reserved.
|
The Regents of the University of California. All rights reserved.
|
||||||
|
|
||||||
@@ -3833,6 +3867,33 @@ SUCH DAMAGE.
|
|||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
|
Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||||
|
|
||||||
|
This code is derived from software contributed to The NetBSD Foundation
|
||||||
|
by Roy Marples.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions
|
||||||
|
are met:
|
||||||
|
1. Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||||
|
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
|
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2010 MIPS Technologies, Inc.
|
Copyright (c) 2010 MIPS Technologies, Inc.
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ int delete_module(const char*, unsigned int) 129
|
|||||||
int klogctl:syslog(int, char *, int) 103
|
int klogctl:syslog(int, char *, int) 103
|
||||||
int sysinfo(struct sysinfo *) 116
|
int sysinfo(struct sysinfo *) 116
|
||||||
int personality(unsigned long) 136
|
int personality(unsigned long) 136
|
||||||
long perf_event_open(struct perf_event_attr *attr_uptr, pid_t pid, int cpu, int group_fd, unsigned long flags) 364
|
long perf_event_open(struct perf_event_attr *attr_uptr, pid_t pid, int cpu, int group_fd, unsigned long flags) 364,336,333
|
||||||
|
|
||||||
# futex
|
# futex
|
||||||
int futex(void *, int, int, void *, void *, int) 240,240,238
|
int futex(void *, int, int, void *, void *, int) 240,240,238
|
||||||
|
|||||||
53
libc/bionic/__umask_chk.c
Normal file
53
libc/bionic/__umask_chk.c
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2012 The Android Open Source Project
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||||
|
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
* SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#undef _FORTIFY_SOURCE
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <private/logd.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Runtime implementation of __umask_chk.
|
||||||
|
*
|
||||||
|
* Validate that umask is called with sane mode.
|
||||||
|
*
|
||||||
|
* This umask check is called if _FORTIFY_SOURCE is defined and
|
||||||
|
* greater than 0.
|
||||||
|
*/
|
||||||
|
mode_t __umask_chk(mode_t mode)
|
||||||
|
{
|
||||||
|
if ((mode & 0777) != mode) {
|
||||||
|
__libc_android_log_print(ANDROID_LOG_FATAL, "libc",
|
||||||
|
"*** FORTIFY_SOURCE: umask called with invalid mask ***\n");
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
return umask(mode);
|
||||||
|
}
|
||||||
@@ -40,22 +40,23 @@ char* getcwd(char* buf, size_t size) {
|
|||||||
|
|
||||||
// Allocate a buffer if necessary.
|
// Allocate a buffer if necessary.
|
||||||
char* allocated_buf = NULL;
|
char* allocated_buf = NULL;
|
||||||
|
size_t allocated_size = size;
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
size_t allocated_size = size;
|
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
// The Linux kernel won't return more than a page, so translate size 0 to 4KiB.
|
// The Linux kernel won't return more than a page, so translate size 0 to 4KiB.
|
||||||
// TODO: if we need to support paths longer than that, we'll have to walk the tree ourselves.
|
// TODO: if we need to support paths longer than that, we'll have to walk the tree ourselves.
|
||||||
size = getpagesize();
|
allocated_size = getpagesize();
|
||||||
}
|
}
|
||||||
buf = allocated_buf = static_cast<char*>(malloc(allocated_size));
|
buf = allocated_buf = static_cast<char*>(malloc(allocated_size));
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
// malloc set errno.
|
// malloc should set errno, but valgrind's malloc wrapper doesn't.
|
||||||
|
errno = ENOMEM;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ask the kernel to fill our buffer.
|
// Ask the kernel to fill our buffer.
|
||||||
int rc = __getcwd(buf, size);
|
int rc = __getcwd(buf, allocated_size);
|
||||||
if (rc == -1) {
|
if (rc == -1) {
|
||||||
free(allocated_buf);
|
free(allocated_buf);
|
||||||
// __getcwd set errno.
|
// __getcwd set errno.
|
||||||
|
|||||||
@@ -26,31 +26,30 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <pthread.h>
|
|
||||||
#include <time.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <sys/socket.h>
|
#include <dlfcn.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <sys/socket.h>
|
||||||
#include <errno.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <unwind.h>
|
|
||||||
#include <dlfcn.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/system_properties.h>
|
#include <sys/system_properties.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <unwind.h>
|
||||||
|
|
||||||
#include "dlmalloc.h"
|
#include "dlmalloc.h"
|
||||||
#include "logd.h"
|
#include "logd.h"
|
||||||
|
|
||||||
#include "malloc_debug_common.h"
|
|
||||||
#include "malloc_debug_check_mapinfo.h"
|
#include "malloc_debug_check_mapinfo.h"
|
||||||
|
#include "malloc_debug_common.h"
|
||||||
|
#include "ScopedPthreadMutexLocker.h"
|
||||||
|
|
||||||
static mapinfo *milist;
|
static mapinfo *milist;
|
||||||
|
|
||||||
@@ -407,14 +406,16 @@ extern "C" void chk_free(void *ptr) {
|
|||||||
extern "C" void *chk_realloc(void *ptr, size_t size) {
|
extern "C" void *chk_realloc(void *ptr, size_t size) {
|
||||||
// log_message("%s: %s\n", __FILE__, __FUNCTION__);
|
// log_message("%s: %s\n", __FILE__, __FUNCTION__);
|
||||||
|
|
||||||
|
if (!ptr) {
|
||||||
|
return chk_malloc(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef REALLOC_ZERO_BYTES_FREE
|
||||||
if (!size) {
|
if (!size) {
|
||||||
chk_free(ptr);
|
chk_free(ptr);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (!ptr) {
|
|
||||||
return chk_malloc(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
hdr_t* hdr = meta(ptr);
|
hdr_t* hdr = meta(ptr);
|
||||||
|
|
||||||
|
|||||||
@@ -40,12 +40,15 @@
|
|||||||
* or static (libc.a) linking.
|
* or static (libc.a) linking.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <pthread.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include "dlmalloc.h"
|
|
||||||
#include "malloc_debug_common.h"
|
#include "malloc_debug_common.h"
|
||||||
|
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "dlmalloc.h"
|
||||||
|
#include "ScopedPthreadMutexLocker.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In a VM process, this is set to 1 after fork()ing out of zygote.
|
* In a VM process, this is set to 1 after fork()ing out of zygote.
|
||||||
*/
|
*/
|
||||||
@@ -376,7 +379,7 @@ static void malloc_init_impl() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lets see which .so must be loaded for the requested debug level
|
// Choose the appropriate .so for the requested debug level.
|
||||||
switch (debug_level) {
|
switch (debug_level) {
|
||||||
case 1:
|
case 1:
|
||||||
case 5:
|
case 5:
|
||||||
|
|||||||
@@ -33,6 +33,8 @@
|
|||||||
#ifndef MALLOC_DEBUG_COMMON_H
|
#ifndef MALLOC_DEBUG_COMMON_H
|
||||||
#define MALLOC_DEBUG_COMMON_H
|
#define MALLOC_DEBUG_COMMON_H
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define HASHTABLE_SIZE 1543
|
#define HASHTABLE_SIZE 1543
|
||||||
#define BACKTRACE_SIZE 32
|
#define BACKTRACE_SIZE 32
|
||||||
/* flag definitions, currently sharing storage with "size" */
|
/* flag definitions, currently sharing storage with "size" */
|
||||||
@@ -101,18 +103,4 @@ typedef void (*MallocDebugFini)();
|
|||||||
#define info_log(format, ...) \
|
#define info_log(format, ...) \
|
||||||
__libc_android_log_print(ANDROID_LOG_INFO, "malloc_leak_check", (format), ##__VA_ARGS__ )
|
__libc_android_log_print(ANDROID_LOG_INFO, "malloc_leak_check", (format), ##__VA_ARGS__ )
|
||||||
|
|
||||||
class ScopedPthreadMutexLocker {
|
|
||||||
public:
|
|
||||||
explicit ScopedPthreadMutexLocker(pthread_mutex_t* mu) : mu_(mu) {
|
|
||||||
pthread_mutex_lock(mu_);
|
|
||||||
}
|
|
||||||
|
|
||||||
~ScopedPthreadMutexLocker() {
|
|
||||||
pthread_mutex_unlock(mu_);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
pthread_mutex_t* mu_;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // MALLOC_DEBUG_COMMON_H
|
#endif // MALLOC_DEBUG_COMMON_H
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@@ -36,19 +37,18 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <unwind.h>
|
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/system_properties.h>
|
#include <sys/system_properties.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <unwind.h>
|
||||||
|
|
||||||
#include "dlmalloc.h"
|
#include "dlmalloc.h"
|
||||||
#include "logd.h"
|
#include "logd.h"
|
||||||
#include "malloc_debug_common.h"
|
#include "malloc_debug_common.h"
|
||||||
|
#include "ScopedPthreadMutexLocker.h"
|
||||||
|
|
||||||
// This file should be included into the build only when
|
// This file should be included into the build only when
|
||||||
// MALLOC_LEAK_CHECK, or MALLOC_QEMU_INSTRUMENT, or both
|
// MALLOC_LEAK_CHECK, or MALLOC_QEMU_INSTRUMENT, or both
|
||||||
@@ -366,7 +366,7 @@ extern "C" void* leak_memalign(size_t alignment, size_t bytes) {
|
|||||||
alignment = 1L << (31 - __builtin_clz(alignment));
|
alignment = 1L << (31 - __builtin_clz(alignment));
|
||||||
}
|
}
|
||||||
|
|
||||||
// here, aligment is at least MALLOC_ALIGNMENT<<1 bytes
|
// here, alignment is at least MALLOC_ALIGNMENT<<1 bytes
|
||||||
// we will align by at least MALLOC_ALIGNMENT bytes
|
// we will align by at least MALLOC_ALIGNMENT bytes
|
||||||
// and at most alignment-MALLOC_ALIGNMENT bytes
|
// and at most alignment-MALLOC_ALIGNMENT bytes
|
||||||
size_t size = (alignment-MALLOC_ALIGNMENT) + bytes;
|
size_t size = (alignment-MALLOC_ALIGNMENT) + bytes;
|
||||||
|
|||||||
@@ -163,20 +163,20 @@ __get_stack_base(int *p_stack_size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void __init_tls(void** tls, void* thread)
|
void __init_tls(void** tls, void* thread) {
|
||||||
{
|
((pthread_internal_t*) thread)->tls = tls;
|
||||||
int nn;
|
|
||||||
|
|
||||||
((pthread_internal_t*)thread)->tls = tls;
|
// Zero-initialize all the slots.
|
||||||
|
for (size_t i = 0; i < BIONIC_TLS_SLOTS; ++i) {
|
||||||
|
tls[i] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// slot 0 must point to the tls area, this is required by the implementation
|
// Slot 0 must point to the tls area, this is required by the implementation
|
||||||
// of the x86 Linux kernel thread-local-storage
|
// of the x86 Linux kernel thread-local-storage.
|
||||||
tls[TLS_SLOT_SELF] = (void*)tls;
|
tls[TLS_SLOT_SELF] = (void*) tls;
|
||||||
tls[TLS_SLOT_THREAD_ID] = thread;
|
tls[TLS_SLOT_THREAD_ID] = thread;
|
||||||
for (nn = TLS_SLOT_ERRNO; nn < BIONIC_TLS_SLOTS; nn++)
|
|
||||||
tls[nn] = 0;
|
|
||||||
|
|
||||||
__set_tls( (void*)tls );
|
__set_tls((void*) tls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,13 @@ typedef struct pthread_internal_t
|
|||||||
int internal_flags;
|
int internal_flags;
|
||||||
__pthread_cleanup_t* cleanup_stack;
|
__pthread_cleanup_t* cleanup_stack;
|
||||||
void** tls; /* thread-local storage area */
|
void** tls; /* thread-local storage area */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The dynamic linker implements dlerror(3), which makes it hard for us to implement this
|
||||||
|
* per-thread buffer by simply using malloc(3) and free(3).
|
||||||
|
*/
|
||||||
|
#define __BIONIC_DLERROR_BUFFER_SIZE 512
|
||||||
|
char dlerror_buffer[__BIONIC_DLERROR_BUFFER_SIZE];
|
||||||
} pthread_internal_t;
|
} pthread_internal_t;
|
||||||
|
|
||||||
int _init_thread(pthread_internal_t* thread, pid_t kernel_id, pthread_attr_t* attr,
|
int _init_thread(pthread_internal_t* thread, pid_t kernel_id, pthread_attr_t* attr,
|
||||||
|
|||||||
@@ -41,6 +41,6 @@ char* strerror(int error_number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LOCAL_INIT_THREAD_LOCAL_BUFFER(char*, strerror, NL_TEXTMAX);
|
LOCAL_INIT_THREAD_LOCAL_BUFFER(char*, strerror, NL_TEXTMAX);
|
||||||
strerror_r(error_number, strerror_buffer, strerror_buffer_size);
|
strerror_r(error_number, strerror_tls_buffer, strerror_tls_buffer_size);
|
||||||
return strerror_buffer;
|
return strerror_tls_buffer;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,5 +42,5 @@ char* strsignal(int signal_number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LOCAL_INIT_THREAD_LOCAL_BUFFER(char*, strsignal, NL_TEXTMAX);
|
LOCAL_INIT_THREAD_LOCAL_BUFFER(char*, strsignal, NL_TEXTMAX);
|
||||||
return const_cast<char*>(__strsignal(signal_number, strsignal_buffer, strsignal_buffer_size));
|
return const_cast<char*>(__strsignal(signal_number, strsignal_tls_buffer, strsignal_tls_buffer_size));
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user