]> sourceware.org Git - glibc.git/commitdiff
Avoid DWARF definition DIE on ifunc symbols
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 9 Aug 2012 23:04:37 +0000 (16:04 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 9 Aug 2012 23:04:37 +0000 (16:04 -0700)
ChangeLog
NEWS
sysdeps/i386/i686/multiarch/strstr-c.c
sysdeps/unix/sysv/linux/x86_64/time.c
sysdeps/x86_64/multiarch/memmove.c
sysdeps/x86_64/multiarch/strstr-c.c

index 0a5d89f10cc321563af0ba016a37c54c4d8531cb..2fb941b48b17859ef6cb2cce88a2aaabc05e05e2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2012-08-09  H.J. Lu  <hongjiu.lu@intel.com>
+
+       [BZ #14166]
+       * sysdeps/i386/i686/multiarch/strstr-c.c (strstr): Redefined
+       to __redirect_strstr.
+       (__strstr_sse42): Use typeof __redirect_strstr.
+       (__strstr_ia32): Likewise.
+       (__libc_strstr): New prototype.
+       (strstr): Renamed to ...
+       (__libc_strstr): This.
+       (strstr): New strong alias of __libc_strstr.
+       * sysdeps/x86_64/multiarch/strstr-c.c: Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/time.c (time): Redefined to
+       __redirect_time.
+       Include <time.h>.
+       (__libc_time): New prototype.
+       (time_ifunc): Replace time with __libc_time.
+       (time): New strong alias and hidden definition of __libc_time.
+       (__GI_time): Remove strong alias.
+       * sysdeps/x86_64/multiarch/memmove.c: Don't include <string.h>.
+       Include <stddef.h>.
+       (memmove): Redefined to __redirect_memmove.
+       (__memmove_sse2): Use typeof __redirect_memmove.
+       (__memmove_ssse3): Likewise.
+       (__memmove_ssse3_back): Likewise.
+       (__libc_memmove): New prototype.
+       (memmove): Renamed to ...
+       (__libc_memmove): This.
+       (memmove): New strong alias of __libc_memmove.
+
 2012-08-08  Mark Salter  <msalter@redhat.com>
 
        * elf/elf.h
diff --git a/NEWS b/NEWS
index 314f4d4fec39d0247295967d531c1fed991fe64c..eae9834e04cfacac3208450b8fca55e27488265d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,8 +9,8 @@ Version 2.17
 
 * The following bugs are resolved with this release:
 
-  6778, 6808, 13717, 14042, 14150, 14151, 14154, 14157, 14173, 14283, 14298,
-  14307, 14328, 14331, 14336, 14337, 14347, 14349
+  6778, 6808, 13717, 14042, 14166, 14150, 14151, 14154, 14157, 14173, 14283,
+  14298, 14307, 14328, 14331, 14336, 14337, 14347, 14349
 
 * Support for STT_GNU_IFUNC symbols added for s390 and s390x.
   Optimized versions of memcpy, memset, and memcmp added for System z10 and
index 1fcb00edacfa5da920ddcdf5ce7de613603cc54c..17c75c5f0b745296c11026ccbe84ed15faaf8246 100644 (file)
@@ -7,9 +7,20 @@
   __hidden_ver1 (__strstr_ia32, __GI_strstr, __strstr_ia32);
 #endif
 
+/* Redefine strstr so that the compiler won't complain about the type
+   mismatch with the IFUNC selector in strong_alias, below.  */
+#undef strstr
+#define strstr __redirect_strstr
+
 #include "string/strstr.c"
 
-extern char *__strstr_sse42 (const char *, const char *) attribute_hidden;
-extern __typeof (__strstr_ia32) __strstr_ia32 attribute_hidden;
+extern __typeof (__redirect_strstr) __strstr_sse42 attribute_hidden;
+extern __typeof (__redirect_strstr) __strstr_ia32 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+   ifunc symbol properly.  */
+extern __typeof (__redirect_strstr) __libc_strstr;
+libc_ifunc (__libc_strstr, HAS_SSE4_2 ? __strstr_sse42 : __strstr_ia32)
 
-libc_ifunc (strstr, HAS_SSE4_2 ? __strstr_sse42 : __strstr_ia32);
+#undef strstr
+strong_alias (__libc_strstr, strstr)
index 0e05ddd523d8d8fcc754f42a122b937a8316977c..65703cab90cfa435ecd6b673a0bd2bc44e062a3c 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #ifdef SHARED
+/* Redefine time so that the compiler won't complain about the type
+   mismatch with the IFUNC selector in strong_alias, below.  */
+#undef time
+#define time __redirect_time
+#include <time.h>
+
 #include <dl-vdso.h>
 
 #define VSYSCALL_ADDR_vtime    0xffffffffff600400
 
-void *time_ifunc (void) __asm__ ("time");
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+   ifunc symbol properly.  */
+extern __typeof (__redirect_time) __libc_time;
+void *time_ifunc (void) __asm__ ("__libc_time");
 
 void *
 time_ifunc (void)
@@ -30,7 +39,11 @@ time_ifunc (void)
   /* If the vDSO is not available we fall back on the old vsyscall.  */
   return _dl_vdso_vsym ("__vdso_time", &linux26) ?: (void *) VSYSCALL_ADDR_vtime;
 }
-__asm (".type time, %gnu_indirect_function");
+__asm (".type __libc_time, %gnu_indirect_function");
+
+#undef time
+strong_alias (__libc_time, time)
+libc_hidden_ver (__libc_time, time)
 
 #else
 
@@ -45,5 +58,3 @@ time (time_t *t)
 }
 
 #endif
-
-strong_alias (time, __GI_time)
index ca16263a17cc88f063f8913a333d4f176e2f404c..6e91025eb6f3492e85300d691bbba9c5170505aa 100644 (file)
@@ -17,7 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <string.h>
+#include <stddef.h>
 
 #ifndef NOT_IN_libc
 #include <shlib-compat.h>
 # define libc_hidden_builtin_def(name) \
   __hidden_ver1 (__memmove_sse2, __GI_memmove, __memmove_sse2);
 #endif
-#endif
 
-extern __typeof (memmove) __memmove_sse2 attribute_hidden;
-extern __typeof (memmove) __memmove_ssse3 attribute_hidden;
-extern __typeof (memmove) __memmove_ssse3_back attribute_hidden;
+/* Redefine memmove so that the compiler won't complain about the type
+   mismatch with the IFUNC selector in strong_alias, below.  */
+#undef memmove
+#define memmove __redirect_memmove
+#endif
 
 #include "string/memmove.c"
 
 #ifndef NOT_IN_libc
-libc_ifunc (memmove,
+extern __typeof (__redirect_memmove) __memmove_sse2 attribute_hidden;
+extern __typeof (__redirect_memmove) __memmove_ssse3 attribute_hidden;
+extern __typeof (__redirect_memmove) __memmove_ssse3_back attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+   ifunc symbol properly.  */
+extern __typeof (__redirect_memmove) __libc_memmove;
+libc_ifunc (__libc_memmove,
            HAS_SSSE3
            ? (HAS_FAST_COPY_BACKWARD
               ? __memmove_ssse3_back : __memmove_ssse3)
-           : __memmove_sse2);
+           : __memmove_sse2)
+
+#undef memmove
+strong_alias (__libc_memmove, memmove)
 
 #if SHLIB_COMPAT (libc, GLIBC_2_2_5, GLIBC_2_14)
 compat_symbol (libc, memmove, memcpy, GLIBC_2_2_5);
index b8ed3161d5376bc7ed4b1a1e0763132211d0361a..795789e7049196c27a7b6edcca94eece20ba0c73 100644 (file)
@@ -7,9 +7,20 @@
   __hidden_ver1 (__strstr_sse2, __GI_strstr, __strstr_sse2);
 #endif
 
+/* Redefine strstr so that the compiler won't complain about the type
+   mismatch with the IFUNC selector in strong_alias, below.  */
+#undef strstr
+#define strstr __redirect_strstr
+
 #include "string/strstr.c"
 
-extern char *__strstr_sse42 (const char *, const char *) attribute_hidden;
-extern __typeof (__strstr_sse2) __strstr_sse2 attribute_hidden;
+extern __typeof (__redirect_strstr) __strstr_sse42 attribute_hidden;
+extern __typeof (__redirect_strstr) __strstr_sse2 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+   ifunc symbol properly.  */
+extern __typeof (__redirect_strstr) __libc_strstr;
+libc_ifunc (__libc_strstr, HAS_SSE4_2 ? __strstr_sse42 : __strstr_sse2)
 
-libc_ifunc (strstr, HAS_SSE4_2 ? __strstr_sse42 : __strstr_sse2);
+#undef strstr
+strong_alias (__libc_strstr, strstr)
This page took 0.122208 seconds and 5 git commands to generate.