platform_bionic/linker
Ryan Prichard 6631f9b03d Clean up TLS_SLOT_BIONIC_PREINIT usage a bit
- It is only needed for dynamic executables, so move the initialization
   out of __libc_init_main_thread and just before the solib constructor
   calls. For static executables, the slot was initialized, then never
   used or cleared. Instead, leave it clear.

 - For static executables, __libc_init_main_thread already initialized the
   stack guard, so remove the redundant __init_thread_stack_guard call.

 - Simplify the slot access/clearing a bit in __libc_preinit.

 - Remove the "__libc_init_common() will change the TLS area so the old one
   won't be accessible anyway." comment. AFAICT, it's incorrect -- the
   main thread's TLS area in a dynamic executable is initialized to a
   static pthread_internal_t object in the linker, then reused by libc.so.

Test: adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
Test: adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static
Change-Id: Ie2da6f5be3ad563fa65b38eaadf8ba6ecc6a64b6
2018-05-30 15:43:43 -07:00
..
arch Switch x86 begin.c to asm; align ESP correctly 2018-02-12 21:43:12 -08:00
tests linker: Allow link namespaces without name filters 2018-01-25 14:45:29 +08:00
Android.bp Reenable __work_around_b_24465209__ for x86 linker 2018-05-24 20:14:56 -07:00
Android.mk Convert linker from Android.mk to Android.bp 2016-07-15 13:39:29 -07:00
dlfcn.cpp linker: Allow link namespaces without name filters 2018-01-25 14:45:29 +08:00
ld.config.format.md Load namespace configuration from ld.config.txt 2017-03-24 15:50:45 -07:00
ld_android.cpp Break libdl.so and ld-android.so's dependency on libc.so. 2018-03-30 13:56:03 -07:00
linked_list.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
linker.arm.map linker: Allow link namespaces without name filters 2018-01-25 14:45:29 +08:00
linker.cpp Merge "Add secondary counter in place of tls_nodelete flag" 2018-05-30 15:32:40 +00:00
linker.generic.map linker: Allow link namespaces without name filters 2018-01-25 14:45:29 +08:00
linker.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
linker_allocator.cpp Always log errno when aborting. 2017-09-15 16:18:49 -07:00
linker_allocator.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
linker_block_allocator.cpp Always log errno when aborting. 2017-09-15 16:18:49 -07:00
linker_block_allocator.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
linker_cfi.cpp Unify linker files under one license (BSD) 2017-02-15 15:35:33 -08:00
linker_cfi.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
linker_common_types.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
linker_config.cpp Be clearer about linker warnings. 2018-02-28 12:37:28 -08:00
linker_config.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
linker_debug.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
linker_dlwarning.cpp Unify linker files under one license (BSD) 2017-02-15 15:35:33 -08:00
linker_dlwarning.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
linker_exidx_static.c Implement __gnu_Unwind_Find_exidx/__cxa_type_match 2017-08-29 18:18:27 +02:00
linker_gdb_support.cpp Unify linker files under one license (BSD) 2017-02-15 15:35:33 -08:00
linker_gdb_support.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
linker_globals.cpp Be clearer about linker warnings. 2018-02-28 12:37:28 -08:00
linker_globals.h Be clearer about linker warnings. 2018-02-28 12:37:28 -08:00
linker_libc_support.c Unify linker files under one license (BSD) 2017-02-15 15:35:33 -08:00
linker_libcxx_support.cpp Adapt to the new libc++/libc++abi update. 2018-01-08 14:44:42 -08:00
linker_logger.cpp Move libc_log code into libasync_safe. 2017-05-03 08:50:43 -07:00
linker_logger.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
linker_main.cpp Clean up TLS_SLOT_BIONIC_PREINIT usage a bit 2018-05-30 15:43:43 -07:00
linker_main.h vdso should be available in all namespaces 2018-05-12 10:58:00 +02:00
linker_mapped_file_fragment.cpp Unify linker files under one license (BSD) 2017-02-15 15:35:33 -08:00
linker_mapped_file_fragment.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
linker_memory.cpp linker_memory: return success in enable_fallback_allocator. 2018-01-24 15:08:53 -08:00
linker_mips.cpp MIPS: Fix MIPS linker VDSO issues 2017-10-13 12:08:30 +02:00
linker_namespaces.cpp Be clearer about linker warnings. 2018-02-28 12:37:28 -08:00
linker_namespaces.h Libraries without dt_soname are inaccessible 2018-04-29 13:39:46 +02:00
linker_phdr.cpp Be clearer about linker warnings. 2018-02-28 12:37:28 -08:00
linker_phdr.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
linker_reloc_iterators.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
linker_relocs.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
linker_sdk_versions.cpp Unify linker files under one license (BSD) 2017-02-15 15:35:33 -08:00
linker_sleb128.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
linker_soinfo.cpp Add secondary counter in place of tls_nodelete flag 2018-05-30 10:56:59 +02:00
linker_soinfo.h Add secondary counter in place of tls_nodelete flag 2018-05-30 10:56:59 +02:00
linker_utils.cpp Be clearer about linker warnings. 2018-02-28 12:37:28 -08:00
linker_utils.h Switch the rest of our internal headers to #pragma once. 2018-02-13 14:27:17 -08:00
linker_wrapper.cpp Use an embedded linker for host bionic 2017-09-20 13:59:13 -07:00
MODULE_LICENSE_BSD Unify linker files under one license (BSD) 2017-02-15 15:35:33 -08:00
rt.cpp More dynamic linker cleanup. 2012-10-30 16:35:38 -07:00