bca718
On top of this patch we include a few more redirecting versions of
bca718
the rtld-* routines in multiarch, this is needed because of the
bca718
sysd-rules which try to build from multiarch first and will even
bca718
use memset.S from multiarch to buidl rtld-memset.os, which results
bca718
in SSE register usage in rtld which we can't allow because of
bca718
lazy binding (though in some cases we use RTLD_PREPARE_FOREIGN_CALL
bca718
and others to wrap such calls).
bca718
bca718
commit 747ef469ffc9c9179ca9d76854167925b4e44346
bca718
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
bca718
Date:   Sat Jun 15 00:09:26 2013 +0530
bca718
bca718
    Add rtld-memset.S for x86_64
bca718
    
bca718
    Resolves: BZ #15627
bca718
    
bca718
    Add an assembler version of rtld-memset to avoid using SSE registers.
bca718
bca718
Index: glibc-2.17-c758a686/sysdeps/x86_64/rtld-memset.S
bca718
===================================================================
bca718
--- /dev/null
bca718
+++ glibc-2.17-c758a686/sysdeps/x86_64/rtld-memset.S
bca718
@@ -0,0 +1,37 @@
bca718
+/* memset implementation for the dynamic linker.  This is separate from the
bca718
+   libc implementation to avoid writing to SSE registers.
bca718
+   Copyright (C) 2013 Free Software Foundation, Inc.
bca718
+   This file is part of the GNU C Library.
bca718
+
bca718
+   The GNU C Library is free software; you can redistribute it and/or
bca718
+   modify it under the terms of the GNU Lesser General Public
bca718
+   License as published by the Free Software Foundation; either
bca718
+   version 2.1 of the License, or (at your option) any later version.
bca718
+
bca718
+   The GNU C Library is distributed in the hope that it will be useful,
bca718
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
bca718
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
bca718
+   Lesser General Public License for more details.
bca718
+
bca718
+   You should have received a copy of the GNU Lesser General Public
bca718
+   License along with the GNU C Library; if not, see
bca718
+   <http://www.gnu.org/licenses/>.  */
bca718
+
bca718
+#include <sysdep.h>
bca718
+#include "asm-syntax.h"
bca718
+
bca718
+
bca718
+	.text
bca718
+/* void *memset (void *dest, char c, size_t count)
bca718
+   dest	 => %rdi
bca718
+   c	 => %rsi
bca718
+   count => %rdx  */
bca718
+ENTRY (memset)
bca718
+	mov	%rdx, %rcx
bca718
+	movzbl	%sil, %eax
bca718
+	mov	%rdi, %rdx
bca718
+	rep	stosb
bca718
+	mov	%rdx, %rax
bca718
+	ret
bca718
+END (memset)
bca718
+libc_hidden_builtin_def (memset)
bca718
Index: glibc-2.17-c758a686/sysdeps/x86_64/rtld-memset.c
bca718
===================================================================
bca718
--- glibc-2.17-c758a686.orig/sysdeps/x86_64/rtld-memset.c
bca718
+++ /dev/null
bca718
@@ -1 +0,0 @@
bca718
-#include <string/memset.c>
bca718
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/rtld-memset.S
bca718
===================================================================
bca718
--- /dev/null
bca718
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/rtld-memset.S
bca718
@@ -0,0 +1 @@
bca718
+#include "../rtld-memset.S"
bca718
Index: glibc-2.17-c758a686/sysdeps/x86_64/multiarch/rtld-strchr.S
bca718
===================================================================
bca718
--- /dev/null
bca718
+++ glibc-2.17-c758a686/sysdeps/x86_64/multiarch/rtld-strchr.S
bca718
@@ -0,0 +1 @@
bca718
+#include "../rtld-strchr.S"