]> git.pld-linux.org Git - packages/glibc.git/blob - 0060_all_glibc-2.13-static-memmove-ssse3.patch
42c9c871a975e3bd90066c2cbb991bb44d0af0cf
[packages/glibc.git] / 0060_all_glibc-2.13-static-memmove-ssse3.patch
1 http://bugs.gentoo.org/353816
2 http://sourceware.org/ml/libc-alpha/2011-02/msg00015.html
3
4 From 7da767805f0a7301c0c719a6c0fd51d87e193c22 Mon Sep 17 00:00:00 2001
5 From: Mike Frysinger <vapier@gentoo.org>
6 Date: Sun, 6 Feb 2011 12:39:08 -0500
7 Subject: [PATCH] memcpy-ssse3: enable chk symbols in static builds
8
9 Building static apps on i686/x86_64 systems which use memmove such as:
10         #include <string.h>
11         char buf[8192];
12         main(int argc, char **argv) { memmove(buf, buf + argc, argc % 4); }
13
14 Result in linking errors along the lines of:
15         .../libc.a(memmove_chk.o): In function `__memmove_chk':
16         (.text+0x1b4): undefined reference to `__memmove_chk_ssse3_back'
17         .../libc.a(memmove_chk.o): In function `__memmove_chk':
18         (.text+0x1b9): undefined reference to `__memmove_chk_ssse3'
19         collect2: ld returned 1 exit status
20
21 This is due to the new ssse3 funcs only enabling their chk symbols when
22 being compiled into shared code.
23
24 URL: https://bugs.gentoo.org/353816
25 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
26
27 2011-02-06  Mike Frysinger  <vapier@gentoo.org>
28
29         * sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S: Only protect
30         MEMCPY_CHK with USE_AS_BCOPY ifdef check.
31         * sysdeps/i386/i686/multiarch/memcpy-ssse3.S: Likewise.
32         * sysdeps/x86_64/multiarch/memcpy-ssse3.S: Likewise.
33         * sysdeps/x86_64/multiarch/memcpy-ssse3-back.S: Likewise.
34 ---
35  sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S |    2 +-
36  sysdeps/i386/i686/multiarch/memcpy-ssse3.S     |    2 +-
37  sysdeps/x86_64/multiarch/memcpy-ssse3-back.S   |    2 +-
38  sysdeps/x86_64/multiarch/memcpy-ssse3.S        |    2 +-
39  4 files changed, 4 insertions(+), 4 deletions(-)
40
41 diff --git a/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S b/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
42 index 48a109c..8e81183 100644
43 --- a/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
44 +++ b/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
45 @@ -110,7 +110,7 @@ __i686.get_pc_thunk.bx:
46  #endif
47  
48         .section .text.ssse3,"ax",@progbits
49 -#if defined SHARED && !defined NOT_IN_libc && !defined USE_AS_BCOPY
50 +#if !defined USE_AS_BCOPY
51  ENTRY (MEMCPY_CHK)
52         movl    12(%esp), %eax
53         cmpl    %eax, 16(%esp)
54 diff --git a/sysdeps/i386/i686/multiarch/memcpy-ssse3.S b/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
55 index ec9eeb9..f64f8d2 100644
56 --- a/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
57 +++ b/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
58 @@ -110,7 +110,7 @@ __i686.get_pc_thunk.bx:
59  #endif
60  
61         .section .text.ssse3,"ax",@progbits
62 -#if defined SHARED && !defined NOT_IN_libc && !defined USE_AS_BCOPY
63 +#if !defined USE_AS_BCOPY
64  ENTRY (MEMCPY_CHK)
65         movl    12(%esp), %eax
66         cmpl    %eax, 16(%esp)
67 diff --git a/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S b/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
68 index 48c974e..bdd114a 100644
69 --- a/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
70 +++ b/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S
71 @@ -49,7 +49,7 @@
72    ud2
73  
74         .section .text.ssse3,"ax",@progbits
75 -#if defined SHARED && !defined NOT_IN_libc
76 +#if !defined USE_AS_BCOPY
77  ENTRY (MEMCPY_CHK)
78         cmpq    %rdx, %rcx
79         jb      HIDDEN_JUMPTARGET (__chk_fail)
80 diff --git a/sysdeps/x86_64/multiarch/memcpy-ssse3.S b/sysdeps/x86_64/multiarch/memcpy-ssse3.S
81 index 9a878d3..cd7e45f 100644
82 --- a/sysdeps/x86_64/multiarch/memcpy-ssse3.S
83 +++ b/sysdeps/x86_64/multiarch/memcpy-ssse3.S
84 @@ -49,7 +49,7 @@
85    ud2
86  
87         .section .text.ssse3,"ax",@progbits
88 -#if defined SHARED && !defined NOT_IN_libc
89 +#if !defined USE_AS_BCOPY
90  ENTRY (MEMCPY_CHK)
91         cmpq    %rdx, %rcx
92         jb      HIDDEN_JUMPTARGET (__chk_fail)
93 -- 
94 1.7.4.rc2
95
This page took 0.032796 seconds and 2 git commands to generate.