platform_bionic/libc/arch-common/bionic
Ryan Prichard cc9b100e97 Overalign the TLS segment using crtbegin
Android's current lld build has a hack that overaligns TLS segments, but
it broke glibc when it produced TLS segments where (p_vaddr % p_align) was
non-zero. Move the hack into Bionic's crtbegin instead. It will emit a
0-sized, 64-byte alignment TLS segment into executables that don't use
TLS, but that should be harmless.

This variant of the hack is compatible with the gold and lld linkers. The
ld.bfd linker will optimize the .tdata output section out if its size is
zero, preventing the overalignment in an executable that only has .tbss
sections. This problem could be fixed by adding a ". = .;" statement
inside .tdata in ld.bfd's linker script.

See discussion on https://reviews.llvm.org/D61824.

Bug: https://bugs.llvm.org/show_bug.cgi?id=41527
Test: bionic unit tests, boot a device
Change-Id: I34df8b5594b6518d4590e4861e3d0b74d6fa754e
2019-05-23 14:21:55 -07:00
..
__dso_handle.h Remove an obsolete aarch64 hack. 2017-10-25 10:57:02 -07:00
__dso_handle_so.h Remove an obsolete aarch64 hack. 2017-10-25 10:57:02 -07:00
asm_multiarch.h Properly align init/fini_arrays for crtend.o 2015-05-07 12:56:15 -07:00
atexit.h Fixes for __cxa_finalize 2014-05-05 11:36:57 -07:00
crtbegin.c Overalign the TLS segment using crtbegin 2019-05-23 14:21:55 -07:00
crtbegin_so.c Call __emutls_unregister_key on dlclose 2018-06-19 13:22:36 -07:00
crtbrand.S Change crtbrand for host bionic 2018-10-22 17:15:22 -07:00
crtend.S Properly align init/fini_arrays for crtend.o 2015-05-07 12:56:15 -07:00
crtend_so.S Properly align init/fini_arrays for crtend.o 2015-05-07 12:56:15 -07:00
pthread_atfork.h Add _FORCE_CRT_ATFORK config for crtbegin. 2018-01-24 22:36:31 -08:00