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 dynamic-link/21609] Incomplete workaround for GCC __tls_get_addr ABI issue on x86-64


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

--- Comment #4 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, hjl/pr21609/master has been created
        at  cea65553a8fd2251acaafc33706407d9cdace5da (commit)

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

commit cea65553a8fd2251acaafc33706407d9cdace5da
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 4 09:24:09 2017 -0700

    x86-64: Export ___tls_get_addr

    On x86-64, __tls_get_addr is changed to realign stack to support GCC
    older than GCC 4.9.4:

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066

    This patch exports ___tls_get_addr as the alternative x86-64 runtime
    interface to TLS with aligned stack.

    This requires linker support for TLS optimization with ___tls_get_addr.
    GCC 4.9.4 and newer can generate call to ___tls_get_addr, instead of
    __tls_get_addr.  We can use the weakref assembly directive to redirect
    __tls_get_addr to ___tls_get_addr if linker supports ___tls_get_addr and
    GCC doesn't.

        * sysdeps/unix/sysv/linux/x86_64/64/ld.abilist: Add GLIBC_2.26
        and ___tls_get_addr.
        * sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist: Likewise.
        * sysdeps/x86_64/Versions: Export ___tls_get_addr in GLIBC_2.26.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4198d7a3ac434a80d27ca3303f56fbf0f4403b3a

commit 4198d7a3ac434a80d27ca3303f56fbf0f4403b3a
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Jul 3 13:16:57 2017 -0700

    x86-64: Align the stack in __tls_get_addr [BZ #21609]

    This change forces realignment of the stack pointer in __tls_get_addr, so
    that binaries compiled by GCCs older than GCC 4.9:

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066

    continue to work even if vector instructions are used in glibc which
    require the ABI stack realignment.

    __tls_get_addr_slow is added to handle the slow paths in the default
    implementation of__tls_get_addr in elf/dl-tls.c.  The new __tls_get_addr
    calls __tls_get_addr_slow after realigning the stack.  Internal calls
    within ld.so go directly to the default implementation of __tls_get_addr
    because they do not need stack realignment.

    2017-07-04  Florian Weimer  <fweimer@redhat.com>
            H.J. Lu  <hongjiu.lu@intel.com>

        [BZ #21609]
        * sysdeps/x86_64/Makefile (sysdep-dl-routines): Add tls_get_addr.
        (gen-as-const-headers): Add rtld-offsets.sym.
        * sysdeps/x86_64/dl-tls.c: New file.
        * sysdeps/x86_64/rtld-offsets.sym: Likwise.
        * sysdeps/x86_64/tls_get_addr.S: Likewise.
        * sysdeps/x86_64/dl-tls.h: Add multiple inclusion guards.
        * sysdeps/x86_64/tlsdesc.sym (TI_MODULE_OFFSET): New.
        (TI_OFFSET_OFFSET): Likwise.

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

-- 
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]