This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch hjl/pr14955 created. glibc-2.16-ports-merge-870-g24fc1b5


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  24fc1b598384b280ba8ad9d0402a7ddaf4e37cad (commit)

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=24fc1b598384b280ba8ad9d0402a7ddaf4e37cad

commit 24fc1b598384b280ba8ad9d0402a7ddaf4e37cad
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..045c59f
--- /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..4cb6681
--- /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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]