glibc/sysdeps/i386/nptl
H.J. Lu 0221ce2a90 i386: Change offset of __private_ss to 0x30 [BZ #23250]
sysdeps/i386/nptl/tls.h has

typedef struct
{
  void *tcb;            /* Pointer to the TCB.  Not necessarily the
                           thread descriptor used by libpthread.  */
  dtv_t *dtv;
  void *self;           /* Pointer to the thread descriptor.  */
  int multiple_threads;
  uintptr_t sysinfo;
  uintptr_t stack_guard;
  uintptr_t pointer_guard;
  int gscope_flag;
  int __glibc_reserved1;
  /* Reservation of some values for the TM ABI.  */
  void *__private_tm[4];
  /* GCC split stack support.  */
  void *__private_ss;
} tcbhead_t;

The offset of __private_ss is 0x34.  But GCC defines

/* We steal the last transactional memory word.  */
 #define TARGET_THREAD_SPLIT_STACK_OFFSET 0x30

and libgcc/config/i386/morestack.S has

	cmpl	%gs:0x30,%eax		# See if we have enough space.
	movl	%eax,%gs:0x30		# Save the new stack boundary.
	movl	%eax,%gs:0x30		# Save the new stack boundary.
	movl	%ecx,%gs:0x30		# Save new stack boundary.
	movl	%eax,%gs:0x30
	movl	%gs:0x30,%eax
	movl	%eax,%gs:0x30

Since update TARGET_THREAD_SPLIT_STACK_OFFSET changes split stack ABI,
this patch updates tcbhead_t to match GCC.

	[BZ #23250]
	[BZ #10686]
	* sysdeps/i386/nptl/tls.h (tcbhead_t): Change __private_tm[4]
	to _private_tm[3] and add __glibc_reserved2.
	Add _Static_assert of offset of __private_ss == 0x30.
	* sysdeps/x86_64/nptl/tls.h: Add _Static_assert of offset of
	__private_ss == 0x40 for ILP32 and == 0x70 for LP64.
2018-06-12 06:34:48 -07:00
..
Makefile i386: Drop -mpreferred-stack-boundary=4 2018-05-22 14:44:14 +02:00
pthread_spin_init.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
pthread_spin_lock.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
pthread_spin_unlock.S Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
pthread-offsets.h nptl: Add tests for internal pthread_mutex_t offsets 2017-11-07 09:48:28 -02:00
pthreaddef.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
tcb-offsets.sym nptl: Remove __ASSUME_PRIVATE_FUTEX 2018-05-17 04:25:10 -07:00
tls.h i386: Change offset of __private_ss to 0x30 [BZ #23250] 2018-06-12 06:34:48 -07:00