This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nptl/10686] Request for new TLS field for x86 and x86_64


https://sourceware.org/bugzilla/show_bug.cgi?id=10686

--- Comment #8 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  0221ce2a90be2d40fc90f0b5dcec77a1ec013f53 (commit)
      from  e826574c985a15a500262f2fbd21c7e9259d3d11 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0221ce2a90be2d40fc90f0b5dcec77a1ec013f53

commit 0221ce2a90be2d40fc90f0b5dcec77a1ec013f53
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jun 12 06:23:28 2018 -0700

    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.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                 |   10 ++++++++++
 sysdeps/i386/nptl/tls.h   |    7 ++++++-
 sysdeps/x86_64/nptl/tls.h |   10 ++++++++++
 3 files changed, 26 insertions(+), 1 deletions(-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]