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