glibc/sysdeps/arm
Florian Weimer 627f5ede70 Remove TLS_TCB_ALIGN and TLS_INIT_TCB_ALIGN
TLS_INIT_TCB_ALIGN is not actually used.  TLS_TCB_ALIGN was likely
introduced to support a configuration where the thread pointer
has not the same alignment as THREAD_SELF.  Only ia64 seems to use
that, but for the stack/pointer guard, not for storing tcbhead_t.
Some ports use TLS_TCB_OFFSET and TLS_PRE_TCB_SIZE to shift
the thread pointer, potentially landing in a different residue class
modulo the alignment, but the changes should not impact that.

In general, given that TLS variables have their own alignment
requirements, having different alignment for the (unshifted) thread
pointer and struct pthread would potentially result in dynamic
offsets, leading to more complexity.

hppa had different values before: __alignof__ (tcbhead_t), which
seems to be 4, and __alignof__ (struct pthread), which was 8
(old default) and is now 32.  However, it defines THREAD_SELF as:

/* Return the thread descriptor for the current thread.  */
# define THREAD_SELF \
  ({ struct pthread *__self;			\
	__self = __get_cr27();			\
	__self - 1;				\
   })

So the thread pointer points after struct pthread (hence __self - 1),
and they have to have the same alignment on hppa as well.

Similarly, on ia64, the definitions were different.  We have:

# define TLS_PRE_TCB_SIZE \
  (sizeof (struct pthread)						\
   + (PTHREAD_STRUCT_END_PADDING < 2 * sizeof (uintptr_t)		\
      ? ((2 * sizeof (uintptr_t) + __alignof__ (struct pthread) - 1)	\
	 & ~(__alignof__ (struct pthread) - 1))				\
      : 0))
# define THREAD_SELF \
  ((struct pthread *) ((char *) __thread_self - TLS_PRE_TCB_SIZE))

And TLS_PRE_TCB_SIZE is a multiple of the struct pthread alignment
(confirmed by the new _Static_assert in sysdeps/ia64/libc-tls.c).

On m68k, we have a larger gap between tcbhead_t and struct pthread.
But as far as I can tell, the port is fine with that.  The definition
of TCB_OFFSET is sufficient to handle the shifted TCB scenario.

This fixes commit 23c77f6018
("nptl: Increase default TCB alignment to 32").

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2021-12-09 23:47:49 +01:00
..
armv6 Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
armv6t2 Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
armv7 Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
be arm: Fix softp-fp Implies (BZ #25635) 2020-03-06 09:53:24 -03:00
bits Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
include/bits Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
le arm: Fix softp-fp Implies (BZ #25635) 2020-03-06 09:53:24 -03:00
nofpu Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nptl Remove TLS_TCB_ALIGN and TLS_INIT_TCB_ALIGN 2021-12-09 23:47:49 +01:00
sys Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
__longjmp.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
add_n.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
addmul_1.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_assert.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_atexit.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_errno_addr.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_lcsts.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_localeconv.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_math.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_mb_cur_max.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_memclr.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_memcpy.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_memmove.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_memset.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_sighandlers.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
aeabi_unwind_cpp_pr1.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
arm-features.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
arm-ifunc.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
arm-mcount.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
arm-unwind-resume.S Implement _Unwind_Resume in libc on top of <unwind-link.h> 2021-03-01 16:00:03 +01:00
atomic-machine.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
backtrace.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
bsd-_setjmp.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
bsd-setjmp.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
configure Remove configure test for ARM TLS descriptors support. 2015-10-27 23:56:50 +00:00
configure.ac Remove configure test for ARM TLS descriptors support. 2015-10-27 23:56:50 +00:00
crti.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
crtn.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
dl-irel.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
dl-lookupcfg.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
dl-machine-rel.h elf: Fix dynamic-link.h usage on rtld.c 2021-10-14 14:52:07 -03:00
dl-machine.h arm: Use internal symbol for _dl_argv on _dl_start_user 2021-11-01 16:21:53 -03:00
dl-sysdep.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
dl-tls.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
dl-tlsdesc.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
dl-tlsdesc.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
dl-trampoline.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
elf-initfini.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fclrexcpt.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fedisblxcpt.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
feenablxcpt.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
fegetenv.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fegetexcept.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
fegetmode.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fegetround.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
feholdexcpt.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fenv_private.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fesetenv.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fesetexcept.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fesetmode.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fesetround.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
feupdateenv.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
fgetexcptflg.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
find_exidx.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fix-fp-int-convert-overflow.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fpu_control.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
fraiseexcpt.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
framestate.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
fsetexcptflg.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
ftestexcept.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
gcc-compat.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
gccframe.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
get-rounding-mode.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
Implies Remove sysdeps/arm/soft-fp directory. 2014-10-16 09:54:45 -07:00
jmpbuf-unwind.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
ldbl-classify-compat.h Move LDBL_CLASSIFY_COMPAT to its own header. 2018-02-01 21:01:00 +00:00
ldsodefs.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
libc-aeabi_read_tp.S ARM: Move more aeabi routine magic out of Linux-specific directories 2014-06-26 15:08:29 -07:00
libc-tls.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
libm-test-ulps arm: update libm test ulps 2021-04-08 09:55:33 +01:00
libm-test-ulps-name Do not hardcode platform names in manual/libm-err-tab.pl (bug 14139). 2016-11-04 16:49:06 +00:00
linkmap.h Rename bits/linkmap.h to linkmap.h (bug 14912). 2015-09-04 19:44:27 +00:00
machine-gmon.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
Makefile arm: Use have-mtls-dialect-gnu2 to check for ARM TLS descriptors support 2021-11-01 16:23:15 -03:00
math-tests-trap.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
math-use-builtins-sqrt.h arm: Use sqrt{f} builtin 2020-06-22 11:09:50 -03:00
memcpy.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
memmove.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
memset.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
memusage.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
preconfigure arm: Split BE/LE abilist 2019-08-29 09:58:21 -03:00
preconfigure.ac arm: Split BE/LE abilist 2019-08-29 09:58:21 -03:00
rt-aeabi_unwind_cpp_pr1.c ARM: Move more aeabi routine magic out of Linux-specific directories 2014-06-26 15:08:29 -07:00
rt-arm-unwind-resume.S ARM: Consolidate with generic unwinder wrapper code 2015-01-05 15:42:16 -08:00
rtld-global-offsets.sym Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
setfpucw.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
setjmp.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
sfp-machine.h Remove sysdeps/arm/soft-fp directory. 2014-10-16 09:54:45 -07:00
sotruss-lib.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
stackinfo.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
stap-probe-machine.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
start.S Reduce the statically linked startup code [BZ #23323] 2021-02-25 12:13:02 +01:00
static-stubs.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
strlen.S Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
sub_n.S Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
submul_1.S Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
sysdep.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
test-fpucw.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
tlsdesc.c elf: Remove lazy tlsdesc relocation related code 2021-04-21 14:35:53 +01:00
tlsdesc.sym Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
tst-armtlsdescextlazy.c [BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC 2014-06-20 20:22:42 +01:00
tst-armtlsdescextlazymod.c [BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC 2014-06-20 20:22:42 +01:00
tst-armtlsdescextnow.c [BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC 2014-06-20 20:22:42 +01:00
tst-armtlsdescextnowmod.c [BZ #17075] ARM: Fix immediate calculation of R_ARM_TLS_DESC 2014-06-20 20:22:42 +01:00
tst-armtlsdescloc.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-armtlsdesclocmod.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-audit.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
unwind-arch.h Implement _Unwind_Resume in libc on top of <unwind-link.h> 2021-03-01 16:00:03 +01:00
unwind-dw2-fde-glibc.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
unwind-pe.c Move arm from ports to libc. 2014-02-08 01:49:39 +00:00
unwind-resume.c Implement _Unwind_Resume in libc on top of <unwind-link.h> 2021-03-01 16:00:03 +01:00
unwind-resume.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
unwind.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
Versions Use -Werror=undef for assembly code. 2015-02-12 13:57:32 -08:00