From ebbfea4ed0088745d6aab0ab5600c6e0df9b635878151ce6d0197cd49cb6b3d3 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Fri, 28 Sep 2012 07:50:13 +0000 Subject: [PATCH] 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 --- glibc.changes | 6 ++++++ glibc.spec | 3 +++ sparc-bind-now.patch | 31 +++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 sparc-bind-now.patch diff --git a/glibc.changes b/glibc.changes index 2e5f83e..4b47a4b 100644 --- a/glibc.changes +++ b/glibc.changes @@ -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 diff --git a/glibc.spec b/glibc.spec index fd9c365..b110147 100644 --- a/glibc.spec +++ b/glibc.spec @@ -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 diff --git a/sparc-bind-now.patch b/sparc-bind-now.patch new file mode 100644 index 0000000..6608d77 --- /dev/null +++ b/sparc-bind-now.patch @@ -0,0 +1,31 @@ +commit aa9bbfe6a79fce593ab3d298bb0e880d77eb7f71 +Author: David S. Miller +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+]