public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug dynamic-link/18134] New: x86-64 ld.so doesn't preserve bound registers
@ 2015-03-16 18:16 hjl.tools at gmail dot com
  2015-03-16 19:56 ` [Bug dynamic-link/18134] " hjl.tools at gmail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2015-03-16 18:16 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 18134
           Summary: x86-64 ld.so doesn't preserve bound registers
           Product: glibc
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: dynamic-link
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com

X86-64 _dl_runtime_resolve has

(gdb) disass _dl_runtime_resolve
Dump of assembler code for function _dl_runtime_resolve:
   0x00000036004150f0 <+0>:    sub    $0x78,%rsp
   0x00000036004150f4 <+4>:    mov    %rax,0x40(%rsp)
   0x00000036004150f9 <+9>:    mov    %rcx,0x48(%rsp)
   0x00000036004150fe <+14>:    mov    %rdx,0x50(%rsp)
   0x0000003600415103 <+19>:    mov    %rsi,0x58(%rsp)
   0x0000003600415108 <+24>:    mov    %rdi,0x60(%rsp)
   0x000000360041510d <+29>:    mov    %r8,0x68(%rsp)
   0x0000003600415112 <+34>:    mov    %r9,0x70(%rsp)
   0x0000003600415117 <+39>:    bndmov %bnd0,(%rsp)
   0x000000360041511c <+44>:    bndmov %bnd1,0x10(%rsp)
   0x0000003600415122 <+50>:    bndmov %bnd2,0x20(%rsp)
   0x0000003600415128 <+56>:    bndmov %bnd3,0x30(%rsp)
   0x000000360041512e <+62>:    mov    0x80(%rsp),%rsi
   0x0000003600415136 <+70>:    mov    0x78(%rsp),%rdi
   0x000000360041513b <+75>:    callq  0x360040e620 <_dl_fixup>
   0x0000003600415140 <+80>:    mov    %rax,%r11
   0x0000003600415143 <+83>:    bndmov 0x30(%rsp),%bnd3
   0x0000003600415149 <+89>:    bndmov 0x20(%rsp),%bnd2
   0x000000360041514f <+95>:    bndmov 0x10(%rsp),%bnd1
   0x0000003600415155 <+101>:    bndmov (%rsp),%bnd0
   0x000000360041515a <+106>:    mov    0x70(%rsp),%r9
   0x000000360041515f <+111>:    mov    0x68(%rsp),%r8
   0x0000003600415164 <+116>:    mov    0x60(%rsp),%rdi
   0x0000003600415169 <+121>:    mov    0x58(%rsp),%rsi
   0x000000360041516e <+126>:    mov    0x50(%rsp),%rdx
   0x0000003600415173 <+131>:    mov    0x48(%rsp),%rcx
   0x0000003600415178 <+136>:    mov    0x40(%rsp),%rax
   0x000000360041517d <+141>:    add    $0x88,%rsp
   0x0000003600415184 <+148>:    jmpq   *%r11
                                ^^^^^^^^^^^^^^^^^  This clears bound registers.
End of assembler dump.
(gdb)

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dynamic-link/18134] x86-64 ld.so doesn't preserve bound registers
  2015-03-16 18:16 [Bug dynamic-link/18134] New: x86-64 ld.so doesn't preserve bound registers hjl.tools at gmail dot com
@ 2015-03-16 19:56 ` hjl.tools at gmail dot com
  2015-03-16 22:00 ` cvs-commit at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2015-03-16 19:56 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
_dl_runtime_profile has many normal branches after

#ifndef __ILP32__
# ifdef HAVE_MPX_SUPPORT
        bndmov              (LR_BND_OFFSET)(%rsp), %bnd0  # Restore bound
        bndmov (LR_BND_OFFSET +   BND_SIZE)(%rsp), %bnd1  # registers.
        bndmov (LR_BND_OFFSET + BND_SIZE*2)(%rsp), %bnd2
        bndmov (LR_BND_OFFSET + BND_SIZE*3)(%rsp), %bnd3
# else
        .byte 0x66,0x0f,0x1a,0x84,0x24;.long (LR_BND_OFFSET)
        .byte 0x66,0x0f,0x1a,0x8c,0x24;.long (LR_BND_OFFSET + BND_SIZE)
        .byte 0x66,0x0f,0x1a,0x94,0x24;.long (LR_BND_OFFSET + BND_SIZE*2)
        .byte 0x66,0x0f,0x1a,0x9c,0x24;.long (LR_BND_OFFSET + BND_SIZE*3)
# endif
#endif

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dynamic-link/18134] x86-64 ld.so doesn't preserve bound registers
  2015-03-16 18:16 [Bug dynamic-link/18134] New: x86-64 ld.so doesn't preserve bound registers hjl.tools at gmail dot com
  2015-03-16 19:56 ` [Bug dynamic-link/18134] " hjl.tools at gmail dot com
@ 2015-03-16 22:00 ` cvs-commit at gcc dot gnu.org
  2015-03-18 14:28 ` hjl.tools at gmail dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-03-16 22:00 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #2 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  b97eb2bdb1ed72982a7821c3078be591051cef59 (commit)
      from  cb219290492995bb52fba8c21f9f20afe5604721 (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=b97eb2bdb1ed72982a7821c3078be591051cef59

commit b97eb2bdb1ed72982a7821c3078be591051cef59
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Mar 16 14:58:43 2015 -0700

    Preserve bound registers in _dl_runtime_resolve

    We need to add a BND prefix before indirect branch at the end of
    _dl_runtime_resolve to preserve bound registers.

        [BZ #18134]
        * sysdeps/x86_64/dl-trampoline.S (PRESERVE_BND_REGS_PREFIX): New.
        (_dl_runtime_resolve): Add a BND prefix before indirect branch.

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

Summary of changes:
 ChangeLog                      |    5 +++++
 sysdeps/x86_64/dl-trampoline.S |    8 ++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dynamic-link/18134] x86-64 ld.so doesn't preserve bound registers
  2015-03-16 18:16 [Bug dynamic-link/18134] New: x86-64 ld.so doesn't preserve bound registers hjl.tools at gmail dot com
  2015-03-16 19:56 ` [Bug dynamic-link/18134] " hjl.tools at gmail dot com
  2015-03-16 22:00 ` cvs-commit at gcc dot gnu.org
@ 2015-03-18 14:28 ` hjl.tools at gmail dot com
  2015-03-18 14:29 ` [Bug dynamic-link/18134] x86 " hjl.tools at gmail dot com
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2015-03-18 14:28 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
For i386, we also need to preserve the return bound register in
_dl_runtime_profile.

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dynamic-link/18134] x86 ld.so doesn't preserve bound registers
  2015-03-16 18:16 [Bug dynamic-link/18134] New: x86-64 ld.so doesn't preserve bound registers hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2015-03-18 14:28 ` hjl.tools at gmail dot com
@ 2015-03-18 14:29 ` hjl.tools at gmail dot com
  2015-07-09 14:08 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2015-03-18 14:29 UTC (permalink / raw)
  To: glibc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|x86-64 ld.so doesn't        |x86 ld.so doesn't preserve
                   |preserve bound registers    |bound registers

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dynamic-link/18134] x86 ld.so doesn't preserve bound registers
  2015-03-16 18:16 [Bug dynamic-link/18134] New: x86-64 ld.so doesn't preserve bound registers hjl.tools at gmail dot com
                   ` (3 preceding siblings ...)
  2015-03-18 14:29 ` [Bug dynamic-link/18134] x86 " hjl.tools at gmail dot com
@ 2015-07-09 14:08 ` cvs-commit at gcc dot gnu.org
  2015-07-09 14:11 ` hjl.tools at gmail dot com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-07-09 14:08 UTC (permalink / raw)
  To: glibc-bugs

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

--- 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, master has been updated
       via  14c5cbabc2d11004ab223ae5eae761ddf83ef99e (commit)
      from  632b3db8e2ba1f454872f7ebe1335966f8161c43 (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=14c5cbabc2d11004ab223ae5eae761ddf83ef99e

commit 14c5cbabc2d11004ab223ae5eae761ddf83ef99e
Author: Igor Zamyatin <igor.zamyatin@intel.com>
Date:   Thu Jul 9 06:50:12 2015 -0700

    Preserve bound registers for pointer pass/return

    We need to save/restore bound registers and add a BND prefix before
    branches in _dl_runtime_profile so that bound registers for pointer
    pass and return are preserved when LD_AUDIT is used.

        [BZ #18134]
        * sysdeps/i386/configure.ac: Set HAVE_MPX_SUPPORT.
        * sysdeps/i386/configure: Regenerated.
        * sysdeps/i386/dl-trampoline.S (PRESERVE_BND_REGS_PREFIX): New.
        (_dl_runtime_profile): Save and restore Intel MPX return bound
        registers when calling _dl_call_pltexit.  Add
        PRESERVE_BND_REGS_PREFIX before return.
        * sysdeps/i386/link-defines.sym (LRV_BND0_OFFSET): New.
        (LRV_BND1_OFFSET): Likewise.
        * sysdeps/x86/bits/link.h (La_i86_retval): Add lrv_bnd0 and
        lrv_bnd1.
        * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Fix
        typo in bndmov encoding.
        * sysdeps/x86_64/dl-trampoline.h: Properly save and restore
        Intel MPX bound registers.  Add PRESERVE_BND_REGS_PREFIX before
        branch instructions to preserve bounds.

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

Summary of changes:
 ChangeLog                      |   20 +++++++++++++++++++
 NEWS                           |   14 ++++++------
 sysdeps/i386/configure         |   27 ++++++++++++++++++++++++++
 sysdeps/i386/configure.ac      |   15 ++++++++++++++
 sysdeps/i386/dl-trampoline.S   |   21 ++++++++++++++++++++
 sysdeps/i386/link-defines.sym  |    2 +
 sysdeps/x86/bits/link.h        |    2 +
 sysdeps/x86_64/dl-trampoline.S |    4 +-
 sysdeps/x86_64/dl-trampoline.h |   41 ++++++++++++++++++++++-----------------
 9 files changed, 119 insertions(+), 27 deletions(-)

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dynamic-link/18134] x86 ld.so doesn't preserve bound registers
  2015-03-16 18:16 [Bug dynamic-link/18134] New: x86-64 ld.so doesn't preserve bound registers hjl.tools at gmail dot com
                   ` (4 preceding siblings ...)
  2015-07-09 14:08 ` cvs-commit at gcc dot gnu.org
@ 2015-07-09 14:11 ` hjl.tools at gmail dot com
  2015-08-02 13:57 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2015-07-09 14:11 UTC (permalink / raw)
  To: glibc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |2.22

--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed for 2.22.

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dynamic-link/18134] x86 ld.so doesn't preserve bound registers
  2015-03-16 18:16 [Bug dynamic-link/18134] New: x86-64 ld.so doesn't preserve bound registers hjl.tools at gmail dot com
                   ` (5 preceding siblings ...)
  2015-07-09 14:11 ` hjl.tools at gmail dot com
@ 2015-08-02 13:57 ` cvs-commit at gcc dot gnu.org
  2015-08-02 17:43 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-08-02 13:57 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #6 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/plt/2.21 has been created
        at  27d21878e6c6c3517f14f758598295161461af2c (commit)

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

commit 27d21878e6c6c3517f14f758598295161461af2c
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 04:49:38 2015 -0700

    Use SSE optimized strcmp in x86-64 ld.so

    Since ld.so preserves vector registers now, we can SSE optimized strcmp
    in x86-64 ld.so.

        * sysdeps/x86_64/strcmp.S: Remove "#if !IS_IN (libc)".

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

commit b3139c9c42f6edde9ff40a40d810f7e6312a4a23
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:56:14 2015 -0700

    Remove x86-64 rtld-xxx.c and rtld-xxx.S

    Since ld.so preserves vector registers now, we can use the regular,
    non-ifunc string and memory functions in ld.so.

        * sysdeps/x86_64/rtld-memcmp.c: Removed.
        * sysdeps/x86_64/rtld-memset.S: Likewise.
        * sysdeps/x86_64/rtld-strchr.S: Likewise.
        * sysdeps/x86_64/rtld-strlen.S: Likewise.
        * sysdeps/x86_64/multiarch/rtld-memcmp.c: Likewise.
        * sysdeps/x86_64/multiarch/rtld-memset.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=42772c4e1a7d51ff3b61fcedb5e3fb3351c9f8b4

commit 42772c4e1a7d51ff3b61fcedb5e3fb3351c9f8b4
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:47:54 2015 -0700

    Replace %xmm8 with %xmm0

    Since ld.so preserves vector registers now, we can use %xmm0 to avoid
    the REX prefix.

        * sysdeps/x86_64/memset.S: Replace %xmm8 with %xmm0.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2c35e86459f434d4e8251962ba3ff9d341428ba0

commit 2c35e86459f434d4e8251962ba3ff9d341428ba0
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:44:39 2015 -0700

    Replace %xmm[8-12] with %xmm[0-4]

    Since ld.so preserves vector registers now, we can use %xmm[0-4] to
    avoid the REX prefix.

        * sysdeps/x86_64/strlen.S: Replace %xmm[8-12] with %xmm[0-4].

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1b98679a9065e1b21a0fed3dde8a1503b16a89fa

commit 1b98679a9065e1b21a0fed3dde8a1503b16a89fa
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 28 18:56:18 2015 -0700

    Don't disable SSE in x86-64 ld.so

    Since ld.so preserves vector registers now, we can use SSE in ld.so.

        * sysdeps/i386/Makefile [$(subdir) == elf] (CFLAGS-.os): Add
        -mno-sse -mno-mmx for $(all-rtld-routines).
        [$(subdir) == elf] (tests-special): Add
        $(objpfx)tst-ld-sse-use.out.
        [$(subdir) == elf] ($(objpfx)tst-ld-sse-use.out): New rule.
        * sysdeps/x86/Makefile [$(subdir) == elf] (CFLAGS-.os): Removed.
        [$(subdir) == elf] (tests-special): Likewise.
        [$(subdir) == elf] ($(objpfx)tst-ld-sse-use.out): Likewise.
        * sysdeps/x86_64/Makefile [$(subdir) == elf] (CFLAGS-.os): Add
        -mno-mmx for $(all-rtld-routines).

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

commit a061cf95b023449f79bcd497890a7f6ef95f4a3b
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Jul 11 13:25:25 2015 -0700

    Save and restore vector registers in x86-64 ld.so

    This patch initiaizes GLRO(dl_x86_xstate) in dl_platform_init to
    indicate if the processor supports SSE, AVX or AVX512.  It uses
    this information to properly save and restore vector registers in
    ld.so.  Now we can use SSE in ld.so and delete FOREIGN_CALL macros.
    We can also retire the rtld_must_xmm_save field and remove the
    rtld_savespace_sse field in tcbhead_t.  It is safe since they are
    internal to glibc.

        [BZ #15128]
        * sysdeps/x86_64/Makefile [$(subdir) == elf] (tests): Add
        ifuncmain8.
        (modules-names): Add ifuncmod8.
        ($(objpfx)ifuncmain8): New rule.
        * sysdeps/x86_64/dl-machine.h: Include <dl-procinfo.h> and
        <cpuid.h>.
        (elf_machine_runtime_setup): Use _dl_runtime_resolve_sse,
        _dl_runtime_resolve_avx, or _dl_runtime_resolve_avx512,
        _dl_runtime_profile_sse, _dl_runtime_profile_avx, or
        _dl_runtime_profile_avx512, based on HAS_ARCH_FEATURE.
        * sysdeps/x86_64/dl-trampoline.S: Rewrite.
        * sysdeps/x86_64/dl-trampoline.h: Likewise.
        * sysdeps/x86_64/ifuncmain8.c: New file.
        * sysdeps/x86_64/ifuncmod8.c: Likewise.
        * sysdeps/x86_64/nptl/tcb-offsets.sym (RTLD_SAVESPACE_SSE):
        Removed.
        * sysdeps/x86_64/nptl/tls.h (__128bits): Removed.
        (tcbhead_t): CHange rtld_must_xmm_save to __glibc_unused1.
        Remove rtld_savespace_sse and __padding.
        (RTLD_CHECK_FOREIGN_CALL): Removed.
        (RTLD_ENABLE_FOREIGN_CALL): Likewise.
        (RTLD_PREPARE_FOREIGN_CALL): Likewise.
        (RTLD_FINALIZE_FOREIGN_CALL): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2fede219d1005f41a04aab125ec49b7c1456236f

commit 2fede219d1005f41a04aab125ec49b7c1456236f
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 12 14:41:20 2015 -0700

    Align stack when calling __errno_location

    We should align stack to 16 bytes when calling __errno_location.

        [BZ #18661]
        * sysdeps/x86_64/fpu/s_cosf.S (__cosf): Align stack to 16 bytes
        when calling __errno_location.
        * sysdeps/x86_64/fpu/s_sincosf.S (__sincosf): Likewise.
        * sysdeps/x86_64/fpu/s_sinf.S (__sinf): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3a538a8e9905c07a3a60b998e31b8c5ac73a4a58

commit 3a538a8e9905c07a3a60b998e31b8c5ac73a4a58
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 12 14:40:25 2015 -0700

    Align stack to 16 bytes when calling __gettimeofday

    Subtract stack by 24 bytes instead of 16 bytes so that stack is aligned
    to 16 bytes when calling __gettimeofday.

        [BZ #18661]
        * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
        (__lll_timedwait_tid): Align stack to 16 bytes when calling
        __gettimeofday.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=69acbbd5ca5a54520cfc107bacc3b71e69ec0d2d

commit 69acbbd5ca5a54520cfc107bacc3b71e69ec0d2d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 12 14:38:58 2015 -0700

    Align stack to 16 bytes when calling __setcontext

    Don't use pop to restore %rdi so that stack is aligned to 16 bytes
    when calling __setcontext.

        [BZ #18661]
        * sysdeps/unix/sysv/linux/x86_64/__start_context.S
        (__start_context): Don't use pop to restore %rdi so that stack
        is aligned to 16 bytes when calling __setcontext.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2b58e5d85955174dde6a9304002adb79d2681ca3

commit 2b58e5d85955174dde6a9304002adb79d2681ca3
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:41:58 2015 -0700

    Compile {memcpy,strcmp}-sse2-unaligned.S only for libc

    {memcpy,strcmp}-sse2-unaligned.S aren't needed in ld.so.

        * sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: Compile
        only for libc.
        * sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5d7a32c16a65d27b73d01556a30fb138338639f1

commit 5d7a32c16a65d27b73d01556a30fb138338639f1
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Aug 1 07:47:16 2015 -0700

    Update x86 elision-conf.c for <cpu-features.h>

    This patch updates x86 elision-conf.c to use the newly defined
    HAS_CPU_FEATURE from <cpu-features.h>.

        * sysdeps/unix/sysv/linux/x86/elision-conf.c (elision_init):
        Replace HAS_RTM with HAS_CPU_FEATURE (RTM).

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

commit da0e27c6c7266df2107c7a4825cf2eb2d6360d28
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 31 16:52:19 2015 -0700

    Update i686 multiarch functions for <cpu-features.h>

    This patch updates i686 multiarch functions to use the newly defined
    HAS_CPU_FEATURE, HAS_ARCH_FEATURE, LOAD_GOT_AND_RTLD_GLOBAL_RO and
    LOAD_FUNC_GOT_EAX from <cpu-features.h>.

        * sysdeps/i386/i686/fpu/multiarch/e_expf.c: Replace HAS_XXX
        with HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/i386/i686/fpu/multiarch/s_cosf.c: Likewise.
        * sysdeps/i386/i686/fpu/multiarch/s_cosf.c: Likewise.
        * sysdeps/i386/i686/fpu/multiarch/s_sincosf.c: Likewise.
        * sysdeps/i386/i686/fpu/multiarch/s_sinf.c: Likewise.
        * sysdeps/i386/i686/multiarch/ifunc-impl-list.c: Likewise.
        * sysdeps/i386/i686/multiarch/s_fma.c: Likewise.
        * sysdeps/i386/i686/multiarch/s_fmaf.c: Likewise.
        * sysdeps/i386/i686/multiarch/bcopy.S: Remove __init_cpu_features
        call.  Merge SHARED and !SHARED.  Add LOAD_GOT_AND_RTLD_GLOBAL_RO.
        Use LOAD_FUNC_GOT_EAX to load function address.  Replace HAS_XXX
        with HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/i386/i686/multiarch/bzero.S: Likewise.
        * sysdeps/i386/i686/multiarch/memchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/memcmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/memcpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/memcpy_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/memmove.S: Likewise.
        * sysdeps/i386/i686/multiarch/memmove_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/mempcpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/mempcpy_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/memrchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/memset.S: Likewise.
        * sysdeps/i386/i686/multiarch/memset_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/rawmemchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcasecmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcat.S: Likewise.
        * sysdeps/i386/i686/multiarch/strchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcspn.S: Likewise.
        * sysdeps/i386/i686/multiarch/strlen.S: Likewise.
        * sysdeps/i386/i686/multiarch/strncase.S: Likewise.
        * sysdeps/i386/i686/multiarch/strnlen.S: Likewise.
        * sysdeps/i386/i686/multiarch/strrchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/strspn.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcschr.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcscmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcscpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcslen.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcsrchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/wmemcmp.S: Likewise.

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

commit a7be9410184a405f4f1347302afe0b625146cdab
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 31 13:41:04 2015 -0700

    Update x86_64 multiarch functions for <cpu-features.h>

    This patch updates x86_64 multiarch functions to use the newly defined
    HAS_CPU_FEATURE, HAS_ARCH_FEATURE and LOAD_RTLD_GLOBAL_RO_RDX from
    <cpu-features.h>.

        * sysdeps/x86_64/fpu/multiarch/e_asin.c: Replace HAS_XXX with
        HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/x86_64/fpu/multiarch/e_atan2.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/e_exp.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/e_log.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/e_pow.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_atan.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_fma.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_fmaf.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_sin.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_tan.c: Likewise.
        * sysdeps/x86_64/multiarch/ifunc-impl-list.c: Likewise.
        * sysdeps/x86_64/multiarch/sched_cpucount.c: Likewise.
        * sysdeps/x86_64/multiarch/strstr.c: Likewise.
        * sysdeps/x86_64/multiarch/memmove.c: Likewise.
        * sysdeps/x86_64/multiarch/memmove_chk.c: Likewise.
        * sysdeps/x86_64/multiarch/test-multiarch.c: Likewise.
        * sysdeps/x86_64/multiarch/memcmp.S: Remove __init_cpu_features
        call.  Add LOAD_RTLD_GLOBAL_RO_RDX.  Replace HAS_XXX with
        HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/x86_64/multiarch/memcpy.S: Likewise.
        * sysdeps/x86_64/multiarch/memcpy_chk.S: Likewise.
        * sysdeps/x86_64/multiarch/mempcpy.S: Likewise.
        * sysdeps/x86_64/multiarch/mempcpy_chk.S: Likewise.
        * sysdeps/x86_64/multiarch/memset.S: Likewise.
        * sysdeps/x86_64/multiarch/memset_chk.S: Likewise.
        * sysdeps/x86_64/multiarch/strcat.S: Likewise.
        * sysdeps/x86_64/multiarch/strchr.S: Likewise.
        * sysdeps/x86_64/multiarch/strcmp.S: Likewise.
        * sysdeps/x86_64/multiarch/strcpy.S: Likewise.
        * sysdeps/x86_64/multiarch/strcspn.S: Likewise.
        * sysdeps/x86_64/multiarch/strspn.S: Likewise.
        * sysdeps/x86_64/multiarch/wcscpy.S: Likewise.
        * sysdeps/x86_64/multiarch/wmemcmp.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2f99aa146788d958bf202ce51e070c31af84a570

commit 2f99aa146788d958bf202ce51e070c31af84a570
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 31 07:30:04 2015 -0700

    Add _dl_x86_cpu_features to rtld_global in ld.so

    This patch adds _dl_x86_cpu_features to rtld_global in x86 ld.so
    and initializes it early before __libc_start_main is called so that
    cpu_features is always available when it is used and we can avoid
    calling __init_cpu_features in IFUNC selectors.

        * sysdeps/i386/dl-machine.h: Include <cpu-features.c>.
        (dl_platform_init): Call init_cpu_features.
        * sysdeps/i386/dl-procinfo.c (_dl_x86_cpu_features): New.
        * sysdeps/i386/i686/cacheinfo.c
        (DISABLE_PREFERRED_MEMORY_INSTRUCTION): Removed.
        * sysdeps/i386/i686/multiarch/ifunc-defines.sym (KIND_OFFSET):
        Removed.
        * sysdeps/i386/ldsodefs.h: Include <cpu-features.h>.
        * sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c: Include
        <sysdeps/x86_64/dl-procinfo.c> instead of
        sysdeps/generic/dl-procinfo.c>.
        * sysdeps/x86/Makefile [$(subdir) == csu] (gen-as-const-headers):
        Add cpu-features-offsets.sym and rtld-global-offsets.sym.
        * sysdeps/x86/cpu-features-offsets.sym: New file.
        * sysdeps/x86/cpu-features.c: Likewise.
        * sysdeps/x86/cpu-features.h: Likewise.
        * sysdeps/x86/libc-start.c: Likewise.
        * sysdeps/x86/rtld-global-offsets.sym: Likewise.
        * sysdeps/x86_64/dl-procinfo.c: Likewise.
        * sysdeps/x86_64/cacheinfo.c (__cpuid_count): Removed.
        Assume USE_MULTIARCH is defined and don't check it.
        (is_intel): Replace __cpu_features with GLRO(dl_x86_cpu_features).
        (is_amd): Likewise.
        (max_cpuid): Likewise.
        (intel_check_word): Likewise.
        (__cache_sysconf): Don't call __init_cpu_features.
        (__x86_preferred_memory_instruction): Removed.
        (init_cacheinfo): Don't call __init_cpu_features. Replace
        __cpu_features with GLRO(dl_x86_cpu_features).
        * sysdeps/x86_64/dl-machine.h: <cpu-features.c>.
        (dl_platform_init): Call init_cpu_features.
        * sysdeps/x86_64/ldsodefs.h: Include <cpu-features.h>.
        * sysdeps/x86_64/multiarch/cacheinfo.c: Removed.
        * sysdeps/x86_64/multiarch/ifunc-defines.sym (KIND_OFFSET):
        Removed.
        * sysdeps/x86_64/multiarch/init-arch.c: Rewrite.
        * sysdeps/x86_64/multiarch/init-arch.h: Likewise.

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

commit fdd3aa0b19700ab564da895a2a85bf3fdb0bedf0
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Jul 9 09:30:09 2015 -0700

    Improve bndmov encoding with zero displacement

    If x86-64 assembler doesn't support MPX, we encode bndmov instruction by
    hand.  When displacement is zero, assembler generates shorter encoding.
    This patch improves bndmov encoding with zero displacement so that ld.so
    is identical when using assemblers with and without MPX support.

        * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_resolve): Improve
        bndmov encoding with zero displacement.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9e4fc7f67f6695f294ae759a6b540f5d08a56f0c

commit 9e4fc7f67f6695f294ae759a6b540f5d08a56f0c
Author: Igor Zamyatin <igor.zamyatin@intel.com>
Date:   Thu Jul 9 06:50:12 2015 -0700

    Preserve bound registers for pointer pass/return

    We need to save/restore bound registers and add a BND prefix before
    branches in _dl_runtime_profile so that bound registers for pointer
    pass and return are preserved when LD_AUDIT is used.

        [BZ #18134]
        * sysdeps/i386/configure.ac: Set HAVE_MPX_SUPPORT.
        * sysdeps/i386/configure: Regenerated.
        * sysdeps/i386/dl-trampoline.S (PRESERVE_BND_REGS_PREFIX): New.
        (_dl_runtime_profile): Save and restore Intel MPX return bound
        registers when calling _dl_call_pltexit.  Add
        PRESERVE_BND_REGS_PREFIX before return.
        * sysdeps/i386/link-defines.sym (LRV_BND0_OFFSET): New.
        (LRV_BND1_OFFSET): Likewise.
        * sysdeps/x86/bits/link.h (La_i86_retval): Add lrv_bnd0 and
        lrv_bnd1.
        * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Fix
        typo in bndmov encoding.
        * sysdeps/x86_64/dl-trampoline.h: Properly save and restore
        Intel MPX bound registers.  Add PRESERVE_BND_REGS_PREFIX before
        branch instructions to preserve bounds.

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

commit b15f277bac14482c8b2dda4931ebf919644932fa
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Mar 16 14:58:43 2015 -0700

    Preserve bound registers in _dl_runtime_resolve

    We need to add a BND prefix before indirect branch at the end of
    _dl_runtime_resolve to preserve bound registers.

        [BZ #18134]
        * sysdeps/x86_64/dl-trampoline.S (PRESERVE_BND_REGS_PREFIX): New.
        (_dl_runtime_resolve): Add a BND prefix before indirect branch.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=20f87a053b1e6a9106851f764c205d59fd4b6879

commit 20f87a053b1e6a9106851f764c205d59fd4b6879
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 7 05:23:24 2015 -0700

    Add and use sysdeps/i386/link-defines.sym

    Define macros for fields in La_i86_regs and La_i86_retval and use them
    in dl-trampoline.S, instead of hardcoded values.

        * sysdeps/i386/Makefile (gen-as-const-headers)[elf]: Add
        link-defines.sym.
        * sysdeps/i386/dl-trampoline.S: Include <link-defines.h>.
        (_dl_runtime_profile): Use LONG_DOUBLE_SIZE, LRV_SIZE,
        LRV_EAX_OFFSET, LRV_EDX_OFFSET, LRV_ST0_OFFSET, LRV_ST1_OFFSET
        and LR_SIZE.
        * sysdeps/i386/link-defines.sym: New file.

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

commit d6fd297566e2389ab855325754bcb25f604c6b7d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 7 05:09:16 2015 -0700

    Add a testcase for i386 LD_AUDIT

    This patch adds a testcase for i386 LD_AUDIT to check function return
    and parameters passed in registers.

        * sysdeps/i386/Makefile (tests)[elf]: Add tst-audit3.
        (modules-names): Add tst-auditmod3a tst-auditmod3b.
        ($(objpfx)tst-audit3): New rule.
        ($(objpfx)tst-audit3.out): Likewise.
        * sysdeps/i386/tst-audit3.c: New file.
        * sysdeps/i386/tst-audit3.h: Likewise.
        * sysdeps/i386/tst-auditmod3a.c: Likewise.
        * sysdeps/i386/tst-auditmod3b.c: Likewise.

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

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dynamic-link/18134] x86 ld.so doesn't preserve bound registers
  2015-03-16 18:16 [Bug dynamic-link/18134] New: x86-64 ld.so doesn't preserve bound registers hjl.tools at gmail dot com
                   ` (6 preceding siblings ...)
  2015-08-02 13:57 ` cvs-commit at gcc dot gnu.org
@ 2015-08-02 17:43 ` cvs-commit at gcc dot gnu.org
  2015-08-03  4:47 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-08-02 17:43 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #7 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/plt/2.21 has been created
        at  adf2bca6cef858265c67d36fb762ad8d094cf8e6 (commit)

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

commit adf2bca6cef858265c67d36fb762ad8d094cf8e6
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 04:49:38 2015 -0700

    Use SSE optimized strcmp in x86-64 ld.so

    Since ld.so preserves vector registers now, we can SSE optimized strcmp
    in x86-64 ld.so.

        * sysdeps/x86_64/strcmp.S: Remove "#if !IS_IN (libc)".

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

commit ea6b54e9214abaf37faf988eda0b55adf734d7ba
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:56:14 2015 -0700

    Remove x86-64 rtld-xxx.c and rtld-xxx.S

    Since ld.so preserves vector registers now, we can use the regular,
    non-ifunc string and memory functions in ld.so.

        * sysdeps/x86_64/rtld-memcmp.c: Removed.
        * sysdeps/x86_64/rtld-memset.S: Likewise.
        * sysdeps/x86_64/rtld-strchr.S: Likewise.
        * sysdeps/x86_64/rtld-strlen.S: Likewise.
        * sysdeps/x86_64/multiarch/rtld-memcmp.c: Likewise.
        * sysdeps/x86_64/multiarch/rtld-memset.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=684b6047c2f84671dac9fa790f4cdc1416325e0b

commit 684b6047c2f84671dac9fa790f4cdc1416325e0b
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:47:54 2015 -0700

    Replace %xmm8 with %xmm0

    Since ld.so preserves vector registers now, we can use %xmm0 to avoid
    the REX prefix.

        * sysdeps/x86_64/memset.S: Replace %xmm8 with %xmm0.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9f41fc798f5c830cd909e6a849c676223240efc9

commit 9f41fc798f5c830cd909e6a849c676223240efc9
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:44:39 2015 -0700

    Replace %xmm[8-12] with %xmm[0-4]

    Since ld.so preserves vector registers now, we can use %xmm[0-4] to
    avoid the REX prefix.

        * sysdeps/x86_64/strlen.S: Replace %xmm[8-12] with %xmm[0-4].

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7d973940b6e8b281cdf53d6f66ac5305a478ebf9

commit 7d973940b6e8b281cdf53d6f66ac5305a478ebf9
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 28 18:56:18 2015 -0700

    Don't disable SSE in x86-64 ld.so

    Since ld.so preserves vector registers now, we can use SSE in ld.so.

        * sysdeps/i386/Makefile [$(subdir) == elf] (CFLAGS-.os): Add
        -mno-sse -mno-mmx for $(all-rtld-routines).
        [$(subdir) == elf] (tests-special): Add
        $(objpfx)tst-ld-sse-use.out.
        [$(subdir) == elf] ($(objpfx)tst-ld-sse-use.out): New rule.
        * sysdeps/x86/Makefile [$(subdir) == elf] (CFLAGS-.os): Removed.
        [$(subdir) == elf] (tests-special): Likewise.
        [$(subdir) == elf] ($(objpfx)tst-ld-sse-use.out): Likewise.
        * sysdeps/x86_64/Makefile [$(subdir) == elf] (CFLAGS-.os): Add
        -mno-mmx for $(all-rtld-routines).

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=07ce37a6da7d00fb331736331031e371cbe753a8

commit 07ce37a6da7d00fb331736331031e371cbe753a8
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Jul 11 13:25:25 2015 -0700

    Save and restore vector registers in x86-64 ld.so

    This patch initiaizes GLRO(dl_x86_xstate) in dl_platform_init to
    indicate if the processor supports SSE, AVX or AVX512.  It uses
    this information to properly save and restore vector registers in
    ld.so.  Now we can use SSE in ld.so and delete FOREIGN_CALL macros.

        [BZ #15128]
        * sysdeps/x86_64/Makefile [$(subdir) == elf] (tests): Add
        ifuncmain8.
        (modules-names): Add ifuncmod8.
        ($(objpfx)ifuncmain8): New rule.
        * sysdeps/x86_64/dl-machine.h: Include <dl-procinfo.h> and
        <cpuid.h>.
        (elf_machine_runtime_setup): Use _dl_runtime_resolve_sse,
        _dl_runtime_resolve_avx, or _dl_runtime_resolve_avx512,
        _dl_runtime_profile_sse, _dl_runtime_profile_avx, or
        _dl_runtime_profile_avx512, based on HAS_ARCH_FEATURE.
        * sysdeps/x86_64/dl-trampoline.S: Rewrite.
        * sysdeps/x86_64/dl-trampoline.h: Likewise.
        * sysdeps/x86_64/ifuncmain8.c: New file.
        * sysdeps/x86_64/ifuncmod8.c: Likewise.
        * sysdeps/x86_64/nptl/tcb-offsets.sym (RTLD_SAVESPACE_SSE):
        Removed.
        * sysdeps/x86_64/nptl/tls.h (__128bits): Removed.
        (tcbhead_t): Change rtld_must_xmm_save to __glibc_unused1.
        Change rtld_savespace_sse to __glibc_unused2.
        (RTLD_CHECK_FOREIGN_CALL): Removed.
        (RTLD_ENABLE_FOREIGN_CALL): Likewise.
        (RTLD_PREPARE_FOREIGN_CALL): Likewise.
        (RTLD_FINALIZE_FOREIGN_CALL): Likewise.

    Fix tcbhead_t

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2fede219d1005f41a04aab125ec49b7c1456236f

commit 2fede219d1005f41a04aab125ec49b7c1456236f
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 12 14:41:20 2015 -0700

    Align stack when calling __errno_location

    We should align stack to 16 bytes when calling __errno_location.

        [BZ #18661]
        * sysdeps/x86_64/fpu/s_cosf.S (__cosf): Align stack to 16 bytes
        when calling __errno_location.
        * sysdeps/x86_64/fpu/s_sincosf.S (__sincosf): Likewise.
        * sysdeps/x86_64/fpu/s_sinf.S (__sinf): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3a538a8e9905c07a3a60b998e31b8c5ac73a4a58

commit 3a538a8e9905c07a3a60b998e31b8c5ac73a4a58
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 12 14:40:25 2015 -0700

    Align stack to 16 bytes when calling __gettimeofday

    Subtract stack by 24 bytes instead of 16 bytes so that stack is aligned
    to 16 bytes when calling __gettimeofday.

        [BZ #18661]
        * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
        (__lll_timedwait_tid): Align stack to 16 bytes when calling
        __gettimeofday.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=69acbbd5ca5a54520cfc107bacc3b71e69ec0d2d

commit 69acbbd5ca5a54520cfc107bacc3b71e69ec0d2d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 12 14:38:58 2015 -0700

    Align stack to 16 bytes when calling __setcontext

    Don't use pop to restore %rdi so that stack is aligned to 16 bytes
    when calling __setcontext.

        [BZ #18661]
        * sysdeps/unix/sysv/linux/x86_64/__start_context.S
        (__start_context): Don't use pop to restore %rdi so that stack
        is aligned to 16 bytes when calling __setcontext.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2b58e5d85955174dde6a9304002adb79d2681ca3

commit 2b58e5d85955174dde6a9304002adb79d2681ca3
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:41:58 2015 -0700

    Compile {memcpy,strcmp}-sse2-unaligned.S only for libc

    {memcpy,strcmp}-sse2-unaligned.S aren't needed in ld.so.

        * sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: Compile
        only for libc.
        * sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5d7a32c16a65d27b73d01556a30fb138338639f1

commit 5d7a32c16a65d27b73d01556a30fb138338639f1
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Aug 1 07:47:16 2015 -0700

    Update x86 elision-conf.c for <cpu-features.h>

    This patch updates x86 elision-conf.c to use the newly defined
    HAS_CPU_FEATURE from <cpu-features.h>.

        * sysdeps/unix/sysv/linux/x86/elision-conf.c (elision_init):
        Replace HAS_RTM with HAS_CPU_FEATURE (RTM).

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

commit da0e27c6c7266df2107c7a4825cf2eb2d6360d28
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 31 16:52:19 2015 -0700

    Update i686 multiarch functions for <cpu-features.h>

    This patch updates i686 multiarch functions to use the newly defined
    HAS_CPU_FEATURE, HAS_ARCH_FEATURE, LOAD_GOT_AND_RTLD_GLOBAL_RO and
    LOAD_FUNC_GOT_EAX from <cpu-features.h>.

        * sysdeps/i386/i686/fpu/multiarch/e_expf.c: Replace HAS_XXX
        with HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/i386/i686/fpu/multiarch/s_cosf.c: Likewise.
        * sysdeps/i386/i686/fpu/multiarch/s_cosf.c: Likewise.
        * sysdeps/i386/i686/fpu/multiarch/s_sincosf.c: Likewise.
        * sysdeps/i386/i686/fpu/multiarch/s_sinf.c: Likewise.
        * sysdeps/i386/i686/multiarch/ifunc-impl-list.c: Likewise.
        * sysdeps/i386/i686/multiarch/s_fma.c: Likewise.
        * sysdeps/i386/i686/multiarch/s_fmaf.c: Likewise.
        * sysdeps/i386/i686/multiarch/bcopy.S: Remove __init_cpu_features
        call.  Merge SHARED and !SHARED.  Add LOAD_GOT_AND_RTLD_GLOBAL_RO.
        Use LOAD_FUNC_GOT_EAX to load function address.  Replace HAS_XXX
        with HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/i386/i686/multiarch/bzero.S: Likewise.
        * sysdeps/i386/i686/multiarch/memchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/memcmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/memcpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/memcpy_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/memmove.S: Likewise.
        * sysdeps/i386/i686/multiarch/memmove_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/mempcpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/mempcpy_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/memrchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/memset.S: Likewise.
        * sysdeps/i386/i686/multiarch/memset_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/rawmemchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcasecmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcat.S: Likewise.
        * sysdeps/i386/i686/multiarch/strchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcspn.S: Likewise.
        * sysdeps/i386/i686/multiarch/strlen.S: Likewise.
        * sysdeps/i386/i686/multiarch/strncase.S: Likewise.
        * sysdeps/i386/i686/multiarch/strnlen.S: Likewise.
        * sysdeps/i386/i686/multiarch/strrchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/strspn.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcschr.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcscmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcscpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcslen.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcsrchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/wmemcmp.S: Likewise.

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

commit a7be9410184a405f4f1347302afe0b625146cdab
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 31 13:41:04 2015 -0700

    Update x86_64 multiarch functions for <cpu-features.h>

    This patch updates x86_64 multiarch functions to use the newly defined
    HAS_CPU_FEATURE, HAS_ARCH_FEATURE and LOAD_RTLD_GLOBAL_RO_RDX from
    <cpu-features.h>.

        * sysdeps/x86_64/fpu/multiarch/e_asin.c: Replace HAS_XXX with
        HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/x86_64/fpu/multiarch/e_atan2.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/e_exp.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/e_log.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/e_pow.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_atan.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_fma.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_fmaf.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_sin.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_tan.c: Likewise.
        * sysdeps/x86_64/multiarch/ifunc-impl-list.c: Likewise.
        * sysdeps/x86_64/multiarch/sched_cpucount.c: Likewise.
        * sysdeps/x86_64/multiarch/strstr.c: Likewise.
        * sysdeps/x86_64/multiarch/memmove.c: Likewise.
        * sysdeps/x86_64/multiarch/memmove_chk.c: Likewise.
        * sysdeps/x86_64/multiarch/test-multiarch.c: Likewise.
        * sysdeps/x86_64/multiarch/memcmp.S: Remove __init_cpu_features
        call.  Add LOAD_RTLD_GLOBAL_RO_RDX.  Replace HAS_XXX with
        HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/x86_64/multiarch/memcpy.S: Likewise.
        * sysdeps/x86_64/multiarch/memcpy_chk.S: Likewise.
        * sysdeps/x86_64/multiarch/mempcpy.S: Likewise.
        * sysdeps/x86_64/multiarch/mempcpy_chk.S: Likewise.
        * sysdeps/x86_64/multiarch/memset.S: Likewise.
        * sysdeps/x86_64/multiarch/memset_chk.S: Likewise.
        * sysdeps/x86_64/multiarch/strcat.S: Likewise.
        * sysdeps/x86_64/multiarch/strchr.S: Likewise.
        * sysdeps/x86_64/multiarch/strcmp.S: Likewise.
        * sysdeps/x86_64/multiarch/strcpy.S: Likewise.
        * sysdeps/x86_64/multiarch/strcspn.S: Likewise.
        * sysdeps/x86_64/multiarch/strspn.S: Likewise.
        * sysdeps/x86_64/multiarch/wcscpy.S: Likewise.
        * sysdeps/x86_64/multiarch/wmemcmp.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2f99aa146788d958bf202ce51e070c31af84a570

commit 2f99aa146788d958bf202ce51e070c31af84a570
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 31 07:30:04 2015 -0700

    Add _dl_x86_cpu_features to rtld_global in ld.so

    This patch adds _dl_x86_cpu_features to rtld_global in x86 ld.so
    and initializes it early before __libc_start_main is called so that
    cpu_features is always available when it is used and we can avoid
    calling __init_cpu_features in IFUNC selectors.

        * sysdeps/i386/dl-machine.h: Include <cpu-features.c>.
        (dl_platform_init): Call init_cpu_features.
        * sysdeps/i386/dl-procinfo.c (_dl_x86_cpu_features): New.
        * sysdeps/i386/i686/cacheinfo.c
        (DISABLE_PREFERRED_MEMORY_INSTRUCTION): Removed.
        * sysdeps/i386/i686/multiarch/ifunc-defines.sym (KIND_OFFSET):
        Removed.
        * sysdeps/i386/ldsodefs.h: Include <cpu-features.h>.
        * sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c: Include
        <sysdeps/x86_64/dl-procinfo.c> instead of
        sysdeps/generic/dl-procinfo.c>.
        * sysdeps/x86/Makefile [$(subdir) == csu] (gen-as-const-headers):
        Add cpu-features-offsets.sym and rtld-global-offsets.sym.
        * sysdeps/x86/cpu-features-offsets.sym: New file.
        * sysdeps/x86/cpu-features.c: Likewise.
        * sysdeps/x86/cpu-features.h: Likewise.
        * sysdeps/x86/libc-start.c: Likewise.
        * sysdeps/x86/rtld-global-offsets.sym: Likewise.
        * sysdeps/x86_64/dl-procinfo.c: Likewise.
        * sysdeps/x86_64/cacheinfo.c (__cpuid_count): Removed.
        Assume USE_MULTIARCH is defined and don't check it.
        (is_intel): Replace __cpu_features with GLRO(dl_x86_cpu_features).
        (is_amd): Likewise.
        (max_cpuid): Likewise.
        (intel_check_word): Likewise.
        (__cache_sysconf): Don't call __init_cpu_features.
        (__x86_preferred_memory_instruction): Removed.
        (init_cacheinfo): Don't call __init_cpu_features. Replace
        __cpu_features with GLRO(dl_x86_cpu_features).
        * sysdeps/x86_64/dl-machine.h: <cpu-features.c>.
        (dl_platform_init): Call init_cpu_features.
        * sysdeps/x86_64/ldsodefs.h: Include <cpu-features.h>.
        * sysdeps/x86_64/multiarch/cacheinfo.c: Removed.
        * sysdeps/x86_64/multiarch/ifunc-defines.sym (KIND_OFFSET):
        Removed.
        * sysdeps/x86_64/multiarch/init-arch.c: Rewrite.
        * sysdeps/x86_64/multiarch/init-arch.h: Likewise.

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

commit fdd3aa0b19700ab564da895a2a85bf3fdb0bedf0
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Jul 9 09:30:09 2015 -0700

    Improve bndmov encoding with zero displacement

    If x86-64 assembler doesn't support MPX, we encode bndmov instruction by
    hand.  When displacement is zero, assembler generates shorter encoding.
    This patch improves bndmov encoding with zero displacement so that ld.so
    is identical when using assemblers with and without MPX support.

        * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_resolve): Improve
        bndmov encoding with zero displacement.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9e4fc7f67f6695f294ae759a6b540f5d08a56f0c

commit 9e4fc7f67f6695f294ae759a6b540f5d08a56f0c
Author: Igor Zamyatin <igor.zamyatin@intel.com>
Date:   Thu Jul 9 06:50:12 2015 -0700

    Preserve bound registers for pointer pass/return

    We need to save/restore bound registers and add a BND prefix before
    branches in _dl_runtime_profile so that bound registers for pointer
    pass and return are preserved when LD_AUDIT is used.

        [BZ #18134]
        * sysdeps/i386/configure.ac: Set HAVE_MPX_SUPPORT.
        * sysdeps/i386/configure: Regenerated.
        * sysdeps/i386/dl-trampoline.S (PRESERVE_BND_REGS_PREFIX): New.
        (_dl_runtime_profile): Save and restore Intel MPX return bound
        registers when calling _dl_call_pltexit.  Add
        PRESERVE_BND_REGS_PREFIX before return.
        * sysdeps/i386/link-defines.sym (LRV_BND0_OFFSET): New.
        (LRV_BND1_OFFSET): Likewise.
        * sysdeps/x86/bits/link.h (La_i86_retval): Add lrv_bnd0 and
        lrv_bnd1.
        * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Fix
        typo in bndmov encoding.
        * sysdeps/x86_64/dl-trampoline.h: Properly save and restore
        Intel MPX bound registers.  Add PRESERVE_BND_REGS_PREFIX before
        branch instructions to preserve bounds.

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

commit b15f277bac14482c8b2dda4931ebf919644932fa
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Mar 16 14:58:43 2015 -0700

    Preserve bound registers in _dl_runtime_resolve

    We need to add a BND prefix before indirect branch at the end of
    _dl_runtime_resolve to preserve bound registers.

        [BZ #18134]
        * sysdeps/x86_64/dl-trampoline.S (PRESERVE_BND_REGS_PREFIX): New.
        (_dl_runtime_resolve): Add a BND prefix before indirect branch.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=20f87a053b1e6a9106851f764c205d59fd4b6879

commit 20f87a053b1e6a9106851f764c205d59fd4b6879
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 7 05:23:24 2015 -0700

    Add and use sysdeps/i386/link-defines.sym

    Define macros for fields in La_i86_regs and La_i86_retval and use them
    in dl-trampoline.S, instead of hardcoded values.

        * sysdeps/i386/Makefile (gen-as-const-headers)[elf]: Add
        link-defines.sym.
        * sysdeps/i386/dl-trampoline.S: Include <link-defines.h>.
        (_dl_runtime_profile): Use LONG_DOUBLE_SIZE, LRV_SIZE,
        LRV_EAX_OFFSET, LRV_EDX_OFFSET, LRV_ST0_OFFSET, LRV_ST1_OFFSET
        and LR_SIZE.
        * sysdeps/i386/link-defines.sym: New file.

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

commit d6fd297566e2389ab855325754bcb25f604c6b7d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 7 05:09:16 2015 -0700

    Add a testcase for i386 LD_AUDIT

    This patch adds a testcase for i386 LD_AUDIT to check function return
    and parameters passed in registers.

        * sysdeps/i386/Makefile (tests)[elf]: Add tst-audit3.
        (modules-names): Add tst-auditmod3a tst-auditmod3b.
        ($(objpfx)tst-audit3): New rule.
        ($(objpfx)tst-audit3.out): Likewise.
        * sysdeps/i386/tst-audit3.c: New file.
        * sysdeps/i386/tst-audit3.h: Likewise.
        * sysdeps/i386/tst-auditmod3a.c: Likewise.
        * sysdeps/i386/tst-auditmod3b.c: Likewise.

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

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dynamic-link/18134] x86 ld.so doesn't preserve bound registers
  2015-03-16 18:16 [Bug dynamic-link/18134] New: x86-64 ld.so doesn't preserve bound registers hjl.tools at gmail dot com
                   ` (7 preceding siblings ...)
  2015-08-02 17:43 ` cvs-commit at gcc dot gnu.org
@ 2015-08-03  4:47 ` cvs-commit at gcc dot gnu.org
  2015-08-03 21:25 ` cvs-commit at gcc dot gnu.org
  2015-08-03 21:36 ` cvs-commit at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-08-03  4:47 UTC (permalink / raw)
  To: glibc-bugs

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

--- 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, hjl/plt/2.21 has been created
        at  ee31b78f6a17c08ff274f045b5c694175d0604fe (commit)

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

commit ee31b78f6a17c08ff274f045b5c694175d0604fe
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 04:49:38 2015 -0700

    Use SSE optimized strcmp in x86-64 ld.so

    Since ld.so preserves vector registers now, we can SSE optimized strcmp
    in x86-64 ld.so.

        * sysdeps/x86_64/strcmp.S: Remove "#if !IS_IN (libc)".

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0b130c6106f777b4706985c1b21259cb0b9444de

commit 0b130c6106f777b4706985c1b21259cb0b9444de
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:56:14 2015 -0700

    Remove x86-64 rtld-xxx.c and rtld-xxx.S

    Since ld.so preserves vector registers now, we can use the regular,
    non-ifunc string and memory functions in ld.so.

        * sysdeps/x86_64/rtld-memcmp.c: Removed.
        * sysdeps/x86_64/rtld-memset.S: Likewise.
        * sysdeps/x86_64/rtld-strchr.S: Likewise.
        * sysdeps/x86_64/rtld-strlen.S: Likewise.
        * sysdeps/x86_64/multiarch/rtld-memcmp.c: Likewise.
        * sysdeps/x86_64/multiarch/rtld-memset.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=208f29ab4507c0fbd05ae7b355b935df28d13bd5

commit 208f29ab4507c0fbd05ae7b355b935df28d13bd5
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:47:54 2015 -0700

    Replace %xmm8 with %xmm0

    Since ld.so preserves vector registers now, we can use %xmm0 to avoid
    the REX prefix.

        * sysdeps/x86_64/memset.S: Replace %xmm8 with %xmm0.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4edcc46a4abeb18a2bce77c822a0bbbb591cadb1

commit 4edcc46a4abeb18a2bce77c822a0bbbb591cadb1
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:44:39 2015 -0700

    Replace %xmm[8-12] with %xmm[0-4]

    Since ld.so preserves vector registers now, we can use %xmm[0-4] to
    avoid the REX prefix.

        * sysdeps/x86_64/strlen.S: Replace %xmm[8-12] with %xmm[0-4].

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=110b786b20852ed67e51fc2e17142f2ec7637438

commit 110b786b20852ed67e51fc2e17142f2ec7637438
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 28 18:56:18 2015 -0700

    Don't disable SSE in x86-64 ld.so

    Since ld.so preserves vector registers now, we can use SSE in ld.so.

        * sysdeps/i386/Makefile [$(subdir) == elf] (CFLAGS-.os): Add
        -mno-sse -mno-mmx for $(all-rtld-routines).
        [$(subdir) == elf] (tests-special): Add
        $(objpfx)tst-ld-sse-use.out.
        [$(subdir) == elf] ($(objpfx)tst-ld-sse-use.out): New rule.
        * sysdeps/x86/Makefile [$(subdir) == elf] (CFLAGS-.os): Removed.
        [$(subdir) == elf] (tests-special): Likewise.
        [$(subdir) == elf] ($(objpfx)tst-ld-sse-use.out): Likewise.
        * sysdeps/x86_64/Makefile [$(subdir) == elf] (CFLAGS-.os): Add
        -mno-mmx for $(all-rtld-routines).

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

commit d90c533eb936ec65456c7a07ed921b5c04c00d2b
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Jul 11 13:25:25 2015 -0700

    Save and restore vector registers in x86-64 ld.so

    This patch initiaizes GLRO(dl_x86_xstate) in dl_platform_init to
    indicate if the processor supports SSE, AVX or AVX512.  It uses
    this information to properly save and restore vector registers in
    ld.so.  Now we can use SSE in ld.so and delete FOREIGN_CALL macros.

        [BZ #15128]
        * sysdeps/x86_64/Makefile [$(subdir) == elf] (tests): Add
        ifuncmain8.
        (modules-names): Add ifuncmod8.
        ($(objpfx)ifuncmain8): New rule.
        * sysdeps/x86_64/dl-machine.h: Include <dl-procinfo.h> and
        <cpuid.h>.
        (elf_machine_runtime_setup): Use _dl_runtime_resolve_sse,
        _dl_runtime_resolve_avx, or _dl_runtime_resolve_avx512,
        _dl_runtime_profile_sse, _dl_runtime_profile_avx, or
        _dl_runtime_profile_avx512, based on HAS_ARCH_FEATURE.
        * sysdeps/x86_64/dl-trampoline.S: Rewrite.
        * sysdeps/x86_64/dl-trampoline.h: Likewise.
        * sysdeps/x86_64/ifuncmain8.c: New file.
        * sysdeps/x86_64/ifuncmod8.c: Likewise.
        * sysdeps/x86_64/nptl/tcb-offsets.sym (RTLD_SAVESPACE_SSE):
        Removed.
        * sysdeps/x86_64/nptl/tls.h (__128bits): Removed.
        (tcbhead_t): Change rtld_must_xmm_save to __glibc_unused1.
        Change rtld_savespace_sse to __glibc_unused2.
        (RTLD_CHECK_FOREIGN_CALL): Removed.
        (RTLD_ENABLE_FOREIGN_CALL): Likewise.
        (RTLD_PREPARE_FOREIGN_CALL): Likewise.
        (RTLD_FINALIZE_FOREIGN_CALL): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2fede219d1005f41a04aab125ec49b7c1456236f

commit 2fede219d1005f41a04aab125ec49b7c1456236f
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 12 14:41:20 2015 -0700

    Align stack when calling __errno_location

    We should align stack to 16 bytes when calling __errno_location.

        [BZ #18661]
        * sysdeps/x86_64/fpu/s_cosf.S (__cosf): Align stack to 16 bytes
        when calling __errno_location.
        * sysdeps/x86_64/fpu/s_sincosf.S (__sincosf): Likewise.
        * sysdeps/x86_64/fpu/s_sinf.S (__sinf): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3a538a8e9905c07a3a60b998e31b8c5ac73a4a58

commit 3a538a8e9905c07a3a60b998e31b8c5ac73a4a58
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 12 14:40:25 2015 -0700

    Align stack to 16 bytes when calling __gettimeofday

    Subtract stack by 24 bytes instead of 16 bytes so that stack is aligned
    to 16 bytes when calling __gettimeofday.

        [BZ #18661]
        * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
        (__lll_timedwait_tid): Align stack to 16 bytes when calling
        __gettimeofday.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=69acbbd5ca5a54520cfc107bacc3b71e69ec0d2d

commit 69acbbd5ca5a54520cfc107bacc3b71e69ec0d2d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 12 14:38:58 2015 -0700

    Align stack to 16 bytes when calling __setcontext

    Don't use pop to restore %rdi so that stack is aligned to 16 bytes
    when calling __setcontext.

        [BZ #18661]
        * sysdeps/unix/sysv/linux/x86_64/__start_context.S
        (__start_context): Don't use pop to restore %rdi so that stack
        is aligned to 16 bytes when calling __setcontext.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2b58e5d85955174dde6a9304002adb79d2681ca3

commit 2b58e5d85955174dde6a9304002adb79d2681ca3
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:41:58 2015 -0700

    Compile {memcpy,strcmp}-sse2-unaligned.S only for libc

    {memcpy,strcmp}-sse2-unaligned.S aren't needed in ld.so.

        * sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: Compile
        only for libc.
        * sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5d7a32c16a65d27b73d01556a30fb138338639f1

commit 5d7a32c16a65d27b73d01556a30fb138338639f1
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Aug 1 07:47:16 2015 -0700

    Update x86 elision-conf.c for <cpu-features.h>

    This patch updates x86 elision-conf.c to use the newly defined
    HAS_CPU_FEATURE from <cpu-features.h>.

        * sysdeps/unix/sysv/linux/x86/elision-conf.c (elision_init):
        Replace HAS_RTM with HAS_CPU_FEATURE (RTM).

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

commit da0e27c6c7266df2107c7a4825cf2eb2d6360d28
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 31 16:52:19 2015 -0700

    Update i686 multiarch functions for <cpu-features.h>

    This patch updates i686 multiarch functions to use the newly defined
    HAS_CPU_FEATURE, HAS_ARCH_FEATURE, LOAD_GOT_AND_RTLD_GLOBAL_RO and
    LOAD_FUNC_GOT_EAX from <cpu-features.h>.

        * sysdeps/i386/i686/fpu/multiarch/e_expf.c: Replace HAS_XXX
        with HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/i386/i686/fpu/multiarch/s_cosf.c: Likewise.
        * sysdeps/i386/i686/fpu/multiarch/s_cosf.c: Likewise.
        * sysdeps/i386/i686/fpu/multiarch/s_sincosf.c: Likewise.
        * sysdeps/i386/i686/fpu/multiarch/s_sinf.c: Likewise.
        * sysdeps/i386/i686/multiarch/ifunc-impl-list.c: Likewise.
        * sysdeps/i386/i686/multiarch/s_fma.c: Likewise.
        * sysdeps/i386/i686/multiarch/s_fmaf.c: Likewise.
        * sysdeps/i386/i686/multiarch/bcopy.S: Remove __init_cpu_features
        call.  Merge SHARED and !SHARED.  Add LOAD_GOT_AND_RTLD_GLOBAL_RO.
        Use LOAD_FUNC_GOT_EAX to load function address.  Replace HAS_XXX
        with HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/i386/i686/multiarch/bzero.S: Likewise.
        * sysdeps/i386/i686/multiarch/memchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/memcmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/memcpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/memcpy_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/memmove.S: Likewise.
        * sysdeps/i386/i686/multiarch/memmove_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/mempcpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/mempcpy_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/memrchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/memset.S: Likewise.
        * sysdeps/i386/i686/multiarch/memset_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/rawmemchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcasecmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcat.S: Likewise.
        * sysdeps/i386/i686/multiarch/strchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcspn.S: Likewise.
        * sysdeps/i386/i686/multiarch/strlen.S: Likewise.
        * sysdeps/i386/i686/multiarch/strncase.S: Likewise.
        * sysdeps/i386/i686/multiarch/strnlen.S: Likewise.
        * sysdeps/i386/i686/multiarch/strrchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/strspn.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcschr.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcscmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcscpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcslen.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcsrchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/wmemcmp.S: Likewise.

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

commit a7be9410184a405f4f1347302afe0b625146cdab
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 31 13:41:04 2015 -0700

    Update x86_64 multiarch functions for <cpu-features.h>

    This patch updates x86_64 multiarch functions to use the newly defined
    HAS_CPU_FEATURE, HAS_ARCH_FEATURE and LOAD_RTLD_GLOBAL_RO_RDX from
    <cpu-features.h>.

        * sysdeps/x86_64/fpu/multiarch/e_asin.c: Replace HAS_XXX with
        HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/x86_64/fpu/multiarch/e_atan2.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/e_exp.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/e_log.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/e_pow.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_atan.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_fma.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_fmaf.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_sin.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_tan.c: Likewise.
        * sysdeps/x86_64/multiarch/ifunc-impl-list.c: Likewise.
        * sysdeps/x86_64/multiarch/sched_cpucount.c: Likewise.
        * sysdeps/x86_64/multiarch/strstr.c: Likewise.
        * sysdeps/x86_64/multiarch/memmove.c: Likewise.
        * sysdeps/x86_64/multiarch/memmove_chk.c: Likewise.
        * sysdeps/x86_64/multiarch/test-multiarch.c: Likewise.
        * sysdeps/x86_64/multiarch/memcmp.S: Remove __init_cpu_features
        call.  Add LOAD_RTLD_GLOBAL_RO_RDX.  Replace HAS_XXX with
        HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/x86_64/multiarch/memcpy.S: Likewise.
        * sysdeps/x86_64/multiarch/memcpy_chk.S: Likewise.
        * sysdeps/x86_64/multiarch/mempcpy.S: Likewise.
        * sysdeps/x86_64/multiarch/mempcpy_chk.S: Likewise.
        * sysdeps/x86_64/multiarch/memset.S: Likewise.
        * sysdeps/x86_64/multiarch/memset_chk.S: Likewise.
        * sysdeps/x86_64/multiarch/strcat.S: Likewise.
        * sysdeps/x86_64/multiarch/strchr.S: Likewise.
        * sysdeps/x86_64/multiarch/strcmp.S: Likewise.
        * sysdeps/x86_64/multiarch/strcpy.S: Likewise.
        * sysdeps/x86_64/multiarch/strcspn.S: Likewise.
        * sysdeps/x86_64/multiarch/strspn.S: Likewise.
        * sysdeps/x86_64/multiarch/wcscpy.S: Likewise.
        * sysdeps/x86_64/multiarch/wmemcmp.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2f99aa146788d958bf202ce51e070c31af84a570

commit 2f99aa146788d958bf202ce51e070c31af84a570
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 31 07:30:04 2015 -0700

    Add _dl_x86_cpu_features to rtld_global in ld.so

    This patch adds _dl_x86_cpu_features to rtld_global in x86 ld.so
    and initializes it early before __libc_start_main is called so that
    cpu_features is always available when it is used and we can avoid
    calling __init_cpu_features in IFUNC selectors.

        * sysdeps/i386/dl-machine.h: Include <cpu-features.c>.
        (dl_platform_init): Call init_cpu_features.
        * sysdeps/i386/dl-procinfo.c (_dl_x86_cpu_features): New.
        * sysdeps/i386/i686/cacheinfo.c
        (DISABLE_PREFERRED_MEMORY_INSTRUCTION): Removed.
        * sysdeps/i386/i686/multiarch/ifunc-defines.sym (KIND_OFFSET):
        Removed.
        * sysdeps/i386/ldsodefs.h: Include <cpu-features.h>.
        * sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c: Include
        <sysdeps/x86_64/dl-procinfo.c> instead of
        sysdeps/generic/dl-procinfo.c>.
        * sysdeps/x86/Makefile [$(subdir) == csu] (gen-as-const-headers):
        Add cpu-features-offsets.sym and rtld-global-offsets.sym.
        * sysdeps/x86/cpu-features-offsets.sym: New file.
        * sysdeps/x86/cpu-features.c: Likewise.
        * sysdeps/x86/cpu-features.h: Likewise.
        * sysdeps/x86/libc-start.c: Likewise.
        * sysdeps/x86/rtld-global-offsets.sym: Likewise.
        * sysdeps/x86_64/dl-procinfo.c: Likewise.
        * sysdeps/x86_64/cacheinfo.c (__cpuid_count): Removed.
        Assume USE_MULTIARCH is defined and don't check it.
        (is_intel): Replace __cpu_features with GLRO(dl_x86_cpu_features).
        (is_amd): Likewise.
        (max_cpuid): Likewise.
        (intel_check_word): Likewise.
        (__cache_sysconf): Don't call __init_cpu_features.
        (__x86_preferred_memory_instruction): Removed.
        (init_cacheinfo): Don't call __init_cpu_features. Replace
        __cpu_features with GLRO(dl_x86_cpu_features).
        * sysdeps/x86_64/dl-machine.h: <cpu-features.c>.
        (dl_platform_init): Call init_cpu_features.
        * sysdeps/x86_64/ldsodefs.h: Include <cpu-features.h>.
        * sysdeps/x86_64/multiarch/cacheinfo.c: Removed.
        * sysdeps/x86_64/multiarch/ifunc-defines.sym (KIND_OFFSET):
        Removed.
        * sysdeps/x86_64/multiarch/init-arch.c: Rewrite.
        * sysdeps/x86_64/multiarch/init-arch.h: Likewise.

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

commit fdd3aa0b19700ab564da895a2a85bf3fdb0bedf0
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Jul 9 09:30:09 2015 -0700

    Improve bndmov encoding with zero displacement

    If x86-64 assembler doesn't support MPX, we encode bndmov instruction by
    hand.  When displacement is zero, assembler generates shorter encoding.
    This patch improves bndmov encoding with zero displacement so that ld.so
    is identical when using assemblers with and without MPX support.

        * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_resolve): Improve
        bndmov encoding with zero displacement.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9e4fc7f67f6695f294ae759a6b540f5d08a56f0c

commit 9e4fc7f67f6695f294ae759a6b540f5d08a56f0c
Author: Igor Zamyatin <igor.zamyatin@intel.com>
Date:   Thu Jul 9 06:50:12 2015 -0700

    Preserve bound registers for pointer pass/return

    We need to save/restore bound registers and add a BND prefix before
    branches in _dl_runtime_profile so that bound registers for pointer
    pass and return are preserved when LD_AUDIT is used.

        [BZ #18134]
        * sysdeps/i386/configure.ac: Set HAVE_MPX_SUPPORT.
        * sysdeps/i386/configure: Regenerated.
        * sysdeps/i386/dl-trampoline.S (PRESERVE_BND_REGS_PREFIX): New.
        (_dl_runtime_profile): Save and restore Intel MPX return bound
        registers when calling _dl_call_pltexit.  Add
        PRESERVE_BND_REGS_PREFIX before return.
        * sysdeps/i386/link-defines.sym (LRV_BND0_OFFSET): New.
        (LRV_BND1_OFFSET): Likewise.
        * sysdeps/x86/bits/link.h (La_i86_retval): Add lrv_bnd0 and
        lrv_bnd1.
        * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Fix
        typo in bndmov encoding.
        * sysdeps/x86_64/dl-trampoline.h: Properly save and restore
        Intel MPX bound registers.  Add PRESERVE_BND_REGS_PREFIX before
        branch instructions to preserve bounds.

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

commit b15f277bac14482c8b2dda4931ebf919644932fa
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Mar 16 14:58:43 2015 -0700

    Preserve bound registers in _dl_runtime_resolve

    We need to add a BND prefix before indirect branch at the end of
    _dl_runtime_resolve to preserve bound registers.

        [BZ #18134]
        * sysdeps/x86_64/dl-trampoline.S (PRESERVE_BND_REGS_PREFIX): New.
        (_dl_runtime_resolve): Add a BND prefix before indirect branch.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=20f87a053b1e6a9106851f764c205d59fd4b6879

commit 20f87a053b1e6a9106851f764c205d59fd4b6879
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 7 05:23:24 2015 -0700

    Add and use sysdeps/i386/link-defines.sym

    Define macros for fields in La_i86_regs and La_i86_retval and use them
    in dl-trampoline.S, instead of hardcoded values.

        * sysdeps/i386/Makefile (gen-as-const-headers)[elf]: Add
        link-defines.sym.
        * sysdeps/i386/dl-trampoline.S: Include <link-defines.h>.
        (_dl_runtime_profile): Use LONG_DOUBLE_SIZE, LRV_SIZE,
        LRV_EAX_OFFSET, LRV_EDX_OFFSET, LRV_ST0_OFFSET, LRV_ST1_OFFSET
        and LR_SIZE.
        * sysdeps/i386/link-defines.sym: New file.

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

commit d6fd297566e2389ab855325754bcb25f604c6b7d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 7 05:09:16 2015 -0700

    Add a testcase for i386 LD_AUDIT

    This patch adds a testcase for i386 LD_AUDIT to check function return
    and parameters passed in registers.

        * sysdeps/i386/Makefile (tests)[elf]: Add tst-audit3.
        (modules-names): Add tst-auditmod3a tst-auditmod3b.
        ($(objpfx)tst-audit3): New rule.
        ($(objpfx)tst-audit3.out): Likewise.
        * sysdeps/i386/tst-audit3.c: New file.
        * sysdeps/i386/tst-audit3.h: Likewise.
        * sysdeps/i386/tst-auditmod3a.c: Likewise.
        * sysdeps/i386/tst-auditmod3b.c: Likewise.

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

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dynamic-link/18134] x86 ld.so doesn't preserve bound registers
  2015-03-16 18:16 [Bug dynamic-link/18134] New: x86-64 ld.so doesn't preserve bound registers hjl.tools at gmail dot com
                   ` (8 preceding siblings ...)
  2015-08-03  4:47 ` cvs-commit at gcc dot gnu.org
@ 2015-08-03 21:25 ` cvs-commit at gcc dot gnu.org
  2015-08-03 21:36 ` cvs-commit at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-08-03 21:25 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #9 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/plt/2.21 has been created
        at  759b73bcbdbeb7e0cc8edc13384c0ad31f13497f (commit)

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

commit 759b73bcbdbeb7e0cc8edc13384c0ad31f13497f
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Aug 2 22:27:47 2015 -0700

    Don't run tst-getpid2 with LD_BIND_NOW=1

    Since _dl_x86_64_save_sse and _dl_x86_64_restore_sse are removed now,
    we don't need to run tst-getpid2 with LD_BIND_NOW=1.

        * nptl/Makefile (tst-getpid2-ENV): Removed.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5549394367f8b19fd8aed34cf0db85f0f0753f17

commit 5549394367f8b19fd8aed34cf0db85f0f0753f17
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 04:49:38 2015 -0700

    Use SSE optimized strcmp in x86-64 ld.so

    Since ld.so preserves vector registers now, we can SSE optimized strcmp
    in x86-64 ld.so.

        * sysdeps/x86_64/strcmp.S: Remove "#if !IS_IN (libc)".

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4f45bc0ac553e4ab3a5d449c61e55dacb78bc2f5

commit 4f45bc0ac553e4ab3a5d449c61e55dacb78bc2f5
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:56:14 2015 -0700

    Remove x86-64 rtld-xxx.c and rtld-xxx.S

    Since ld.so preserves vector registers now, we can use the regular,
    non-ifunc string and memory functions in ld.so.

        * sysdeps/x86_64/rtld-memcmp.c: Removed.
        * sysdeps/x86_64/rtld-memset.S: Likewise.
        * sysdeps/x86_64/rtld-strchr.S: Likewise.
        * sysdeps/x86_64/rtld-strlen.S: Likewise.
        * sysdeps/x86_64/multiarch/rtld-memcmp.c: Likewise.
        * sysdeps/x86_64/multiarch/rtld-memset.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3a7ed4680aaf75f2f0c47804542cf084154988a9

commit 3a7ed4680aaf75f2f0c47804542cf084154988a9
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:47:54 2015 -0700

    Replace %xmm8 with %xmm0

    Since ld.so preserves vector registers now, we can use %xmm0 to avoid
    the REX prefix.

        * sysdeps/x86_64/memset.S: Replace %xmm8 with %xmm0.

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

commit f6d7c0971ba53c505853b0aeedb2129f9097a94a
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:44:39 2015 -0700

    Replace %xmm[8-12] with %xmm[0-4]

    Since ld.so preserves vector registers now, we can use %xmm[0-4] to
    avoid the REX prefix.

        * sysdeps/x86_64/strlen.S: Replace %xmm[8-12] with %xmm[0-4].

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2b45510e7ba338c84c80339da753b1ca4ff863fd

commit 2b45510e7ba338c84c80339da753b1ca4ff863fd
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 28 18:56:18 2015 -0700

    Don't disable SSE in x86-64 ld.so

    Since ld.so preserves vector registers now, we can use SSE in ld.so.

        * sysdeps/i386/Makefile [$(subdir) == elf] (CFLAGS-.os): Add
        -mno-sse -mno-mmx for $(all-rtld-routines).
        [$(subdir) == elf] (tests-special): Add
        $(objpfx)tst-ld-sse-use.out.
        [$(subdir) == elf] ($(objpfx)tst-ld-sse-use.out): New rule.
        * sysdeps/x86/Makefile [$(subdir) == elf] (CFLAGS-.os): Removed.
        [$(subdir) == elf] (tests-special): Likewise.
        [$(subdir) == elf] ($(objpfx)tst-ld-sse-use.out): Likewise.
        * sysdeps/x86_64/Makefile [$(subdir) == elf] (CFLAGS-.os): Add
        -mno-mmx for $(all-rtld-routines).

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9a5a445c81daf83deeeece2eaccd448bdbe9f7fc

commit 9a5a445c81daf83deeeece2eaccd448bdbe9f7fc
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Jul 11 13:25:25 2015 -0700

    Save and restore vector registers in x86-64 ld.so

    This patch initiaizes GLRO(dl_x86_xstate) in dl_platform_init to
    indicate if the processor supports SSE, AVX or AVX512.  It uses
    this information to properly save and restore vector registers in
    ld.so.  Now we can use SSE in ld.so and delete FOREIGN_CALL macros.

        [BZ #15128]
        * sysdeps/x86_64/Makefile [$(subdir) == elf] (tests): Add
        ifuncmain8.
        (modules-names): Add ifuncmod8.
        ($(objpfx)ifuncmain8): New rule.
        * sysdeps/x86_64/dl-machine.h: Include <dl-procinfo.h> and
        <cpuid.h>.
        (elf_machine_runtime_setup): Use _dl_runtime_resolve_sse,
        _dl_runtime_resolve_avx, or _dl_runtime_resolve_avx512,
        _dl_runtime_profile_sse, _dl_runtime_profile_avx, or
        _dl_runtime_profile_avx512, based on HAS_ARCH_FEATURE.
        * sysdeps/x86_64/dl-trampoline.S: Rewrite.
        * sysdeps/x86_64/dl-trampoline.h: Likewise.
        * sysdeps/x86_64/ifuncmain8.c: New file.
        * sysdeps/x86_64/ifuncmod8.c: Likewise.
        * sysdeps/x86_64/nptl/tcb-offsets.sym (RTLD_SAVESPACE_SSE):
        Removed.
        * sysdeps/x86_64/nptl/tls.h (__128bits): Removed.
        (tcbhead_t): Change rtld_must_xmm_save to __glibc_unused1.
        Change rtld_savespace_sse to __glibc_unused2.
        (RTLD_CHECK_FOREIGN_CALL): Removed.
        (RTLD_ENABLE_FOREIGN_CALL): Likewise.
        (RTLD_PREPARE_FOREIGN_CALL): Likewise.
        (RTLD_FINALIZE_FOREIGN_CALL): Likewise.

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

commit b98d88d43186dfe9a6686bbd787cc81ed342d03a
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 12 14:41:20 2015 -0700

    Align stack when calling __errno_location

    We should align stack to 16 bytes when calling __errno_location.

        [BZ #18661]
        * sysdeps/x86_64/fpu/s_cosf.S (__cosf): Align stack to 16 bytes
        when calling __errno_location.
        * sysdeps/x86_64/fpu/s_sincosf.S (__sincosf): Likewise.
        * sysdeps/x86_64/fpu/s_sinf.S (__sinf): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=66c038403ac1f71e71cf16b722bc7afd84618236

commit 66c038403ac1f71e71cf16b722bc7afd84618236
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 12 14:40:25 2015 -0700

    Align stack to 16 bytes when calling __gettimeofday

    Subtract stack by 24 bytes instead of 16 bytes so that stack is aligned
    to 16 bytes when calling __gettimeofday.

        [BZ #18661]
        * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
        (__lll_timedwait_tid): Align stack to 16 bytes when calling
        __gettimeofday.

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

commit f4e9ea84d63a1abefef6dc2b40c3fcd6577d250c
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 12 14:38:58 2015 -0700

    Align stack to 16 bytes when calling __setcontext

    Don't use pop to restore %rdi so that stack is aligned to 16 bytes
    when calling __setcontext.

        [BZ #18661]
        * sysdeps/unix/sysv/linux/x86_64/__start_context.S
        (__start_context): Don't use pop to restore %rdi so that stack
        is aligned to 16 bytes when calling __setcontext.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=802af829d2543721124f52d1ecfc848aaecdad24

commit 802af829d2543721124f52d1ecfc848aaecdad24
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:41:58 2015 -0700

    Compile {memcpy,strcmp}-sse2-unaligned.S only for libc

    {memcpy,strcmp}-sse2-unaligned.S aren't needed in ld.so.

        * sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: Compile
        only for libc.
        * sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8d6a1c02b63cbf5aeb713ef3b17147a9539d91fc

commit 8d6a1c02b63cbf5aeb713ef3b17147a9539d91fc
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Jul 9 09:30:09 2015 -0700

    Improve bndmov encoding with zero displacement

    If x86-64 assembler doesn't support MPX, we encode bndmov instruction by
    hand.  When displacement is zero, assembler generates shorter encoding.
    This patch improves bndmov encoding with zero displacement so that ld.so
    is identical when using assemblers with and without MPX support.

        * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_resolve): Improve
        bndmov encoding with zero displacement.

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

commit a7f515a34f94e863b71ddfecddf2b10fd0f0a267
Author: Igor Zamyatin <igor.zamyatin@intel.com>
Date:   Thu Jul 9 06:50:12 2015 -0700

    Preserve bound registers for pointer pass/return

    We need to save/restore bound registers and add a BND prefix before
    branches in _dl_runtime_profile so that bound registers for pointer
    pass and return are preserved when LD_AUDIT is used.

        [BZ #18134]
        * sysdeps/i386/configure.ac: Set HAVE_MPX_SUPPORT.
        * sysdeps/i386/configure: Regenerated.
        * sysdeps/i386/dl-trampoline.S (PRESERVE_BND_REGS_PREFIX): New.
        (_dl_runtime_profile): Save and restore Intel MPX return bound
        registers when calling _dl_call_pltexit.  Add
        PRESERVE_BND_REGS_PREFIX before return.
        * sysdeps/i386/link-defines.sym (LRV_BND0_OFFSET): New.
        (LRV_BND1_OFFSET): Likewise.
        * sysdeps/x86/bits/link.h (La_i86_retval): Add lrv_bnd0 and
        lrv_bnd1.
        * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Fix
        typo in bndmov encoding.
        * sysdeps/x86_64/dl-trampoline.h: Properly save and restore
        Intel MPX bound registers.  Add PRESERVE_BND_REGS_PREFIX before
        branch instructions to preserve bounds.

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

commit e0bee54529c733fdb427bca0b97f78b7196fd386
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Mar 16 14:58:43 2015 -0700

    Preserve bound registers in _dl_runtime_resolve

    We need to add a BND prefix before indirect branch at the end of
    _dl_runtime_resolve to preserve bound registers.

        [BZ #18134]
        * sysdeps/x86_64/dl-trampoline.S (PRESERVE_BND_REGS_PREFIX): New.
        (_dl_runtime_resolve): Add a BND prefix before indirect branch.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1b123bbb2e30579fe4744fc814c5f102fbd9a8d2

commit 1b123bbb2e30579fe4744fc814c5f102fbd9a8d2
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 7 05:23:24 2015 -0700

    Add and use sysdeps/i386/link-defines.sym

    Define macros for fields in La_i86_regs and La_i86_retval and use them
    in dl-trampoline.S, instead of hardcoded values.

        * sysdeps/i386/Makefile (gen-as-const-headers)[elf]: Add
        link-defines.sym.
        * sysdeps/i386/dl-trampoline.S: Include <link-defines.h>.
        (_dl_runtime_profile): Use LONG_DOUBLE_SIZE, LRV_SIZE,
        LRV_EAX_OFFSET, LRV_EDX_OFFSET, LRV_ST0_OFFSET, LRV_ST1_OFFSET
        and LR_SIZE.
        * sysdeps/i386/link-defines.sym: New file.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7dd3b50bbce127274989eed12b77d06bc9f3cf08

commit 7dd3b50bbce127274989eed12b77d06bc9f3cf08
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 7 05:09:16 2015 -0700

    Add a testcase for i386 LD_AUDIT

    This patch adds a testcase for i386 LD_AUDIT to check function return
    and parameters passed in registers.

        * sysdeps/i386/Makefile (tests)[elf]: Add tst-audit3.
        (modules-names): Add tst-auditmod3a tst-auditmod3b.
        ($(objpfx)tst-audit3): New rule.
        ($(objpfx)tst-audit3.out): Likewise.
        * sysdeps/i386/tst-audit3.c: New file.
        * sysdeps/i386/tst-audit3.h: Likewise.
        * sysdeps/i386/tst-auditmod3a.c: Likewise.
        * sysdeps/i386/tst-auditmod3b.c: Likewise.

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

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug dynamic-link/18134] x86 ld.so doesn't preserve bound registers
  2015-03-16 18:16 [Bug dynamic-link/18134] New: x86-64 ld.so doesn't preserve bound registers hjl.tools at gmail dot com
                   ` (9 preceding siblings ...)
  2015-08-03 21:25 ` cvs-commit at gcc dot gnu.org
@ 2015-08-03 21:36 ` cvs-commit at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-08-03 21:36 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #10 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/plt/2.21 has been created
        at  22ce18019f83b1f9826c32aa2ee56dc0df3fbd49 (commit)

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

commit 22ce18019f83b1f9826c32aa2ee56dc0df3fbd49
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Aug 2 22:27:47 2015 -0700

    Don't run tst-getpid2 with LD_BIND_NOW=1

    Since _dl_x86_64_save_sse and _dl_x86_64_restore_sse are removed now,
    we don't need to run tst-getpid2 with LD_BIND_NOW=1.

        * nptl/Makefile (tst-getpid2-ENV): Removed.

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

commit f0f347fa1c5ac0bb367f1ad85fe69fbdc1d7df41
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 04:49:38 2015 -0700

    Use SSE optimized strcmp in x86-64 ld.so

    Since ld.so preserves vector registers now, we can SSE optimized strcmp
    in x86-64 ld.so.

        * sysdeps/x86_64/strcmp.S: Remove "#if !IS_IN (libc)".

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=969ca0cbde44e2c531f4fb4358da354e45a16895

commit 969ca0cbde44e2c531f4fb4358da354e45a16895
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:56:14 2015 -0700

    Remove x86-64 rtld-xxx.c and rtld-xxx.S

    Since ld.so preserves vector registers now, we can use the regular,
    non-ifunc string and memory functions in ld.so.

        * sysdeps/x86_64/rtld-memcmp.c: Removed.
        * sysdeps/x86_64/rtld-memset.S: Likewise.
        * sysdeps/x86_64/rtld-strchr.S: Likewise.
        * sysdeps/x86_64/rtld-strlen.S: Likewise.
        * sysdeps/x86_64/multiarch/rtld-memcmp.c: Likewise.
        * sysdeps/x86_64/multiarch/rtld-memset.S: Likewise.

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

commit c245d87cf4754a8553b5284206da1d15f1fbb7dc
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:47:54 2015 -0700

    Replace %xmm8 with %xmm0

    Since ld.so preserves vector registers now, we can use %xmm0 to avoid
    the REX prefix.

        * sysdeps/x86_64/memset.S: Replace %xmm8 with %xmm0.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1cb03e05847b1e8e68a06473f0fedf79ecf49005

commit 1cb03e05847b1e8e68a06473f0fedf79ecf49005
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:44:39 2015 -0700

    Replace %xmm[8-12] with %xmm[0-4]

    Since ld.so preserves vector registers now, we can use %xmm[0-4] to
    avoid the REX prefix.

        * sysdeps/x86_64/strlen.S: Replace %xmm[8-12] with %xmm[0-4].

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0b92f51d8303a5148aa99dc101d1e73244199a61

commit 0b92f51d8303a5148aa99dc101d1e73244199a61
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 28 18:56:18 2015 -0700

    Don't disable SSE in x86-64 ld.so

    Since ld.so preserves vector registers now, we can use SSE in ld.so.

        * sysdeps/i386/Makefile [$(subdir) == elf] (CFLAGS-.os): Add
        -mno-sse -mno-mmx for $(all-rtld-routines).
        [$(subdir) == elf] (tests-special): Add
        $(objpfx)tst-ld-sse-use.out.
        [$(subdir) == elf] ($(objpfx)tst-ld-sse-use.out): New rule.
        * sysdeps/x86/Makefile [$(subdir) == elf] (CFLAGS-.os): Removed.
        [$(subdir) == elf] (tests-special): Likewise.
        [$(subdir) == elf] ($(objpfx)tst-ld-sse-use.out): Likewise.
        * sysdeps/x86_64/Makefile [$(subdir) == elf] (CFLAGS-.os): Add
        -mno-mmx for $(all-rtld-routines).

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=00c7c14c2131849983307800f5917c32b58d29d9

commit 00c7c14c2131849983307800f5917c32b58d29d9
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Jul 11 13:25:25 2015 -0700

    Save and restore vector registers in x86-64 ld.so

    This patch initiaizes GLRO(dl_x86_xstate) in dl_platform_init to
    indicate if the processor supports SSE, AVX or AVX512.  It uses
    this information to properly save and restore vector registers in
    ld.so.  Now we can use SSE in ld.so and delete FOREIGN_CALL macros.

        [BZ #15128]
        * sysdeps/x86_64/Makefile [$(subdir) == elf] (tests): Add
        ifuncmain8.
        (modules-names): Add ifuncmod8.
        ($(objpfx)ifuncmain8): New rule.
        * sysdeps/x86_64/dl-machine.h: Include <dl-procinfo.h> and
        <cpuid.h>.
        (elf_machine_runtime_setup): Use _dl_runtime_resolve_sse,
        _dl_runtime_resolve_avx, or _dl_runtime_resolve_avx512,
        _dl_runtime_profile_sse, _dl_runtime_profile_avx, or
        _dl_runtime_profile_avx512, based on HAS_ARCH_FEATURE.
        * sysdeps/x86_64/dl-trampoline.S: Rewrite.
        * sysdeps/x86_64/dl-trampoline.h: Likewise.
        * sysdeps/x86_64/ifuncmain8.c: New file.
        * sysdeps/x86_64/ifuncmod8.c: Likewise.
        * sysdeps/x86_64/nptl/tcb-offsets.sym (RTLD_SAVESPACE_SSE):
        Removed.
        * sysdeps/x86_64/nptl/tls.h (__128bits): Removed.
        (tcbhead_t): Change rtld_must_xmm_save to __glibc_unused1.
        Change rtld_savespace_sse to __glibc_unused2.
        (RTLD_CHECK_FOREIGN_CALL): Removed.
        (RTLD_ENABLE_FOREIGN_CALL): Likewise.
        (RTLD_PREPARE_FOREIGN_CALL): Likewise.
        (RTLD_FINALIZE_FOREIGN_CALL): Likewise.

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

commit b4bf7d64c8f7597cc03abd608b50064f7cca4f40
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 12 14:41:20 2015 -0700

    Align stack when calling __errno_location

    We should align stack to 16 bytes when calling __errno_location.

        [BZ #18661]
        * sysdeps/x86_64/fpu/s_cosf.S (__cosf): Align stack to 16 bytes
        when calling __errno_location.
        * sysdeps/x86_64/fpu/s_sincosf.S (__sincosf): Likewise.
        * sysdeps/x86_64/fpu/s_sinf.S (__sinf): Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1c8f0fb6a4ebef1080e254753e6a4e6c07a66a4f

commit 1c8f0fb6a4ebef1080e254753e6a4e6c07a66a4f
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 12 14:40:25 2015 -0700

    Align stack to 16 bytes when calling __gettimeofday

    Subtract stack by 24 bytes instead of 16 bytes so that stack is aligned
    to 16 bytes when calling __gettimeofday.

        [BZ #18661]
        * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
        (__lll_timedwait_tid): Align stack to 16 bytes when calling
        __gettimeofday.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=08094d48c130d3ae6182296ef3c9561ca1066b39

commit 08094d48c130d3ae6182296ef3c9561ca1066b39
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 12 14:38:58 2015 -0700

    Align stack to 16 bytes when calling __setcontext

    Don't use pop to restore %rdi so that stack is aligned to 16 bytes
    when calling __setcontext.

        [BZ #18661]
        * sysdeps/unix/sysv/linux/x86_64/__start_context.S
        (__start_context): Don't use pop to restore %rdi so that stack
        is aligned to 16 bytes when calling __setcontext.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=723a5bd465082390bd9369d4f95ec11b32cf47dd

commit 723a5bd465082390bd9369d4f95ec11b32cf47dd
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 29 03:41:58 2015 -0700

    Compile {memcpy,strcmp}-sse2-unaligned.S only for libc

    {memcpy,strcmp}-sse2-unaligned.S aren't needed in ld.so.

        * sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: Compile
        only for libc.
        * sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3d497ce3d1ab11a363c543b42737a0696329ed40

commit 3d497ce3d1ab11a363c543b42737a0696329ed40
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Aug 1 07:47:16 2015 -0700

    Update x86 elision-conf.c for <cpu-features.h>

    This patch updates x86 elision-conf.c to use the newly defined
    HAS_CPU_FEATURE from <cpu-features.h>.

        * sysdeps/unix/sysv/linux/x86/elision-conf.c (elision_init):
        Replace HAS_RTM with HAS_CPU_FEATURE (RTM).

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3dbbb788b8b59f0c88ac8eeae341f491dd739949

commit 3dbbb788b8b59f0c88ac8eeae341f491dd739949
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 31 16:52:19 2015 -0700

    Update i686 multiarch functions for <cpu-features.h>

    This patch updates i686 multiarch functions to use the newly defined
    HAS_CPU_FEATURE, HAS_ARCH_FEATURE, LOAD_GOT_AND_RTLD_GLOBAL_RO and
    LOAD_FUNC_GOT_EAX from <cpu-features.h>.

        * sysdeps/i386/i686/fpu/multiarch/e_expf.c: Replace HAS_XXX
        with HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/i386/i686/fpu/multiarch/s_cosf.c: Likewise.
        * sysdeps/i386/i686/fpu/multiarch/s_cosf.c: Likewise.
        * sysdeps/i386/i686/fpu/multiarch/s_sincosf.c: Likewise.
        * sysdeps/i386/i686/fpu/multiarch/s_sinf.c: Likewise.
        * sysdeps/i386/i686/multiarch/ifunc-impl-list.c: Likewise.
        * sysdeps/i386/i686/multiarch/s_fma.c: Likewise.
        * sysdeps/i386/i686/multiarch/s_fmaf.c: Likewise.
        * sysdeps/i386/i686/multiarch/bcopy.S: Remove __init_cpu_features
        call.  Merge SHARED and !SHARED.  Add LOAD_GOT_AND_RTLD_GLOBAL_RO.
        Use LOAD_FUNC_GOT_EAX to load function address.  Replace HAS_XXX
        with HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/i386/i686/multiarch/bzero.S: Likewise.
        * sysdeps/i386/i686/multiarch/memchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/memcmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/memcpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/memcpy_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/memmove.S: Likewise.
        * sysdeps/i386/i686/multiarch/memmove_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/mempcpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/mempcpy_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/memrchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/memset.S: Likewise.
        * sysdeps/i386/i686/multiarch/memset_chk.S: Likewise.
        * sysdeps/i386/i686/multiarch/rawmemchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcasecmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcat.S: Likewise.
        * sysdeps/i386/i686/multiarch/strchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/strcspn.S: Likewise.
        * sysdeps/i386/i686/multiarch/strlen.S: Likewise.
        * sysdeps/i386/i686/multiarch/strncase.S: Likewise.
        * sysdeps/i386/i686/multiarch/strnlen.S: Likewise.
        * sysdeps/i386/i686/multiarch/strrchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/strspn.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcschr.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcscmp.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcscpy.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcslen.S: Likewise.
        * sysdeps/i386/i686/multiarch/wcsrchr.S: Likewise.
        * sysdeps/i386/i686/multiarch/wmemcmp.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0fb36bf746cd24c110898a39881c88a7398e4e59

commit 0fb36bf746cd24c110898a39881c88a7398e4e59
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 31 13:41:04 2015 -0700

    Update x86_64 multiarch functions for <cpu-features.h>

    This patch updates x86_64 multiarch functions to use the newly defined
    HAS_CPU_FEATURE, HAS_ARCH_FEATURE and LOAD_RTLD_GLOBAL_RO_RDX from
    <cpu-features.h>.

        * sysdeps/x86_64/fpu/multiarch/e_asin.c: Replace HAS_XXX with
        HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/x86_64/fpu/multiarch/e_atan2.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/e_exp.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/e_log.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/e_pow.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_atan.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_fma.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_fmaf.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_sin.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_tan.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_ceil.S: Use
        LOAD_RTLD_GLOBAL_RO_RDX and HAS_CPU_FEATURE (SSE4_1).
        * sysdeps/x86_64/fpu/multiarch/s_ceilf.S: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_floor.S: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_floorf.S: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_nearbyint.S : Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_rintf.S: Likewise.
        * sysdeps/x86_64/fpu/multiarch/s_rintf.S : Likewise.
        * sysdeps/x86_64/multiarch/ifunc-impl-list.c: Likewise.
        * sysdeps/x86_64/multiarch/sched_cpucount.c: Likewise.
        * sysdeps/x86_64/multiarch/strstr.c: Likewise.
        * sysdeps/x86_64/multiarch/memmove.c: Likewise.
        * sysdeps/x86_64/multiarch/memmove_chk.c: Likewise.
        * sysdeps/x86_64/multiarch/test-multiarch.c: Likewise.
        * sysdeps/x86_64/multiarch/memcmp.S: Remove __init_cpu_features
        call.  Add LOAD_RTLD_GLOBAL_RO_RDX.  Replace HAS_XXX with
        HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX).
        * sysdeps/x86_64/multiarch/memcpy.S: Likewise.
        * sysdeps/x86_64/multiarch/memcpy_chk.S: Likewise.
        * sysdeps/x86_64/multiarch/mempcpy.S: Likewise.
        * sysdeps/x86_64/multiarch/mempcpy_chk.S: Likewise.
        * sysdeps/x86_64/multiarch/memset.S: Likewise.
        * sysdeps/x86_64/multiarch/memset_chk.S: Likewise.
        * sysdeps/x86_64/multiarch/strcat.S: Likewise.
        * sysdeps/x86_64/multiarch/strchr.S: Likewise.
        * sysdeps/x86_64/multiarch/strcmp.S: Likewise.
        * sysdeps/x86_64/multiarch/strcpy.S: Likewise.
        * sysdeps/x86_64/multiarch/strcspn.S: Likewise.
        * sysdeps/x86_64/multiarch/strspn.S: Likewise.
        * sysdeps/x86_64/multiarch/wcscpy.S: Likewise.
        * sysdeps/x86_64/multiarch/wmemcmp.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=14fda2e2ef67727228e3b7e2dea174cac4ffd19d

commit 14fda2e2ef67727228e3b7e2dea174cac4ffd19d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 31 07:30:04 2015 -0700

    Add _dl_x86_cpu_features to rtld_global in ld.so

    This patch adds _dl_x86_cpu_features to rtld_global in x86 ld.so
    and initializes it early before __libc_start_main is called so that
    cpu_features is always available when it is used and we can avoid
    calling __init_cpu_features in IFUNC selectors.

        * sysdeps/i386/dl-machine.h: Include <cpu-features.c>.
        (dl_platform_init): Call init_cpu_features.
        * sysdeps/i386/dl-procinfo.c (_dl_x86_cpu_features): New.
        * sysdeps/i386/i686/cacheinfo.c
        (DISABLE_PREFERRED_MEMORY_INSTRUCTION): Removed.
        * sysdeps/i386/i686/multiarch/Makefile (aux): Remove init-arch.
        * sysdeps/i386/i686/multiarch/Versions: Removed.
        * sysdeps/i386/i686/multiarch/ifunc-defines.sym (KIND_OFFSET):
        Removed.
        * sysdeps/i386/ldsodefs.h: Include <cpu-features.h>.
        * sysdeps/unix/sysv/linux/x86/Makefile
        (libpthread-sysdep_routines): Remove init-arch.
        * sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c: Include
        <sysdeps/x86_64/dl-procinfo.c> instead of
        sysdeps/generic/dl-procinfo.c>.
        * sysdeps/x86/Makefile [$(subdir) == csu] (gen-as-const-headers):
        Add cpu-features-offsets.sym and rtld-global-offsets.sym.
        [$(subdir) == elf] (sysdep-dl-routines): Add dl-get-cpu-features.
        [$(subdir) == elf] (sysdep-rtld-routines): Likewise.
        [$(subdir) == elf] (sysdep_routines): Likewise.
        [$(subdir) == elf] (elide-routines.os): Likewise.
        [$(subdir) == elf] (tests): Add tst-get-cpu-features.
        [$(subdir) == elf] (tests-static): Add
        tst-get-cpu-features-static.
        * sysdeps/x86/Versions: New file.
        * sysdeps/x86/cpu-features-offsets.sym: Likewise.
        * sysdeps/x86/cpu-features.c: Likewise.
        * sysdeps/x86/cpu-features.h: Likewise.
        * sysdeps/x86/dl-get-cpu-features.c: Likewise.
        * sysdeps/x86/libc-start.c: Likewise.
        * sysdeps/x86/rtld-global-offsets.sym: Likewise.
        * sysdeps/x86/tst-get-cpu-features-static.c: Likewise.
        * sysdeps/x86/tst-get-cpu-features.c: Likewise.
        * sysdeps/x86_64/dl-procinfo.c: Likewise.
        * sysdeps/x86_64/cacheinfo.c (__cpuid_count): Removed.
        Assume USE_MULTIARCH is defined and don't check it.
        (is_intel): Replace __cpu_features with GLRO(dl_x86_cpu_features).
        (is_amd): Likewise.
        (max_cpuid): Likewise.
        (intel_check_word): Likewise.
        (__cache_sysconf): Don't call __init_cpu_features.
        (__x86_preferred_memory_instruction): Removed.
        (init_cacheinfo): Don't call __init_cpu_features. Replace
        __cpu_features with GLRO(dl_x86_cpu_features).
        * sysdeps/x86_64/dl-machine.h: <cpu-features.c>.
        (dl_platform_init): Call init_cpu_features.
        * sysdeps/x86_64/ldsodefs.h: Include <cpu-features.h>.
        * sysdeps/x86_64/multiarch/Makefile (aux): Remove init-arch.
        * sysdeps/x86_64/multiarch/Versions: Removed.
        * sysdeps/x86_64/multiarch/cacheinfo.c: Likewise.
        * sysdeps/x86_64/multiarch/init-arch.c: Likewise.
        * sysdeps/x86_64/multiarch/ifunc-defines.sym (KIND_OFFSET):
        Removed.
        * sysdeps/x86_64/multiarch/init-arch.h: Rewrite.

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

commit fdd3aa0b19700ab564da895a2a85bf3fdb0bedf0
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Jul 9 09:30:09 2015 -0700

    Improve bndmov encoding with zero displacement

    If x86-64 assembler doesn't support MPX, we encode bndmov instruction by
    hand.  When displacement is zero, assembler generates shorter encoding.
    This patch improves bndmov encoding with zero displacement so that ld.so
    is identical when using assemblers with and without MPX support.

        * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_resolve): Improve
        bndmov encoding with zero displacement.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9e4fc7f67f6695f294ae759a6b540f5d08a56f0c

commit 9e4fc7f67f6695f294ae759a6b540f5d08a56f0c
Author: Igor Zamyatin <igor.zamyatin@intel.com>
Date:   Thu Jul 9 06:50:12 2015 -0700

    Preserve bound registers for pointer pass/return

    We need to save/restore bound registers and add a BND prefix before
    branches in _dl_runtime_profile so that bound registers for pointer
    pass and return are preserved when LD_AUDIT is used.

        [BZ #18134]
        * sysdeps/i386/configure.ac: Set HAVE_MPX_SUPPORT.
        * sysdeps/i386/configure: Regenerated.
        * sysdeps/i386/dl-trampoline.S (PRESERVE_BND_REGS_PREFIX): New.
        (_dl_runtime_profile): Save and restore Intel MPX return bound
        registers when calling _dl_call_pltexit.  Add
        PRESERVE_BND_REGS_PREFIX before return.
        * sysdeps/i386/link-defines.sym (LRV_BND0_OFFSET): New.
        (LRV_BND1_OFFSET): Likewise.
        * sysdeps/x86/bits/link.h (La_i86_retval): Add lrv_bnd0 and
        lrv_bnd1.
        * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Fix
        typo in bndmov encoding.
        * sysdeps/x86_64/dl-trampoline.h: Properly save and restore
        Intel MPX bound registers.  Add PRESERVE_BND_REGS_PREFIX before
        branch instructions to preserve bounds.

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

commit b15f277bac14482c8b2dda4931ebf919644932fa
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Mar 16 14:58:43 2015 -0700

    Preserve bound registers in _dl_runtime_resolve

    We need to add a BND prefix before indirect branch at the end of
    _dl_runtime_resolve to preserve bound registers.

        [BZ #18134]
        * sysdeps/x86_64/dl-trampoline.S (PRESERVE_BND_REGS_PREFIX): New.
        (_dl_runtime_resolve): Add a BND prefix before indirect branch.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=20f87a053b1e6a9106851f764c205d59fd4b6879

commit 20f87a053b1e6a9106851f764c205d59fd4b6879
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 7 05:23:24 2015 -0700

    Add and use sysdeps/i386/link-defines.sym

    Define macros for fields in La_i86_regs and La_i86_retval and use them
    in dl-trampoline.S, instead of hardcoded values.

        * sysdeps/i386/Makefile (gen-as-const-headers)[elf]: Add
        link-defines.sym.
        * sysdeps/i386/dl-trampoline.S: Include <link-defines.h>.
        (_dl_runtime_profile): Use LONG_DOUBLE_SIZE, LRV_SIZE,
        LRV_EAX_OFFSET, LRV_EDX_OFFSET, LRV_ST0_OFFSET, LRV_ST1_OFFSET
        and LR_SIZE.
        * sysdeps/i386/link-defines.sym: New file.

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

commit d6fd297566e2389ab855325754bcb25f604c6b7d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 7 05:09:16 2015 -0700

    Add a testcase for i386 LD_AUDIT

    This patch adds a testcase for i386 LD_AUDIT to check function return
    and parameters passed in registers.

        * sysdeps/i386/Makefile (tests)[elf]: Add tst-audit3.
        (modules-names): Add tst-auditmod3a tst-auditmod3b.
        ($(objpfx)tst-audit3): New rule.
        ($(objpfx)tst-audit3.out): Likewise.
        * sysdeps/i386/tst-audit3.c: New file.
        * sysdeps/i386/tst-audit3.h: Likewise.
        * sysdeps/i386/tst-auditmod3a.c: Likewise.
        * sysdeps/i386/tst-auditmod3b.c: Likewise.

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

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-08-03 21:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-16 18:16 [Bug dynamic-link/18134] New: x86-64 ld.so doesn't preserve bound registers hjl.tools at gmail dot com
2015-03-16 19:56 ` [Bug dynamic-link/18134] " hjl.tools at gmail dot com
2015-03-16 22:00 ` cvs-commit at gcc dot gnu.org
2015-03-18 14:28 ` hjl.tools at gmail dot com
2015-03-18 14:29 ` [Bug dynamic-link/18134] x86 " hjl.tools at gmail dot com
2015-07-09 14:08 ` cvs-commit at gcc dot gnu.org
2015-07-09 14:11 ` hjl.tools at gmail dot com
2015-08-02 13:57 ` cvs-commit at gcc dot gnu.org
2015-08-02 17:43 ` cvs-commit at gcc dot gnu.org
2015-08-03  4:47 ` cvs-commit at gcc dot gnu.org
2015-08-03 21:25 ` cvs-commit at gcc dot gnu.org
2015-08-03 21:36 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).