ARC/NPTL: clone to set TP if CLONE_SETTLS
commit99ac739b20856adf7085c524bb3e60987d97a45e
authorVineet Gupta <vgupta@synopsys.com>
Fri, 25 Jul 2014 12:09:08 +0000 (25 17:39 +0530)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Mon, 18 Aug 2014 09:52:35 +0000 (18 11:52 +0200)
tree27c5a7f99e18b675892cd047819d95b6966b99e2
parentfd4a5861e29ddc4d77bb9a14d48f5c8969fb80a3
ARC/NPTL: clone to set TP if CLONE_SETTLS

Typically kernel would set the TP register of newly created thread in
clone syscall with CLONE_SETTLS.

However this implies that:
* kernel knows of the exact TP register (which is already different for
  ARCompact and ARCv2) and is a detail which becomes part of the ABI
* kernel also needs to handle the unlikely but possible case of !TLS
  userspace (e.g. Android libc) case where TP reg is not reserved and
  thus need not be mucked with (using ELF personality based detection)

It is better to confine this detail to userspace runtime and set TP reg
right after clone syscall returns.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
libc/sysdeps/linux/arc/clone.S