[glibc] Fix indirect function support to avoid calling optimized routines for the wrong hardware (#985342).

Carlos O'Donell codonell at fedoraproject.org
Wed Aug 28 04:35:42 UTC 2013


commit b8280fad3dff1766f9b87d38acefdfdb7ba61c09
Author: Carlos O'Donell <carlos at redhat.com>
Date:   Wed Aug 28 00:34:43 2013 -0400

    Fix indirect function support to avoid calling optimized routines
    for the wrong hardware (#985342).

 glibc-rh985342.patch |   23 +++++++++++++++++++++++
 glibc.spec           |   11 ++++++++++-
 2 files changed, 33 insertions(+), 1 deletions(-)
---
diff --git a/glibc-rh985342.patch b/glibc-rh985342.patch
new file mode 100644
index 0000000..ce2463b
--- /dev/null
+++ b/glibc-rh985342.patch
@@ -0,0 +1,23 @@
+#
+# Posted upstream:
+# http://sourceware.org/ml/libc-ports/2013-08/msg00053.html
+#
+# 2013-08-28  Kyle McMartin  <kyle at redhat.com>
+#	    Carlos O'Donell  <carlos at redhat.com>
+#
+#	* sysdeps/arm/dl-machine [!RTLD_BOOTSTRAP] (elf_machine_rel):
+#	Pass GLRO(dl_hwcap) to the IFUNC resolver.
+#
+diff --git a/ports/sysdeps/arm/dl-machine.h b/ports/sysdeps/arm/dl-machine.h
+index d251527..85dba67 100644
+--- a/ports/sysdeps/arm/dl-machine.h
++++ b/ports/sysdeps/arm/dl-machine.h
+@@ -503,7 +503,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
+ 	  break;
+ 	case R_ARM_IRELATIVE:
+ 	  value = map->l_addr + *reloc_addr;
+-	  value = ((Elf32_Addr (*) (void)) value) ();
++	  value = ((Elf32_Addr (*) (int)) value) (GLRO(dl_hwcap));
+ 	  *reloc_addr = value;
+ 	  break;
+ #endif
diff --git a/glibc.spec b/glibc.spec
index 2b234f7..68ee4e6 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -1,6 +1,6 @@
 %define glibcsrcdir glibc-2.18
 %define glibcversion 2.18
-%define glibcrelease 4%{?dist}
+%define glibcrelease 5%{?dist}
 # Pre-release tarballs are pulled in from git using a command that is
 # effectively:
 #
@@ -217,6 +217,10 @@ Patch2028: %{name}-strcoll-cve.patch
 
 # Initialize res_hconf in nscd
 Patch2029: %{name}-rh1000924.patch
+
+# Pass dl_hwcap to IFUNC resolver on 32-bit ARM.
+Patch2030: %{name}-rh985342.patch
+
 ##############################################################################
 # End of glibc patches.
 ##############################################################################
@@ -538,6 +542,7 @@ package or when debugging this package.
 %patch0041 -p1
 %patch0042 -p1
 %patch2029 -p1
+%patch2030 -p1
 
 ##############################################################################
 # %%prep - Additional prep required...
@@ -1623,6 +1628,10 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Wed Aug 28 2013 Carlos O'Donell <carlos at redhat.com> - 2.18-5
+- Fix indirect function support to avoid calling optimized routines
+  for the wrong hardware (#985342).
+
 * Mon Aug 26 2013 Siddhesh Poyarekar <siddhesh at redhat.com> - 2.18-4
 - Initialize res_hconf in nscd. (#1000924).
 


More information about the scm-commits mailing list