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


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

GNU C Library master sources branch hjl/plt/2.22 created. glibc-2.22-19-g33130a3


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 -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;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.

diff --git a/sysdeps/x86_64/dl-trampoline.S b/sysdeps/x86_64/dl-trampoline.S
index bfc27a1..1815193 100644
--- a/sysdeps/x86_64/dl-trampoline.S
+++ b/sysdeps/x86_64/dl-trampoline.S
@@ -33,15 +33,19 @@
 # define DL_STACK_ALIGNMENT 8
 #endif
 
-#ifndef DL_RUNIME_UNALIGNED_VEC_SIZE
-/* The maximum size of unaligned vector load and store.  */
-# define DL_RUNIME_UNALIGNED_VEC_SIZE 16
+#ifndef DL_RUNTIME_UNALIGNED_VEC_SIZE
+/* The maximum size in bytes of unaligned vector load and store in the
+   dynamic linker.  Since SSE optimized memory/string functions with
+   aligned SSE register load and store are used in the dynamic linker,
+   we must set this to 8 so that _dl_runtime_resolve_sse will align the
+   stack before calling _dl_fixup.  */
+# define DL_RUNTIME_UNALIGNED_VEC_SIZE 8
 #endif
 
 /* True if _dl_runtime_resolve should align stack to VEC_SIZE bytes.  */
-#define DL_RUNIME_RESOLVE_REALIGN_STACK \
+#define DL_RUNTIME_RESOLVE_REALIGN_STACK \
   (VEC_SIZE > DL_STACK_ALIGNMENT \
-   && VEC_SIZE > DL_RUNIME_UNALIGNED_VEC_SIZE)
+   && VEC_SIZE > DL_RUNTIME_UNALIGNED_VEC_SIZE)
 
 /* Align vector register save area to 16 bytes.  */
 #define REGISTER_SAVE_VEC_OFF	0
@@ -76,7 +80,7 @@
 #ifdef HAVE_AVX512_ASM_SUPPORT
 # define VEC_SIZE		64
 # define VMOVA			vmovdqa64
-# if DL_RUNIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
+# if DL_RUNTIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
 #  define VMOV			vmovdqa64
 # else
 #  define VMOV			vmovdqu64
@@ -100,7 +104,7 @@ strong_alias (_dl_runtime_profile_avx, _dl_runtime_profile_avx512)
 
 #define VEC_SIZE		32
 #define VMOVA			vmovdqa
-#if DL_RUNIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
+#if DL_RUNTIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
 # define VMOV			vmovdqa
 #else
 # define VMOV			vmovdqu
@@ -119,7 +123,7 @@ strong_alias (_dl_runtime_profile_avx, _dl_runtime_profile_avx512)
 /* movaps/movups is 1-byte shorter.  */
 #define VEC_SIZE		16
 #define VMOVA			movaps
-#if DL_RUNIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
+#if DL_RUNTIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
 # define VMOV			movaps
 #else
 # define VMOV			movups
diff --git a/sysdeps/x86_64/dl-trampoline.h b/sysdeps/x86_64/dl-trampoline.h
index dd6d7c7..fda28a2 100644
--- a/sysdeps/x86_64/dl-trampoline.h
+++ b/sysdeps/x86_64/dl-trampoline.h
@@ -30,7 +30,7 @@
 #undef REGISTER_SAVE_AREA
 #undef LOCAL_STORAGE_AREA
 #undef BASE
-#if DL_RUNIME_RESOLVE_REALIGN_STACK
+#if DL_RUNTIME_RESOLVE_REALIGN_STACK
 # define REGISTER_SAVE_AREA	(REGISTER_SAVE_AREA_RAW + 8)
 /* Local stack area before jumping to function address: RBX.  */
 # define LOCAL_STORAGE_AREA	8
@@ -57,7 +57,7 @@
 	cfi_startproc
 _dl_runtime_resolve:
 	cfi_adjust_cfa_offset(16) # Incorporate PLT
-#if DL_RUNIME_RESOLVE_REALIGN_STACK
+#if DL_RUNTIME_RESOLVE_REALIGN_STACK
 # if LOCAL_STORAGE_AREA != 8
 #  error LOCAL_STORAGE_AREA must be 8
 # endif
@@ -146,7 +146,7 @@ _dl_runtime_resolve:
 	VMOV (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 5)(%rsp), %VEC(5)
 	VMOV (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 6)(%rsp), %VEC(6)
 	VMOV (REGISTER_SAVE_VEC_OFF + VEC_SIZE * 7)(%rsp), %VEC(7)
-#if DL_RUNIME_RESOLVE_REALIGN_STACK
+#if DL_RUNTIME_RESOLVE_REALIGN_STACK
 	mov %RBX_LP, %RSP_LP
 	cfi_def_cfa_register(%rsp)
 	movq (%rsp), %rbx

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;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.

diff --git a/sysdeps/x86_64/dl-trampoline.S b/sysdeps/x86_64/dl-trampoline.S
index 8475d26..bfc27a1 100644
--- a/sysdeps/x86_64/dl-trampoline.S
+++ b/sysdeps/x86_64/dl-trampoline.S
@@ -71,24 +71,32 @@
 #define REGISTER_SAVE_R8	(REGISTER_SAVE_RDI + 8)
 #define REGISTER_SAVE_R9	(REGISTER_SAVE_R8 + 8)
 
-#define VEC_SIZE		64
-#define VMOVA			vmovdqa64
-#if DL_RUNIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
-# define VMOV			vmovdqa64
+#define RESTORE_AVX
+
+#ifdef HAVE_AVX512_ASM_SUPPORT
+# define VEC_SIZE		64
+# define VMOVA			vmovdqa64
+# if DL_RUNIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
+#  define VMOV			vmovdqa64
+# else
+#  define VMOV			vmovdqu64
+# endif
+# define VEC(i)			zmm##i
+# define _dl_runtime_resolve	_dl_runtime_resolve_avx512
+# define _dl_runtime_profile	_dl_runtime_profile_avx512
+# include "dl-trampoline.h"
+# undef _dl_runtime_resolve
+# undef _dl_runtime_profile
+# undef VEC
+# undef VMOV
+# undef VMOVA
+# undef VEC_SIZE
 #else
-# define VMOV			vmovdqu64
+strong_alias (_dl_runtime_resolve_avx, _dl_runtime_resolve_avx512)
+	.hidden _dl_runtime_resolve_avx512
+strong_alias (_dl_runtime_profile_avx, _dl_runtime_profile_avx512)
+	.hidden _dl_runtime_profile_avx512
 #endif
-#define VEC(i)			zmm##i
-#define _dl_runtime_resolve	_dl_runtime_resolve_avx512
-#define _dl_runtime_profile	_dl_runtime_profile_avx512
-#define RESTORE_AVX
-#include "dl-trampoline.h"
-#undef _dl_runtime_resolve
-#undef _dl_runtime_profile
-#undef VEC
-#undef VMOV
-#undef VMOVA
-#undef VEC_SIZE
 
 #define VEC_SIZE		32
 #define VMOVA			vmovdqa

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


hooks/post-receive
-- 
GNU C Library master sources


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