This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch hjl/pr14955 created. glibc-2.16-ports-merge-875-g214f486
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 14 Dec 2012 00:02:16 -0000
- Subject: GNU C Library master sources branch hjl/pr14955 created. glibc-2.16-ports-merge-875-g214f486
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/pr14955 has been created
at 214f486ad49a2220e44b7dff79d14ce73f55c31e (commit)
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=214f486ad49a2220e44b7dff79d14ce73f55c31e
commit 214f486ad49a2220e44b7dff79d14ce73f55c31e
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Dec 13 15:29:35 2012 -0800
Make __get_cpu_features hidden
diff --git a/ChangeLog.bz14955 b/ChangeLog.bz14955
index 4d75481..b833363 100644
--- a/ChangeLog.bz14955
+++ b/ChangeLog.bz14955
@@ -1,9 +1,31 @@
2012-12-13 H.J. Lu <hongjiu.lu@intel.com>
[BZ #14955]
+ * sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines):
+ Add init-arch.
+ * sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
+ Likewise.
+ * sysdeps/i386/i686/multiarch/Makefile (CPPFLAGS-init-arch.c): New
+ macro. Defined to -Din_init_arch_c.
+ ($(objpfx)test-multiarch): New dependency.
+ * sysdeps/wordsize-32/symbol-hacks.h: Skip if in_init_arch_c is
+ defined.
+ * sysdeps/x86_64/multiarch/init-arch.c (__get_cpu_features): Use
+ INIT_ARCH.
+ * sysdeps/x86_64/multiarch/init-arch.h (__get_cpu_features): Mark
+ it hidden.
+ * sysdeps/x86_64/multiarch/Makefile ($(objpfx)test-multiarch): New
+ dependency.
+ * sysdeps/i386/i686/multiarch/Versions: Removed.
+ * sysdeps/x86_64/multiarch/Versions: Likewise.
+
+2012-12-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #14955]
* sysdeps/x86/Makefile (tests): Add tst-ifunc-cpu1-main.
(modules-names): Add tst-ifunc-cpu1-mod.
(tst-ifunc-cpu1-mod.so-no-z-defs): New macro.
- ($(objpfx)tst-ifunc-cpu1-main): New dependency.
+ ($(objpfx)tst-ifunc-cpu1-mod.so): New dependency.
+ ($(objpfx)tst-ifunc-cpu1-main): Likewise.
* sysdeps/x86/tst-ifunc-cpu1-main.c: New file.
* sysdeps/x86/tst-ifunc-cpu1-mod.c: Likewise.
diff --git a/sysdeps/i386/i686/fpu/multiarch/Makefile b/sysdeps/i386/i686/fpu/multiarch/Makefile
index 7d90892..92ecb04 100644
--- a/sysdeps/i386/i686/fpu/multiarch/Makefile
+++ b/sysdeps/i386/i686/fpu/multiarch/Makefile
@@ -1,4 +1,5 @@
ifeq ($(subdir),math)
+libm-sysdep_routines += init-arch
libm-sysdep_routines += e_expf-sse2 e_expf-ia32 s_sinf-sse2 s_cosf-sse2 \
s_sincosf-sse2
endif
diff --git a/sysdeps/i386/i686/multiarch/Makefile b/sysdeps/i386/i686/multiarch/Makefile
index 8946bfa..7126e23 100644
--- a/sysdeps/i386/i686/multiarch/Makefile
+++ b/sysdeps/i386/i686/multiarch/Makefile
@@ -1,7 +1,10 @@
ifeq ($(subdir),csu)
aux += init-arch
+CPPFLAGS-init-arch.c = -Din_init_arch_c
tests += test-multiarch
gen-as-const-headers += ifunc-defines.sym
+
+$(objpfx)test-multiarch: $(common-objpfx)csu/init-arch.os
endif
ifeq ($(subdir),string)
diff --git a/sysdeps/i386/i686/multiarch/Versions b/sysdeps/i386/i686/multiarch/Versions
deleted file mode 100644
index 59b185a..0000000
--- a/sysdeps/i386/i686/multiarch/Versions
+++ /dev/null
@@ -1,5 +0,0 @@
-libc {
- GLIBC_PRIVATE {
- __get_cpu_features;
- }
-}
diff --git a/sysdeps/wordsize-32/symbol-hacks.h b/sysdeps/wordsize-32/symbol-hacks.h
index 52a14fc..9814486 100644
--- a/sysdeps/wordsize-32/symbol-hacks.h
+++ b/sysdeps/wordsize-32/symbol-hacks.h
@@ -1,5 +1,5 @@
/* Hacks needed for symbol manipulation.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,7 +21,8 @@
therefore we get PLTs. Unnecessarily so. Changing gcc is a big
task which might not be worth it so we play tricks with the
assembler. */
-#if !defined __ASSEMBLER__ && !defined in_divdi3_c && !defined NOT_IN_libc && defined SHARED
+#if !defined __ASSEMBLER__ && !defined in_divdi3_c \
+ && !defined in_init_arch_c && !defined NOT_IN_libc && defined SHARED
asm ("__divdi3 = __divdi3_internal");
asm ("__udivdi3 = __udivdi3_internal");
asm ("__moddi3 = __moddi3_internal");
diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile
index 79a4406..e722a34 100644
--- a/sysdeps/x86/Makefile
+++ b/sysdeps/x86/Makefile
@@ -13,6 +13,7 @@ modules-names += tst-ifunc-cpu1-mod
tst-ifunc-cpu1-mod.so-no-z-defs = yes
+$(objpfx)tst-ifunc-cpu1-mod.so: $(common-objpfx)csu/init-arch.os
$(objpfx)tst-ifunc-cpu1-main: $(objpfx)tst-ifunc-cpu1-mod.so
endif
endif
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index 12b0526..2cf07bf 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -1,4 +1,5 @@
ifeq ($(subdir),math)
+libm-sysdep_routines += init-arch
libm-sysdep_routines += s_floor-c s_ceil-c s_floorf-c s_ceilf-c \
s_rint-c s_rintf-c s_nearbyint-c s_nearbyintf-c
diff --git a/sysdeps/x86_64/multiarch/Makefile b/sysdeps/x86_64/multiarch/Makefile
index dd6c27d..948f32f 100644
--- a/sysdeps/x86_64/multiarch/Makefile
+++ b/sysdeps/x86_64/multiarch/Makefile
@@ -2,6 +2,8 @@ ifeq ($(subdir),csu)
aux += init-arch
tests += test-multiarch
gen-as-const-headers += ifunc-defines.sym
+
+$(objpfx)test-multiarch: $(common-objpfx)csu/init-arch.os
endif
ifeq ($(subdir),string)
diff --git a/sysdeps/x86_64/multiarch/Versions b/sysdeps/x86_64/multiarch/Versions
deleted file mode 100644
index 59b185a..0000000
--- a/sysdeps/x86_64/multiarch/Versions
+++ /dev/null
@@ -1,5 +0,0 @@
-libc {
- GLIBC_PRIVATE {
- __get_cpu_features;
- }
-}
diff --git a/sysdeps/x86_64/multiarch/init-arch.c b/sysdeps/x86_64/multiarch/init-arch.c
index fed5ab8..71a862c 100644
--- a/sysdeps/x86_64/multiarch/init-arch.c
+++ b/sysdeps/x86_64/multiarch/init-arch.c
@@ -176,8 +176,6 @@ __init_cpu_features (void)
const struct cpu_features *
__get_cpu_features (void)
{
- if (__cpu_features.kind == arch_kind_unknown)
- __init_cpu_features ();
-
+ INIT_ARCH ();
return &__cpu_features;
}
diff --git a/sysdeps/x86_64/multiarch/init-arch.h b/sysdeps/x86_64/multiarch/init-arch.h
index f33f1c8..79ff1fe 100644
--- a/sysdeps/x86_64/multiarch/init-arch.h
+++ b/sysdeps/x86_64/multiarch/init-arch.h
@@ -109,9 +109,10 @@ extern void __init_cpu_features (void) attribute_hidden;
__init_cpu_features (); \
while (0)
-/* Used from outside libc.so to get access to the CPU features structure. */
+/* Implicitly call __init_cpu_features before accessing the CPU features
+ structure. */
extern const struct cpu_features *__get_cpu_features (void)
- __attribute__ ((const));
+ __attribute__ ((const)) attribute_hidden;
# ifndef NOT_IN_libc
# define __get_cpu_features() (&__cpu_features)
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=fb9b2bc83ff025c21200026db19cf96904fbfe54
commit fb9b2bc83ff025c21200026db19cf96904fbfe54
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Dec 13 14:03:46 2012 -0800
Add a testcase for BZ 14955
diff --git a/ChangeLog.bz14955 b/ChangeLog.bz14955
new file mode 100644
index 0000000..4d75481
--- /dev/null
+++ b/ChangeLog.bz14955
@@ -0,0 +1,9 @@
+2012-12-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #14955]
+ * sysdeps/x86/Makefile (tests): Add tst-ifunc-cpu1-main.
+ (modules-names): Add tst-ifunc-cpu1-mod.
+ (tst-ifunc-cpu1-mod.so-no-z-defs): New macro.
+ ($(objpfx)tst-ifunc-cpu1-main): New dependency.
+ * sysdeps/x86/tst-ifunc-cpu1-main.c: New file.
+ * sysdeps/x86/tst-ifunc-cpu1-mod.c: Likewise.
diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile
index 3e87a77..79a4406 100644
--- a/sysdeps/x86/Makefile
+++ b/sysdeps/x86/Makefile
@@ -6,4 +6,13 @@ tests: $(objpfx)tst-xmmymm.out
$(objpfx)tst-xmmymm.out: ../sysdeps/x86/tst-xmmymm.sh $(objpfx)ld.so
@echo "Checking ld.so for SSE register use. This will take a few seconds..."
$(SHELL) $< $(objpfx) '$(NM)' '$(OBJDUMP)' '$(READELF)' > $@
+
+ifeq (yesyes,$(build-shared)$(multi-arch))
+tests += tst-ifunc-cpu1-main
+modules-names += tst-ifunc-cpu1-mod
+
+tst-ifunc-cpu1-mod.so-no-z-defs = yes
+
+$(objpfx)tst-ifunc-cpu1-main: $(objpfx)tst-ifunc-cpu1-mod.so
+endif
endif
diff --git a/sysdeps/x86/tst-ifunc-cpu1-main.c b/sysdeps/x86/tst-ifunc-cpu1-main.c
new file mode 100644
index 0000000..37c16e2
--- /dev/null
+++ b/sysdeps/x86/tst-ifunc-cpu1-main.c
@@ -0,0 +1,10 @@
+/* Test function pointer to local STT_GNU_IFUNC function. */
+
+extern void (*foo_ptr) (void);
+
+int
+main (void)
+{
+ foo_ptr ();
+ return 0;
+}
diff --git a/sysdeps/x86/tst-ifunc-cpu1-mod.c b/sysdeps/x86/tst-ifunc-cpu1-mod.c
new file mode 100644
index 0000000..08ff30f
--- /dev/null
+++ b/sysdeps/x86/tst-ifunc-cpu1-mod.c
@@ -0,0 +1,24 @@
+#include <init-arch.h>
+
+static void
+one (void)
+{
+}
+
+static void
+two (void)
+{
+}
+
+void * foo_ifunc (void) __asm__ ("foo") attribute_hidden;
+__asm__(".type foo, %gnu_indirect_function");
+
+void *
+foo_ifunc (void)
+{
+ const struct cpu_features * cpu = __get_cpu_features ();
+ return cpu->max_cpuid > 1 ? two : one;
+}
+
+extern void foo (void) attribute_hidden;
+void (*foo_ptr) (void) = foo;
-----------------------------------------------------------------------
hooks/post-receive
--
GNU C Library master sources