diff options
author | Ryan Prichard <rprichard@google.com> | 2019-05-21 15:38:20 -0700 |
---|---|---|
committer | Ryan Prichard <rprichard@google.com> | 2019-05-23 14:21:55 -0700 |
commit | cc9b100e97ec6b9c7268c465d8e4ab5ab4be9c5f (patch) | |
tree | 85dc96054ea9f86358a62cd55f320a82056d0b8b /linker/linker.cpp | |
parent | 933bd3ae66de82bc0a9d2b985e058295c08065f9 (diff) |
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
Diffstat (limited to 'linker/linker.cpp')
0 files changed, 0 insertions, 0 deletions