add patch for tls reloc

This commit is contained in:
Dennis Gilmore 2010-03-09 15:37:32 +00:00
parent 29880e399c
commit 16d03f3a7e
2 changed files with 43 additions and 1 deletions

36
glibc-sparc64-reloc.patch Normal file
View File

@ -0,0 +1,36 @@
@@ -, +, @@
ChangeLog | 6 ++++++
sysdeps/sparc/sparc64/dl-machine.h | 10 ++++++----
2 files changed, 12 insertions(+), 4 deletions(-)
--- a/ChangeLog
+++ a/ChangeLog
@@ -1,3 +1,9 @@
+2010-03-09 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Handling
+ of R_SPARC_TLS_LE_* needs to use 32-bit loads and stores, not
+ 64-bit ones.
+
2009-10-27 Aurelien Jarno <aurelien@aurel32.net>
[BZ #10855]
--- a/sysdeps/sparc/sparc64/dl-machine.h
+++ a/sysdeps/sparc/sparc64/dl-machine.h
@@ -513,11 +513,13 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
value = sym->st_value - sym_map->l_tls_offset
+ reloc->r_addend;
if (r_type == R_SPARC_TLS_LE_HIX22)
- *reloc_addr = (*reloc_addr & 0xffc00000)
- | (((~value) >> 10) & 0x3fffff);
+ *(unsigned int *)reloc_addr =
+ ((*(unsigned int *)reloc_addr & 0xffc00000)
+ | (((~value) >> 10) & 0x3fffff));
else
- *reloc_addr = (*reloc_addr & 0xffffe000) | (value & 0x3ff)
- | 0x1c00;
+ *(unsigned int *)reloc_addr =
+ ((*(unsigned int *)reloc_addr & 0xffffe000) | (value & 0x3ff)
+ | 0x1c00);
}
break;
# endif

View File

@ -29,7 +29,7 @@
Summary: The GNU libc libraries
Name: glibc
Version: %{glibcversion}
Release: 2
Release: 3
# GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
# Things that are linked directly into dynamically linked programs
# and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional
@ -43,6 +43,8 @@ Source1: %{glibcsrcdir}-fedora.tar.bz2
Patch0: %{name}-fedora.patch
Patch1: %{name}-ia64-lib64.patch
Patch2: sparc-shared-mapping.patch
Patch3: glibc-sparc64-reloc.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Obsoletes: glibc-profile < 2.4
Provides: ldconfig
@ -249,6 +251,7 @@ package or when debugging this package.
%setup -q -n %{glibcsrcdir} -b1
%patch0 -E -p1
%patch2 -p1
%patch3 -p1
%ifarch ia64
%if "%{_lib}" == "lib64"
%patch1 -p1
@ -1040,6 +1043,9 @@ rm -f *.filelist*
%endif
%changelog
* Thu Mar 09 2010 Dennis Gilmore <dennis@ausil.us> - 2.11.1-3
- add patch to fix sparc TLS reloc (BZ#571551).
* Wed Feb 10 2010 Dennis Gilmore <dennis@ausil.us> - 2.11.1-2
- add sparc locale patch commited upstream to the fedora branch