platform_bionic/libc/bionic
Ryan Prichard 07440a8773 Replace TLS_SLOT_BIONIC_PREINIT w/ shared globals
Instead of passing the address of a KernelArgumentBlock to libc.so for
initialization, use __loader_shared_globals() to initialize globals.

Most of the work happened in the previous CLs. This CL switches a few
KernelArgumentBlock::getauxval calls to [__bionic_]getauxval and stops
routing the KernelArgumentBlock address through the libc init functions.

Bug: none
Test: bionic unit tests
Change-Id: I96c7b02c21d55c454558b7a5a9243c682782f2dd
Merged-In: I96c7b02c21d55c454558b7a5a9243c682782f2dd
(cherry picked from commit 746ad15912)
2018-12-04 13:51:56 -08:00
..
__bionic_get_shell_path.cpp Use treble_linker_namespace instead of treble. 2017-12-13 14:11:26 -08:00
__cmsg_nxthdr.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
__cxa_guard.cpp Always use CLOCK_MONOTONIC for pthreads and semaphores 2017-08-18 09:11:05 -07:00
__cxa_pure_virtual.cpp Move libc_log code into libasync_safe. 2017-05-03 08:50:43 -07:00
__cxa_thread_atexit_impl.cpp Fix dlclose for libraries with thread_local dtors 2018-01-10 10:24:06 +01:00
__errno.cpp Remove volatile from the __errno declaration. 2017-06-13 16:02:07 -07:00
__gnu_basename.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
__libc_current_sigrtmax.cpp Make unified headers' SIGRTMIN/SIGRTMAX usable before API 21. 2017-04-26 14:34:36 -07:00
__libc_current_sigrtmin.cpp Filter out reserved signals in functions that take sigset_t. 2018-02-27 14:12:30 -08:00
__libc_init_main_thread.cpp Replace TLS_SLOT_BIONIC_PREINIT w/ shared globals 2018-12-04 13:51:56 -08:00
__set_errno.cpp Move __set_errno to ndk_cruft.cpp. 2015-10-29 18:11:32 -07:00
__stack_chk_fail.cpp Move libc_log code into libasync_safe. 2017-05-03 08:50:43 -07:00
abort.cpp Generalize abort's inline_tgkill, use it in fdsan. 2018-08-31 16:39:23 -07:00
accept.cpp
accept4.cpp
access.cpp
android_set_abort_message.cpp Move the abort message to libc_shared_globals 2018-11-28 14:26:14 -08:00
arpa_inet.cpp Fix inet_aton on LP32. 2015-10-09 17:36:05 -07:00
assert.cpp Remove dead longjmperror. 2017-08-23 15:40:03 -07:00
atof.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
bionic_arc4random.cpp Replace TLS_SLOT_BIONIC_PREINIT w/ shared globals 2018-12-04 13:51:56 -08:00
bionic_futex.cpp Support priority inheritance mutex in 64bit programs. 2018-01-24 16:11:07 -08:00
bionic_netlink.cpp Fix ifaddrs error handling. 2016-10-14 14:35:26 -07:00
bionic_netlink.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
bionic_systrace.cpp Move static variable out of should_trace(). 2018-01-26 17:01:55 +08:00
bionic_time_conversions.cpp Always use CLOCK_MONOTONIC for pthreads and semaphores 2017-08-18 09:11:05 -07:00
brk.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
c16rtomb.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
c32rtomb.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
chmod.cpp
chown.cpp Remove bogus transitive includes. 2014-12-29 13:29:50 -08:00
clearenv.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
clock.cpp Move <sys/sysconf.h> to <bits/sysconf.h>. 2016-04-07 18:02:00 -07:00
clock_getcpuclockid.cpp Minor clock_getcpuclockid optimization. 2016-03-07 11:54:02 -08:00
clock_nanosleep.cpp clock_nanosleep: add CLOCK_THREAD_CPUTIME_ID special case 2016-03-28 10:29:16 -07:00
clone.cpp [hwasan] Tweak process and thread initialization. 2018-09-20 12:20:12 -07:00
connect.cpp
ctype.cpp
dirent.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
dl_iterate_phdr_static.cpp All architectures have AT_SYSINFO_EHDR now. 2017-09-22 13:08:50 -07:00
dup2.cpp Fix dup2 in the case where the two fds are equal. 2015-02-23 21:52:56 -08:00
environ.cpp Mark __BIONIC_WEAK_FOR_NATIVE_BRIDGE symbols 2017-10-27 10:01:46 +02:00
error.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
ether_aton.c Fix our *ether* headers mess. 2016-05-13 11:00:22 -07:00
ether_ntoa.c Fix our *ether* headers mess. 2016-05-13 11:00:22 -07:00
eventfd_read.cpp
eventfd_write.cpp
exec.cpp Add POSIX fexecve. 2017-10-18 16:26:17 -07:00
faccessat.cpp Add details on why AT_SYMLINK_NOFOLLOW is dangerous 2017-02-14 12:55:15 -08:00
fchmod.cpp Add POSIX fexecve. 2017-10-18 16:26:17 -07:00
fchmodat.cpp Ensure raw fchmod/fchmodat syscalls are hidden. 2015-02-03 12:10:30 -08:00
fdsan.cpp Expose libc_shared_globals to libc.so with symbol 2018-11-28 14:26:14 -08:00
ffs.cpp
fgetxattr.cpp Add POSIX fexecve. 2017-10-18 16:26:17 -07:00
flistxattr.cpp Add POSIX fexecve. 2017-10-18 16:26:17 -07:00
flockfile.cpp Revert "Revert "Remove __sinit and __sdidinit."" 2015-12-05 07:30:59 -08:00
fork.cpp Introduce api to track fd ownership in libc. 2018-07-19 14:28:54 -07:00
fortify.cpp Use ifunc for ARM32 fortify functions 2018-11-28 10:56:21 -08:00
fpclassify.cpp Remove some legacy declarations from <math.h>. 2017-10-19 14:15:31 -07:00
fsetxattr.cpp Add POSIX fexecve. 2017-10-18 16:26:17 -07:00
ftruncate.cpp Cleanup ftruncate negative test. 2015-06-01 13:22:57 -07:00
fts.c Fix various ftw/nftw "shall fail"s from POSIX. 2018-05-08 15:20:07 -07:00
ftw.cpp Fix various ftw/nftw "shall fail"s from POSIX. 2018-05-08 15:20:07 -07:00
futimens.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
get_device_api_level.cpp Add android_get_device_api_level. 2018-09-06 14:19:46 -07:00
getauxval.cpp Use shared globals so getauxval works earlier 2018-12-04 13:51:46 -08:00
getcwd.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
getdomainname.cpp Add {get,set}domainname(2) 2016-03-25 14:16:58 -07:00
getentropy.cpp Rewrite getentropy. 2018-02-05 12:57:22 -08:00
gethostname.cpp gethostname.c: change to report ENAMETOOLONG error when buflen is less 2014-11-12 12:07:33 -08:00
getloadavg.cpp Add getloadavg(3). 2018-10-23 11:23:00 -07:00
getpagesize.cpp Break up the rest of stubs.cpp. 2016-04-06 08:34:58 -07:00
getpgrp.cpp
getpid.cpp Introduce api to track fd ownership in libc. 2018-07-19 14:28:54 -07:00
getpriority.cpp Fix getpriority/setpriority types. 2016-11-29 15:14:11 -08:00
gettid.cpp Shave another uninteresting stack frame off aborts. 2017-06-20 14:58:16 -07:00
grp_pwd.cpp Always return /vendor/bin/sh as shell for OEM ids in getpwnam() etc. 2018-09-27 20:29:49 +00:00
grp_pwd_file.cpp Merge "Require vendor users and groups to start with vendor_" 2018-05-16 16:19:28 +00:00
grp_pwd_file.h Clean up bionic_macros.h a bit. 2018-10-25 11:00:00 -07:00
iconv.cpp Add missing includes. 2017-10-11 11:25:52 -07:00
icu.cpp Address a bunch of clang-tidy complaints. 2018-01-19 15:56:12 -08:00
icu_static.cpp Add libc_nopthread. 2017-10-16 21:31:37 -07:00
icu_wrappers.cpp Implement wcwidth(3) in terms of icu4c. 2017-07-27 17:08:24 -07:00
ifaddrs.cpp Fix google-explicit-constructor warnings. 2016-05-03 12:08:05 -07:00
initgroups.c
inotify_init.cpp
ioctl.cpp fix the mremap signature 2015-11-06 13:14:43 -08:00
isatty.c
jemalloc.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
jemalloc_wrapper.cpp Move to jemalloc5. 2018-11-13 10:32:33 -08:00
killpg.cpp Replace killpg. 2017-07-11 15:00:17 -07:00
langinfo.cpp Implement <langinfo.h>. 2016-11-19 11:46:54 -08:00
lchown.cpp Remove bogus transitive includes. 2014-12-29 13:29:50 -08:00
legacy_32_bit_support.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
lfs64_support.cpp CLOEXEC support in fdopen, freopen, and mkostemp/mkostemps. 2014-09-23 18:21:52 -07:00
libc_init_common.cpp Replace TLS_SLOT_BIONIC_PREINIT w/ shared globals 2018-12-04 13:51:56 -08:00
libc_init_common.h Replace TLS_SLOT_BIONIC_PREINIT w/ shared globals 2018-12-04 13:51:56 -08:00
libc_init_dynamic.cpp Replace TLS_SLOT_BIONIC_PREINIT w/ shared globals 2018-12-04 13:51:56 -08:00
libc_init_static.cpp Replace TLS_SLOT_BIONIC_PREINIT w/ shared globals 2018-12-04 13:51:56 -08:00
libgen.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
link.cpp
locale.cpp Clean up bionic_macros.h a bit. 2018-10-25 11:00:00 -07:00
lockf.cpp Fix lockf for LP32. 2016-01-26 14:32:55 -08:00
lstat.cpp
malloc_common.cpp Make __libc_init_malloc weak-for-native-bridge 2018-12-04 14:06:44 +01:00
malloc_info.cpp Clean up bionic_macros.h a bit. 2018-10-25 11:00:00 -07:00
malloc_info.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
mblen.cpp Implement mblen(3). 2016-04-28 16:41:29 -07:00
mbrtoc16.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
mbrtoc32.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
memmem.cpp libc: add const-correct string.h overloads 2017-04-05 13:17:07 -07:00
mempcpy.cpp Add GNU extensions mempcpy and wmemcpy. 2015-02-18 22:02:56 -08:00
mkdir.cpp
mkfifo.cpp Add mkfifoat(3). 2014-10-23 19:10:54 -07:00
mknod.cpp
mmap.cpp Add a legacy inline for mmap64. 2017-10-05 23:41:47 -07:00
mntent.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
mremap.cpp Add a legacy inline for mmap64. 2017-10-05 23:41:47 -07:00
ndk_cruft.cpp Clean up __isthreaded. 2017-05-11 15:29:03 -07:00
net_if.cpp Fix google-explicit-constructor warnings. 2016-05-03 12:08:05 -07:00
netdb.cpp Complete <netdb.h>. 2017-10-15 10:37:51 -07:00
NetdClient.cpp Replace android_open_proxy with dns_open_proxy 2018-11-19 18:00:37 +08:00
NetdClientDispatch.cpp Replace android_open_proxy with dns_open_proxy 2018-11-19 18:00:37 +08:00
netinet_in.cpp POSIX says IPPORT_RESERVED is in <netdb.h>. 2016-08-12 10:38:35 -07:00
new.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
nl_types.cpp Add trivial no-op <nl_types.h>. 2016-04-06 17:22:44 -07:00
open.cpp With O_TMPFILE, open(2) takes a mode argument. 2017-08-04 10:20:18 -07:00
pathconf.cpp Clean up <sys/limits.h> a bit. 2016-11-30 09:06:53 -08:00
pause.cpp Add sigset64_t and accompanying functions. 2018-01-30 18:47:16 -08:00
pipe.cpp
poll.cpp Block TIMER_SIGNAL in sigprocmask(SIG_SETMASK, ...). 2018-10-09 16:27:22 -07:00
posix_fadvise.cpp
posix_fallocate.cpp
posix_madvise.cpp implement posix_madvise 2014-12-04 11:01:28 -08:00
posix_timers.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
pthread_atfork.cpp Clean up bionic_macros.h a bit. 2018-10-25 11:00:00 -07:00
pthread_attr.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
pthread_barrier.cpp Fix pthread_barrierattr_getpshared prototype. 2016-08-11 23:18:13 -07:00
pthread_cond.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
pthread_create.cpp Split main thread init into early+late functions 2018-12-04 13:51:36 -08:00
pthread_detach.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
pthread_equal.cpp
pthread_exit.cpp Allocate a small guard region around the shadow call stack. 2018-11-16 14:37:08 -08:00
pthread_getcpuclockid.cpp Be more strict about using invalid pthread_ts. 2017-02-13 17:59:29 -08:00
pthread_getschedparam.cpp Be more strict about using invalid pthread_ts. 2017-02-13 17:59:29 -08:00
pthread_gettid_np.cpp Mark __BIONIC_WEAK_FOR_NATIVE_BRIDGE symbols 2017-10-27 10:01:46 +02:00
pthread_internal.cpp Make android_get_application_target_sdk_version available to the NDK. 2018-11-15 11:07:30 -08:00
pthread_internal.h Split main thread init into early+late functions 2018-12-04 13:51:36 -08:00
pthread_join.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
pthread_key.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
pthread_kill.cpp Properly fail with ESRCH when pthread_killing an exited thread. 2018-10-17 17:35:56 -07:00
pthread_mutex.cpp Make android_get_application_target_sdk_version available to the NDK. 2018-11-15 11:07:30 -08:00
pthread_once.cpp Use FUTEX_WAIT_BITSET to avoid converting timeouts. 2015-11-19 13:42:03 -08:00
pthread_rwlock.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
pthread_self.cpp
pthread_setname_np.cpp Be more strict about using invalid pthread_ts. 2017-02-13 17:59:29 -08:00
pthread_setschedparam.cpp Add pthread_setschedprio. 2017-10-17 09:14:05 -07:00
pthread_sigqueue.cpp Implement pthread_sigqueue. 2018-08-27 16:48:17 -07:00
pthread_spinlock.cpp Implement pthread spin. 2015-11-18 17:51:21 -08:00
ptrace.cpp
pty.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
pututline.c
raise.cpp Make raise/abort work with stale cached pid/tid values. 2017-05-10 16:42:04 -07:00
rand.cpp
readlink.cpp Remove outdated _FORTIFY_SOURCE #undefs 2017-07-21 11:25:52 -07:00
reboot.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
recv.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
rename.cpp
rmdir.cpp
scandir.cpp Clean up bionic_macros.h a bit. 2018-10-25 11:00:00 -07:00
sched_cpualloc.c bionic: fix assorted static analyzer warnings 2017-06-28 15:03:15 -07:00
sched_cpucount.c Type of second __sched_cpucount should be "const cpu_set_t*". 2018-04-13 16:07:21 -07:00
sched_getaffinity.cpp
sched_getcpu.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
semaphore.cpp Make android_get_application_target_sdk_version available to the NDK. 2018-11-15 11:07:30 -08:00
send.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
setegid.cpp
seteuid.cpp
setjmp_cookie.cpp Replace TLS_SLOT_BIONIC_PREINIT w/ shared globals 2018-12-04 13:51:56 -08:00
setpgrp.cpp
sigaction.cpp Block TIMER_SIGNAL in sigprocmask(SIG_SETMASK, ...). 2018-10-09 16:27:22 -07:00
signal.cpp Block TIMER_SIGNAL in sigprocmask(SIG_SETMASK, ...). 2018-10-09 16:27:22 -07:00
sigprocmask.cpp Block TIMER_SIGNAL in sigprocmask(SIG_SETMASK, ...). 2018-10-09 16:27:22 -07:00
socket.cpp
spawn.cpp Introduce api to track fd ownership in libc. 2018-07-19 14:28:54 -07:00
stat.cpp
statvfs.cpp Fix instances of '#if __LP64__'. 2016-09-15 14:21:28 -07:00
stdlib_l.cpp Move non-locale.h APIs out of locale.cpp. 2017-07-12 12:41:47 -07:00
strchr.cpp Remove outdated _FORTIFY_SOURCE #undefs 2017-07-21 11:25:52 -07:00
strchrnul.cpp Add strchrnul. 2015-08-26 09:59:29 -07:00
strerror.cpp Reduce strerror(3)'s impact on .data.rel.ro. 2018-12-03 08:46:21 -08:00
string_l.cpp Move non-locale.h APIs out of locale.cpp. 2017-07-12 12:41:47 -07:00
strings_l.cpp Move non-locale.h APIs out of locale.cpp. 2017-07-12 12:41:47 -07:00
strnlen.c
strrchr.cpp Remove outdated _FORTIFY_SOURCE #undefs 2017-07-21 11:25:52 -07:00
strsignal.cpp Remove _sys_signal_strings. 2018-11-27 14:43:38 -08:00
strtol.cpp Simplify atoi*/strto* for signed integers. 2017-12-21 17:44:22 -08:00
strtold.cpp Use __RENAME for long double functions. 2017-09-14 16:10:43 -07:00
swab.cpp Add POSIX swab. 2017-10-18 13:34:32 -07:00
symlink.cpp
sync_file_range.cpp Add sync_file_range to <fcntl.h>. 2016-04-05 12:17:22 -07:00
sys_epoll.cpp Add sigset64_t and accompanying functions. 2018-01-30 18:47:16 -08:00
sys_msg.cpp [mips64] Fix ipc syscalls 2016-09-09 12:24:04 +02:00
sys_sem.cpp [mips64] Fix ipc syscalls 2016-09-09 12:24:04 +02:00
sys_shm.cpp [mips64] Fix ipc syscalls 2016-09-09 12:24:04 +02:00
sys_signalfd.cpp Add sigset64_t and accompanying functions. 2018-01-30 18:47:16 -08:00
sys_time.cpp Add futimes, futimesat, and lutimes. 2016-06-08 19:51:20 -07:00
sysconf.cpp Fix sysconf errno for unknown names. 2018-04-25 22:13:14 -07:00
sysinfo.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
syslog.cpp Add the %m GNU extension to printf/wprintf. 2018-08-30 16:00:42 -07:00
system.cpp Rewrite system(3) to use posix_spawn(3). 2018-03-05 17:20:12 -08:00
system_property_api.cpp Fixup an out of date comment. 2018-07-24 13:34:34 -07:00
system_property_set.cpp Clean up bionic_macros.h a bit. 2018-10-25 11:00:00 -07:00
tdestroy.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
termios.cpp Make inline tcsetattr definition match constants. 2017-07-05 12:00:29 -07:00
thread_private.cpp Reimplement popen(3)/pclose(3). 2018-07-11 12:15:26 -07:00
time64.c Use snprintf instead of sprintf. 2014-10-07 11:28:47 -07:00
time64_config.h
timespec_get.cpp Add C11 timespec_get. 2018-07-17 13:21:05 -07:00
tmpfile.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
umount.cpp
unlink.cpp
vdso.cpp Replace TLS_SLOT_BIONIC_PREINIT w/ shared globals 2018-12-04 13:51:56 -08:00
wait.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
wchar.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
wchar_l.cpp Add remaining _l function stubs. 2018-02-13 23:14:12 -08:00
wcstod.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
wctype.cpp Modernize codebase by replacing NULL with nullptr 2018-08-02 18:09:44 -07:00
wcwidth.cpp Implement wcwidth(3) in terms of icu4c. 2017-07-27 17:08:24 -07:00
wmempcpy.cpp Add GNU extensions mempcpy and wmemcpy. 2015-02-18 22:02:56 -08:00