Bug 19679 - gcc-4.9.3 C++ exception handling broken due to unaligned stack
Summary: gcc-4.9.3 C++ exception handling broken due to unaligned stack
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: dynamic-link (show other bugs)
Version: 2.23
: P2 normal
Target Milestone: 2.24
Assignee: H.J. Lu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-19 18:11 UTC by Markus Trippelsdorf
Modified: 2016-05-23 18:52 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments
A patch (362 bytes, patch)
2016-02-19 21:18 UTC, H.J. Lu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Trippelsdorf 2016-02-19 18:11:45 UTC
with glibc-2.23 and libstdc++ from gcc-4.9.3 I get:

markus@x4 tmp % cat ex.cpp
#include <iostream>
#include <stdexcept>

int main() {
  try {
    throw std::runtime_error("foo");
  } catch (const std::runtime_error &e) {
    std::cout << "Caught exception e=" << e.what() << std::endl;
  }
}
markus@x4 tmp % /usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3/g++ -O2 -g ex.cpp

markus@x4 tmp % LD_PRELOAD=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/libstdc++.so.6.0.20 gdb ./a.out
Reading symbols from ./a.out...done.
(gdb) run
Starting program: /var/tmp/a.out 

Program received signal SIGSEGV, Segmentation fault.
_dl_lookup_symbol_x (undef_name=0x7ffff7aba4d3 "__tls_get_addr", undef_map=0x7ffff7ff65e0, ref=ref@entry=0x7fffffffe290, symbol_scope=0x7ffff7ff6938, 
    version=0x7ffff7fd0f60, type_class=type_class@entry=1, flags=1, skip_map=0x0) at dl-lookup.c:809
809       struct sym_val current_value = { NULL, NULL };
(gdb) bt
#0  _dl_lookup_symbol_x (undef_name=0x7ffff7aba4d3 "__tls_get_addr", undef_map=0x7ffff7ff65e0, ref=ref@entry=0x7fffffffe290, symbol_scope=0x7ffff7ff6938, 
    version=0x7ffff7fd0f60, type_class=type_class@entry=1, flags=1, skip_map=0x0) at dl-lookup.c:809
#1  0x00007ffff7de6534 in _dl_fixup (l=<optimized out>, reloc_arg=<optimized out>) at ../elf/dl-runtime.c:111
#2  0x00007ffff7deef5f in _dl_runtime_resolve_sse () at ../sysdeps/x86_64/dl-trampoline.h:112
#3  0x00007ffff7afa78c in __cxa_get_globals () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/libstdc++.so.6.0.20
#4  0x00007ffff7afbdb6 in __cxa_throw () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/libstdc++.so.6.0.20
#5  0x0000000000400c7a in main () at ex.cpp:6
(gdb) disass
Dump of assembler code for function _dl_lookup_symbol_x:
   0x00007ffff7de0a60 <+0>:     push   %rbp
   0x00007ffff7de0a61 <+1>:     mov    %rsp,%rbp
   0x00007ffff7de0a64 <+4>:     push   %r15
   0x00007ffff7de0a66 <+6>:     push   %r14
   0x00007ffff7de0a68 <+8>:     push   %r13
   0x00007ffff7de0a6a <+10>:    push   %r12
   0x00007ffff7de0a6c <+12>:    mov    %rdx,%r15
   0x00007ffff7de0a6f <+15>:    push   %rbx
   0x00007ffff7de0a70 <+16>:    mov    %rsi,%r14
   0x00007ffff7de0a73 <+19>:    mov    %r8,%r12
   0x00007ffff7de0a76 <+22>:    sub    $0xc8,%rsp
   0x00007ffff7de0a7d <+29>:    movzbl (%rdi),%edx
   0x00007ffff7de0a80 <+32>:    mov    %rdi,-0xa8(%rbp)
   0x00007ffff7de0a87 <+39>:    mov    %rcx,-0xd0(%rbp)
   0x00007ffff7de0a8e <+46>:    mov    %r9d,-0xbc(%rbp)
   0x00007ffff7de0a95 <+53>:    mov    0x18(%rbp),%r13
   0x00007ffff7de0a99 <+57>:    test   %dl,%dl
   0x00007ffff7de0a9b <+59>:    je     0x7ffff7de0dc1 <_dl_lookup_symbol_x+865>
   0x00007ffff7de0aa1 <+65>:    mov    %rdi,%rcx
   0x00007ffff7de0aa4 <+68>:    mov    $0x1505,%eax
   0x00007ffff7de0aa9 <+73>:    nopl   (%rax)
   0x00007ffff7de0aac <+76>:    nopw   %cs:0x0(%rax,%rax,1)
   0x00007ffff7de0ab6 <+86>:    nopw   %cs:0x0(%rax,%rax,1)
   0x00007ffff7de0ac0 <+96>:    mov    %rax,%rsi
   0x00007ffff7de0ac3 <+99>:    inc    %rcx
   0x00007ffff7de0ac6 <+102>:   shl    $0x5,%rsi
   0x00007ffff7de0aca <+106>:   add    %rsi,%rax
   0x00007ffff7de0acd <+109>:   add    %rdx,%rax
   0x00007ffff7de0ad0 <+112>:   movzbl (%rcx),%edx
   0x00007ffff7de0ad3 <+115>:   test   %dl,%dl
   0x00007ffff7de0ad5 <+117>:   jne    0x7ffff7de0ac0 <_dl_lookup_symbol_x+96>
   0x00007ffff7de0ad7 <+119>:   mov    %eax,%eax
   0x00007ffff7de0ad9 <+121>:   mov    %rax,-0xb0(%rbp)
   0x00007ffff7de0ae0 <+128>:   pxor   %xmm0,%xmm0
   0x00007ffff7de0ae4 <+132>:   mov    $0xffffffff,%eax
   0x00007ffff7de0ae9 <+137>:   incq   0x21ce88(%rip)        # 0x7ffff7ffd978 <_rtld_local+2424>
   0x00007ffff7de0af0 <+144>:   test   %r12,%r12
   0x00007ffff7de0af3 <+147>:   mov    %rax,-0xa0(%rbp)
=> 0x00007ffff7de0afa <+154>:   movaps %xmm0,-0x90(%rbp)
(gdb) info registers
rax            0xffffffff       4294967295
rbx            0x7ffff7dbf738   140737351776056
rcx            0x7ffff7aba4e1   140737348609249
rdx            0x0      0
rsi            0x48fd0643617edba0       5259366826306886560
rdi            0x7ffff7aba4d3   140737348609235
rbp            0x7fffffffe268   0x7fffffffe268
rsp            0x7fffffffe178   0x7fffffffe178
r8             0x7ffff7fd0f60   140737353944928
r9             0x1      1
r10            0x7ffff7ff65e0   140737354098144
r11            0x7ffff7afa780   140737348872064
r12            0x7ffff7fd0f60   140737353944928
r13            0x0      0
r14            0x7ffff7ff65e0   140737354098144
r15            0x7fffffffe290   140737488347792
rip            0x7ffff7de0afa   0x7ffff7de0afa <_dl_lookup_symbol_x+154>
eflags         0x10206  [ PF IF RF ]
cs             0x33     51
ss             0x2b     43
ds             0x0      0
es             0x0      0
fs             0x0      0
gs             0x0      0

sysdeps/x86_64/dl-trampoline.S says:

 23 #ifndef DL_STACK_ALIGNMENT                                                                                                                                                
 24 /* Due to GCC bug:                                                                                                                                                        
 25                                                                                                                                                                           
 26    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066                                                                                                                     
 27                                                                                                                                                                           
 28    __tls_get_addr may be called with 8-byte stack alignment.  Although                                                                                                    
 29    this bug has been fixed in GCC 4.9.4, 5.3 and 6, we can't assume                                                                                                       
 30    that stack will be always aligned at 16 bytes.  We use unaligned                                                                                                       
 31    16-byte move to load and store SSE registers, which has no penalty                                                                                                     
 32    on modern processors if stack is 16-byte aligned.  */                                                                                                                  
 33 # define DL_STACK_ALIGNMENT 8                                                                                                                                             
 34 #endif                                                                                                                                                                    
 35                                                                                                                                                                           
 36 #ifndef DL_RUNIME_UNALIGNED_VEC_SIZE                                                                                                                                      
 37 /* The maximum size of unaligned vector load and store.  */                                                                                                               
 38 # define DL_RUNIME_UNALIGNED_VEC_SIZE 16                                                                                                                                  
 39 #endif                                                                                                                                                                    
 40                                                                                                                                                                           
 41 /* True if _dl_runtime_resolve should align stack to VEC_SIZE bytes.  */                                                                                                  
 42 #define DL_RUNIME_RESOLVE_REALIGN_STACK \                                                                                                                                 
 43   (VEC_SIZE > DL_STACK_ALIGNMENT \                                                                                                                                        
 44    && VEC_SIZE > DL_RUNIME_UNALIGNED_VEC_SIZE)  

But _dl_lookup_symbol_x also may use SSE instructions. And these lead
to the crash when called on the unaligned stack.
Comment 1 H.J. Lu 2016-02-19 21:18:11 UTC
Created attachment 9021 [details]
A patch
Comment 2 cvs-commit@gcc.gnu.org 2016-02-19 23:49:31 UTC
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  8d9c92017d85f23ba6a2b3614b2f2bcf1820d6f0 (commit)
      from  eab5028860f8e20c543bccb2d7cc100d167ead34 (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=8d9c92017d85f23ba6a2b3614b2f2bcf1820d6f0

commit 8d9c92017d85f23ba6a2b3614b2f2bcf1820d6f0
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Feb 19 15:43:45 2016 -0800

    [x86_64] Set DL_RUNTIME_UNALIGNED_VEC_SIZE to 8
    
    Due to GCC bug:
    
       https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066
    
    __tls_get_addr may be called with 8-byte stack alignment.  Although
    this bug has been fixed in GCC 4.9.4, 5.3 and 6, we can't assume
    that stack will be always aligned at 16 bytes.  Since SSE optimized
    memory/string functions with aligned SSE register load and store are
    used in the dynamic linker, we must set DL_RUNTIME_UNALIGNED_VEC_SIZE
    to 8 so that _dl_runtime_resolve_sse will align the stack before
    calling _dl_fixup:
    
    Dump of assembler code for function _dl_runtime_resolve_sse:
       0x00007ffff7deea90 <+0>:	push   %rbx
       0x00007ffff7deea91 <+1>:	mov    %rsp,%rbx
       0x00007ffff7deea94 <+4>:	and    $0xfffffffffffffff0,%rsp
                                    ^^^^^^^^^^^ Align stack to 16 bytes
       0x00007ffff7deea98 <+8>:	sub    $0x100,%rsp
       0x00007ffff7deea9f <+15>:	mov    %rax,0xc0(%rsp)
       0x00007ffff7deeaa7 <+23>:	mov    %rcx,0xc8(%rsp)
       0x00007ffff7deeaaf <+31>:	mov    %rdx,0xd0(%rsp)
       0x00007ffff7deeab7 <+39>:	mov    %rsi,0xd8(%rsp)
       0x00007ffff7deeabf <+47>:	mov    %rdi,0xe0(%rsp)
       0x00007ffff7deeac7 <+55>:	mov    %r8,0xe8(%rsp)
       0x00007ffff7deeacf <+63>:	mov    %r9,0xf0(%rsp)
       0x00007ffff7deead7 <+71>:	movaps %xmm0,(%rsp)
       0x00007ffff7deeadb <+75>:	movaps %xmm1,0x10(%rsp)
       0x00007ffff7deeae0 <+80>:	movaps %xmm2,0x20(%rsp)
       0x00007ffff7deeae5 <+85>:	movaps %xmm3,0x30(%rsp)
       0x00007ffff7deeaea <+90>:	movaps %xmm4,0x40(%rsp)
       0x00007ffff7deeaef <+95>:	movaps %xmm5,0x50(%rsp)
       0x00007ffff7deeaf4 <+100>:	movaps %xmm6,0x60(%rsp)
       0x00007ffff7deeaf9 <+105>:	movaps %xmm7,0x70(%rsp)
    
    	[BZ #19679]
    	* sysdeps/x86_64/dl-trampoline.S (DL_RUNIME_UNALIGNED_VEC_SIZE):
    	Renamed to ...
    	(DL_RUNTIME_UNALIGNED_VEC_SIZE): This.  Set to 8.
    	(DL_RUNIME_RESOLVE_REALIGN_STACK): Renamed to ...
    	(DL_RUNTIME_RESOLVE_REALIGN_STACK): This.  Updated.
    	(DL_RUNIME_RESOLVE_REALIGN_STACK): Renamed to ...
    	(DL_RUNTIME_RESOLVE_REALIGN_STACK): This.
    	* sysdeps/x86_64/dl-trampoline.h
    	(DL_RUNIME_RESOLVE_REALIGN_STACK): Renamed to ...
    	(DL_RUNTIME_RESOLVE_REALIGN_STACK): This.

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

Summary of changes:
 ChangeLog                      |   14 ++++++++++++++
 sysdeps/x86_64/dl-trampoline.S |   20 ++++++++++++--------
 sysdeps/x86_64/dl-trampoline.h |    6 +++---
 3 files changed, 29 insertions(+), 11 deletions(-)
Comment 3 cvs-commit@gcc.gnu.org 2016-02-19 23:54:06 UTC
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/pr19679/2.23 has been created
        at  2fe5d64028a6ac13fa2293dd834086255e1525ea (commit)

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

commit 2fe5d64028a6ac13fa2293dd834086255e1525ea
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Feb 19 15:43:45 2016 -0800

    [x86_64] Set DL_RUNTIME_UNALIGNED_VEC_SIZE to 8
    
    Due to GCC bug:
    
       https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066
    
    __tls_get_addr may be called with 8-byte stack alignment.  Although
    this bug has been fixed in GCC 4.9.4, 5.3 and 6, we can't assume
    that stack will be always aligned at 16 bytes.  Since SSE optimized
    memory/string functions with aligned SSE register load and store are
    used in the dynamic linker, we must set DL_RUNTIME_UNALIGNED_VEC_SIZE
    to 8 so that _dl_runtime_resolve_sse will align the stack before
    calling _dl_fixup:
    
    Dump of assembler code for function _dl_runtime_resolve_sse:
       0x00007ffff7deea90 <+0>:	push   %rbx
       0x00007ffff7deea91 <+1>:	mov    %rsp,%rbx
       0x00007ffff7deea94 <+4>:	and    $0xfffffffffffffff0,%rsp
                                    ^^^^^^^^^^^ Align stack to 16 bytes
       0x00007ffff7deea98 <+8>:	sub    $0x100,%rsp
       0x00007ffff7deea9f <+15>:	mov    %rax,0xc0(%rsp)
       0x00007ffff7deeaa7 <+23>:	mov    %rcx,0xc8(%rsp)
       0x00007ffff7deeaaf <+31>:	mov    %rdx,0xd0(%rsp)
       0x00007ffff7deeab7 <+39>:	mov    %rsi,0xd8(%rsp)
       0x00007ffff7deeabf <+47>:	mov    %rdi,0xe0(%rsp)
       0x00007ffff7deeac7 <+55>:	mov    %r8,0xe8(%rsp)
       0x00007ffff7deeacf <+63>:	mov    %r9,0xf0(%rsp)
       0x00007ffff7deead7 <+71>:	movaps %xmm0,(%rsp)
       0x00007ffff7deeadb <+75>:	movaps %xmm1,0x10(%rsp)
       0x00007ffff7deeae0 <+80>:	movaps %xmm2,0x20(%rsp)
       0x00007ffff7deeae5 <+85>:	movaps %xmm3,0x30(%rsp)
       0x00007ffff7deeaea <+90>:	movaps %xmm4,0x40(%rsp)
       0x00007ffff7deeaef <+95>:	movaps %xmm5,0x50(%rsp)
       0x00007ffff7deeaf4 <+100>:	movaps %xmm6,0x60(%rsp)
       0x00007ffff7deeaf9 <+105>:	movaps %xmm7,0x70(%rsp)
    
    	[BZ #19679]
    	* sysdeps/x86_64/dl-trampoline.S (DL_RUNIME_UNALIGNED_VEC_SIZE):
    	Renamed to ...
    	(DL_RUNTIME_UNALIGNED_VEC_SIZE): This.  Set to 8.
    	(DL_RUNIME_RESOLVE_REALIGN_STACK): Renamed to ...
    	(DL_RUNTIME_RESOLVE_REALIGN_STACK): This.  Updated.
    	(DL_RUNIME_RESOLVE_REALIGN_STACK): Renamed to ...
    	(DL_RUNTIME_RESOLVE_REALIGN_STACK): This.
    	* sysdeps/x86_64/dl-trampoline.h
    	(DL_RUNIME_RESOLVE_REALIGN_STACK): Renamed to ...
    	(DL_RUNTIME_RESOLVE_REALIGN_STACK): This.

-----------------------------------------------------------------------
Comment 4 H.J. Lu 2016-02-19 23:54:53 UTC
Please verify hjl/pr19679/2.23 branch before I backport it to 2.23 branch.
Comment 5 Markus Trippelsdorf 2016-02-20 06:42:10 UTC
(In reply to H.J. Lu from comment #4)
> Please verify hjl/pr19679/2.23 branch before I backport it to 2.23 branch.

Without your patch:
markus@x4 tmp % LD_PRELOAD=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/libstdc++.so.6.0.20 /var/tmp/glibc-build/elf/ld.so ./a.out
[1]    14085 segmentation fault  LD_PRELOAD=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/libstdc++.so.6.0.20  ./a.out

With your patch:
markus@x4 tmp % LD_PRELOAD=/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/libstdc++.so.6.0.20 /var/tmp/glibc-build/elf/ld.so ./a.out
Caught exception e=foo

Thanks.
Comment 6 cvs-commit@gcc.gnu.org 2016-02-22 17:47:47 UTC
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, release/2.23/master has been updated
       via  6094fc2cf7eab30889df0416a5c051a5e7171895 (commit)
      from  e742928c1592b43db6809db4f39e67be151cdd27 (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=6094fc2cf7eab30889df0416a5c051a5e7171895

commit 6094fc2cf7eab30889df0416a5c051a5e7171895
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Feb 22 09:32:57 2016 -0800

    [x86_64] Set DL_RUNTIME_UNALIGNED_VEC_SIZE to 8
    
    Due to GCC bug:
    
       https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066
    
    __tls_get_addr may be called with 8-byte stack alignment.  Although
    this bug has been fixed in GCC 4.9.4, 5.3 and 6, we can't assume
    that stack will be always aligned at 16 bytes.  Since SSE optimized
    memory/string functions with aligned SSE register load and store are
    used in the dynamic linker, we must set DL_RUNTIME_UNALIGNED_VEC_SIZE
    to 8 so that _dl_runtime_resolve_sse will align the stack before
    calling _dl_fixup:
    
    Dump of assembler code for function _dl_runtime_resolve_sse:
       0x00007ffff7deea90 <+0>:	push   %rbx
       0x00007ffff7deea91 <+1>:	mov    %rsp,%rbx
       0x00007ffff7deea94 <+4>:	and    $0xfffffffffffffff0,%rsp
                                    ^^^^^^^^^^^ Align stack to 16 bytes
       0x00007ffff7deea98 <+8>:	sub    $0x100,%rsp
       0x00007ffff7deea9f <+15>:	mov    %rax,0xc0(%rsp)
       0x00007ffff7deeaa7 <+23>:	mov    %rcx,0xc8(%rsp)
       0x00007ffff7deeaaf <+31>:	mov    %rdx,0xd0(%rsp)
       0x00007ffff7deeab7 <+39>:	mov    %rsi,0xd8(%rsp)
       0x00007ffff7deeabf <+47>:	mov    %rdi,0xe0(%rsp)
       0x00007ffff7deeac7 <+55>:	mov    %r8,0xe8(%rsp)
       0x00007ffff7deeacf <+63>:	mov    %r9,0xf0(%rsp)
       0x00007ffff7deead7 <+71>:	movaps %xmm0,(%rsp)
       0x00007ffff7deeadb <+75>:	movaps %xmm1,0x10(%rsp)
       0x00007ffff7deeae0 <+80>:	movaps %xmm2,0x20(%rsp)
       0x00007ffff7deeae5 <+85>:	movaps %xmm3,0x30(%rsp)
       0x00007ffff7deeaea <+90>:	movaps %xmm4,0x40(%rsp)
       0x00007ffff7deeaef <+95>:	movaps %xmm5,0x50(%rsp)
       0x00007ffff7deeaf4 <+100>:	movaps %xmm6,0x60(%rsp)
       0x00007ffff7deeaf9 <+105>:	movaps %xmm7,0x70(%rsp)
    
    	[BZ #19679]
    	* sysdeps/x86_64/dl-trampoline.S (DL_RUNIME_UNALIGNED_VEC_SIZE):
    	Renamed to ...
    	(DL_RUNTIME_UNALIGNED_VEC_SIZE): This.  Set to 8.
    	(DL_RUNIME_RESOLVE_REALIGN_STACK): Renamed to ...
    	(DL_RUNTIME_RESOLVE_REALIGN_STACK): This.  Updated.
    	(DL_RUNIME_RESOLVE_REALIGN_STACK): Renamed to ...
    	(DL_RUNTIME_RESOLVE_REALIGN_STACK): This.
    	* sysdeps/x86_64/dl-trampoline.h
    	(DL_RUNIME_RESOLVE_REALIGN_STACK): Renamed to ...
    	(DL_RUNTIME_RESOLVE_REALIGN_STACK): This.

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

Summary of changes:
 ChangeLog                      |   14 ++++++++++++++
 sysdeps/x86_64/dl-trampoline.S |   20 ++++++++++++--------
 sysdeps/x86_64/dl-trampoline.h |    6 +++---
 3 files changed, 29 insertions(+), 11 deletions(-)
Comment 7 H.J. Lu 2016-02-22 17:50:55 UTC
Fixed on master and 2.23 branch.
Comment 8 cvs-commit@gcc.gnu.org 2016-03-07 18:05:22 UTC
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, gentoo/2.23 has been updated
       via  00479c708e155b2aaace94094b5cfaccdbd9e16e (commit)
       via  f571b1c53a6c4970969ef9fdb4aad2589d0b0427 (commit)
       via  ab0e0eeb92fcd1d5901051194a01f88d339f8e73 (commit)
      from  1053a4902ebff0ba30098fdcad614d963de87c3d (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=00479c708e155b2aaace94094b5cfaccdbd9e16e

commit 00479c708e155b2aaace94094b5cfaccdbd9e16e
Author: Hongjiu Zhang <noctuorare@gmail.com>
Date:   Sun Mar 6 20:18:21 2016 -0500

    sln: use stat64
    
    When using sln on some filesystems which return 64-bit inodes,
    the stat call might fail during install like so:
    	.../elf/sln .../elf/symlink.list
    	/lib32/libc.so.6: invalid destination: Value too large for defined data type
    	/lib32/ld-linux.so.2: invalid destination: Value too large for defined data type
    	Makefile:104: recipe for target 'install-symbolic-link' failed
    
    Switch to using stat64 all the time to avoid this.
    
    URL: https://bugs.gentoo.org/576396
    (cherry picked from commit f5e753c8c3a18a1e3c715dd11bf4dc341b5c481f)
    (cherry picked from commit f23d7d2a8420a5ba2e28fc9c1d9c2b2996498d46)

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

commit f571b1c53a6c4970969ef9fdb4aad2589d0b0427
Author: Andreas Schwab <schwab@suse.de>
Date:   Tue Feb 23 16:27:56 2016 +0100

    Don't use long double math functions if NO_LONG_DOUBLE
    
    (cherry picked from commit 591b7e37e6be2a2d6672b683ba1191095b10d6d5)

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

commit ab0e0eeb92fcd1d5901051194a01f88d339f8e73
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Feb 22 09:32:57 2016 -0800

    [x86_64] Set DL_RUNTIME_UNALIGNED_VEC_SIZE to 8
    
    Due to GCC bug:
    
       https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066
    
    __tls_get_addr may be called with 8-byte stack alignment.  Although
    this bug has been fixed in GCC 4.9.4, 5.3 and 6, we can't assume
    that stack will be always aligned at 16 bytes.  Since SSE optimized
    memory/string functions with aligned SSE register load and store are
    used in the dynamic linker, we must set DL_RUNTIME_UNALIGNED_VEC_SIZE
    to 8 so that _dl_runtime_resolve_sse will align the stack before
    calling _dl_fixup:
    
    Dump of assembler code for function _dl_runtime_resolve_sse:
       0x00007ffff7deea90 <+0>:	push   %rbx
       0x00007ffff7deea91 <+1>:	mov    %rsp,%rbx
       0x00007ffff7deea94 <+4>:	and    $0xfffffffffffffff0,%rsp
                                    ^^^^^^^^^^^ Align stack to 16 bytes
       0x00007ffff7deea98 <+8>:	sub    $0x100,%rsp
       0x00007ffff7deea9f <+15>:	mov    %rax,0xc0(%rsp)
       0x00007ffff7deeaa7 <+23>:	mov    %rcx,0xc8(%rsp)
       0x00007ffff7deeaaf <+31>:	mov    %rdx,0xd0(%rsp)
       0x00007ffff7deeab7 <+39>:	mov    %rsi,0xd8(%rsp)
       0x00007ffff7deeabf <+47>:	mov    %rdi,0xe0(%rsp)
       0x00007ffff7deeac7 <+55>:	mov    %r8,0xe8(%rsp)
       0x00007ffff7deeacf <+63>:	mov    %r9,0xf0(%rsp)
       0x00007ffff7deead7 <+71>:	movaps %xmm0,(%rsp)
       0x00007ffff7deeadb <+75>:	movaps %xmm1,0x10(%rsp)
       0x00007ffff7deeae0 <+80>:	movaps %xmm2,0x20(%rsp)
       0x00007ffff7deeae5 <+85>:	movaps %xmm3,0x30(%rsp)
       0x00007ffff7deeaea <+90>:	movaps %xmm4,0x40(%rsp)
       0x00007ffff7deeaef <+95>:	movaps %xmm5,0x50(%rsp)
       0x00007ffff7deeaf4 <+100>:	movaps %xmm6,0x60(%rsp)
       0x00007ffff7deeaf9 <+105>:	movaps %xmm7,0x70(%rsp)
    
    	[BZ #19679]
    	* sysdeps/x86_64/dl-trampoline.S (DL_RUNIME_UNALIGNED_VEC_SIZE):
    	Renamed to ...
    	(DL_RUNTIME_UNALIGNED_VEC_SIZE): This.  Set to 8.
    	(DL_RUNIME_RESOLVE_REALIGN_STACK): Renamed to ...
    	(DL_RUNTIME_RESOLVE_REALIGN_STACK): This.  Updated.
    	(DL_RUNIME_RESOLVE_REALIGN_STACK): Renamed to ...
    	(DL_RUNTIME_RESOLVE_REALIGN_STACK): This.
    	* sysdeps/x86_64/dl-trampoline.h
    	(DL_RUNIME_RESOLVE_REALIGN_STACK): Renamed to ...
    	(DL_RUNTIME_RESOLVE_REALIGN_STACK): This.
    
    (cherry picked from commit 6094fc2cf7eab30889df0416a5c051a5e7171895)

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

Summary of changes:
 elf/sln.c                      |    4 ++--
 math/test-math-isinff.cc       |    7 ++++++-
 sysdeps/x86_64/dl-trampoline.S |   20 ++++++++++++--------
 sysdeps/x86_64/dl-trampoline.h |    6 +++---
 4 files changed, 23 insertions(+), 14 deletions(-)
Comment 9 cvs-commit@gcc.gnu.org 2016-04-02 00:11:06 UTC
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.22 has been created
        at  33130a3b008ba9ee9b75594abf022ee87c4e9966 (commit)

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

commit 33130a3b008ba9ee9b75594abf022ee87c4e9966
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Feb 22 09:32:57 2016 -0800

    [x86_64] Set DL_RUNTIME_UNALIGNED_VEC_SIZE to 8
    
    Due to GCC bug:
    
       https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066
    
    __tls_get_addr may be called with 8-byte stack alignment.  Although
    this bug has been fixed in GCC 4.9.4, 5.3 and 6, we can't assume
    that stack will be always aligned at 16 bytes.  Since SSE optimized
    memory/string functions with aligned SSE register load and store are
    used in the dynamic linker, we must set DL_RUNTIME_UNALIGNED_VEC_SIZE
    to 8 so that _dl_runtime_resolve_sse will align the stack before
    calling _dl_fixup:
    
    Dump of assembler code for function _dl_runtime_resolve_sse:
       0x00007ffff7deea90 <+0>:	push   %rbx
       0x00007ffff7deea91 <+1>:	mov    %rsp,%rbx
       0x00007ffff7deea94 <+4>:	and    $0xfffffffffffffff0,%rsp
                                    ^^^^^^^^^^^ Align stack to 16 bytes
       0x00007ffff7deea98 <+8>:	sub    $0x100,%rsp
       0x00007ffff7deea9f <+15>:	mov    %rax,0xc0(%rsp)
       0x00007ffff7deeaa7 <+23>:	mov    %rcx,0xc8(%rsp)
       0x00007ffff7deeaaf <+31>:	mov    %rdx,0xd0(%rsp)
       0x00007ffff7deeab7 <+39>:	mov    %rsi,0xd8(%rsp)
       0x00007ffff7deeabf <+47>:	mov    %rdi,0xe0(%rsp)
       0x00007ffff7deeac7 <+55>:	mov    %r8,0xe8(%rsp)
       0x00007ffff7deeacf <+63>:	mov    %r9,0xf0(%rsp)
       0x00007ffff7deead7 <+71>:	movaps %xmm0,(%rsp)
       0x00007ffff7deeadb <+75>:	movaps %xmm1,0x10(%rsp)
       0x00007ffff7deeae0 <+80>:	movaps %xmm2,0x20(%rsp)
       0x00007ffff7deeae5 <+85>:	movaps %xmm3,0x30(%rsp)
       0x00007ffff7deeaea <+90>:	movaps %xmm4,0x40(%rsp)
       0x00007ffff7deeaef <+95>:	movaps %xmm5,0x50(%rsp)
       0x00007ffff7deeaf4 <+100>:	movaps %xmm6,0x60(%rsp)
       0x00007ffff7deeaf9 <+105>:	movaps %xmm7,0x70(%rsp)
    
    	[BZ #19679]
    	* sysdeps/x86_64/dl-trampoline.S (DL_RUNIME_UNALIGNED_VEC_SIZE):
    	Renamed to ...
    	(DL_RUNTIME_UNALIGNED_VEC_SIZE): This.  Set to 8.
    	(DL_RUNIME_RESOLVE_REALIGN_STACK): Renamed to ...
    	(DL_RUNTIME_RESOLVE_REALIGN_STACK): This.  Updated.
    	(DL_RUNIME_RESOLVE_REALIGN_STACK): Renamed to ...
    	(DL_RUNTIME_RESOLVE_REALIGN_STACK): This.
    	* sysdeps/x86_64/dl-trampoline.h
    	(DL_RUNIME_RESOLVE_REALIGN_STACK): Renamed to ...
    	(DL_RUNTIME_RESOLVE_REALIGN_STACK): This.

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

commit f39988f5d94fe7f6ea0e5c7615a16580d0d113ec
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Oct 13 10:29:45 2015 -0700

    Support x86-64 assmebler without AVX512
    
    When x86-64 assmebler doesn't support AVX512, we should make
    _dl_runtime_resolve_avx512/_dl_runtime_profile_avx512 as aliases of
    _dl_runtime_resolve_avx/_dl_runtime_profile_avx.  Tested on x86-64
    using GCC 5.2 with binutils 20151008 and GCC 4.8 with binutils 20130219.
    There are no differences in ld.so with binutils 20151008.  There are no
    unexpected failures with binutils 20130219 and 20151008.
    
    	[BZ #19124]
    	* sysdeps/x86_64/dl-trampoline.S [!HAVE_AVX512_ASM_SUPPORT]
    	(_dl_runtime_resolve_avx512): Make it a hidden alias of
    	_dl_runtime_resolve_avx.
    	(_dl_runtime_profile_avx512): Make it a hidden alias of
    	_dl_runtime_profile_avx.

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