SHA256
1
0
forked from pool/glibc

Accepting request 136312 from home:a_jaeger:my-factory-packages

Fix sparc build

OBS-URL: https://build.opensuse.org/request/show/136312
OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=217
This commit is contained in:
Andreas Jaeger 2012-09-28 07:50:13 +00:00 committed by Git OBS Bridge
parent e2a261690d
commit ebbfea4ed0
3 changed files with 40 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Sep 28 07:47:33 UTC 2012 - aj@suse.de
- Fix crash in relocation on sparc with bind-now (bso#14376)
(patch sparc-bind-now.patch).
-------------------------------------------------------------------
Thu Sep 27 12:20:11 UTC 2012 - aj@suse.de

View File

@ -253,6 +253,8 @@ Patch402: nscd-avoid-gcc-warning.diff
###
# PATCH-FIX-UPSTREAM Fix dns buffer - aj@suse.de
Patch1021: glibc-2.16-getaddrinfo-buffer.patch
# PATCH-FIX-UPSTREAM Fix sparc dynamic linker triggered by bind-now swo#14376 - aj@suse.de
Patch1022: sparc-bind-now.patch
###
# Patches awaiting upstream approval
@ -497,6 +499,7 @@ rm nscd/s-stamp
%patch20 -p1
%endif
%patch1021 -p1
%patch1022 -p1
%patch2001 -p1
# XXX: Does not pass testsuite, still there's no better solution yet

31
sparc-bind-now.patch Normal file
View File

@ -0,0 +1,31 @@
commit aa9bbfe6a79fce593ab3d298bb0e880d77eb7f71
Author: David S. Miller <davem@davemloft.net>
Date: Thu Sep 27 21:33:54 2012 -0700
Fix sparc64 crashes with LD_BIND_NOW and --enable-bind-now.
[BZ #14376]
* sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Do not
pass reloc->r_addend in as the 'high' argument to
sparc64_fixup_plt when handling R_SPARC_JMP_IREL relocations.
diff --git a/sysdeps/sparc/sparc64/dl-machine.h b/sysdeps/sparc/sparc64/dl-machine.h
index 35c24d1..2f8bbe1 100644
--- a/sysdeps/sparc/sparc64/dl-machine.h
+++ b/sysdeps/sparc/sparc64/dl-machine.h
@@ -458,7 +458,14 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
break;
case R_SPARC_JMP_IREL:
value = ((Elf64_Addr (*) (int)) value) (GLRO(dl_hwcap));
- /* Fall thru */
+ /* 'high' is always zero, for large PLT entries the linker
+ emits an R_SPARC_IRELATIVE. */
+#ifdef RESOLVE_CONFLICT_FIND_MAP
+ sparc64_fixup_plt (NULL, reloc, reloc_addr, value, 0, 0);
+#else
+ sparc64_fixup_plt (map, reloc, reloc_addr, value, 0, 0);
+#endif
+ break;
case R_SPARC_JMP_SLOT:
#ifdef RESOLVE_CONFLICT_FIND_MAP
/* R_SPARC_JMP_SLOT conflicts against .plt[32768+]