[PATCH] D53906: [ELF] Allow configuring the TLS layout for an Android executable

Ryan Prichard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 30 15:21:04 PDT 2018


rprichard created this revision.
Herald added subscribers: llvm-commits, kristof.beyls, arichardson, javed.absar, emaste, srhines.
Herald added a reviewer: espindola.

Add two new options:

- --android-tls-tcb=<tcb-size>
- --no-android-tls

--android-tls-tcb configures the target to use a fixed TCB size (i.e.
variant 1), and it enables the emission of a PT_ANDROID_TLS_TPOFF segment
that the Bionic linker uses to verify that a binary has been linked with
an acceptable TLS layout.

Android can't use the standard 2-word TCB layout on arm64 because Bionic's
stack protector cookie is allocated at the same location on all
architectures (((void**)$TP)[5]), and Clang for arm64 Android already uses
this location for more efficient access (see
https://reviews.llvm.org/D18632). I anticipate using the variant 1 layout
on x86[_64] too primarily to simplify implementation in Bionic.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D53906

Files:
  ELF/Arch/AArch64.cpp
  ELF/Arch/ARM.cpp
  ELF/Arch/X86.cpp
  ELF/Arch/X86_64.cpp
  ELF/Config.h
  ELF/Driver.cpp
  ELF/Options.td
  ELF/Writer.cpp
  test/ELF/aarch64-android-tls-tcb.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53906.171825.patch
Type: text/x-patch
Size: 6698 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181030/c46a3ebc/attachment.bin>


More information about the llvm-commits mailing list