From f714475f0fa0af405b3f0d9ed8b8289d66f28b5d Mon Sep 17 00:00:00 2001 From: Jitesh Shah Date: Wed, 11 Nov 2009 10:13:24 +0100 Subject: [PATCH] Add a temp patch for alignment trap in linker http://sourceware.org/ml/crossgcc/2009-11/msg00008.html The real fix is in gcc. Maintain this patch here until it is fixed in gcc Signed-off-by: Jitesh Shah --- glibc-arm-alignment-fix.patch | 28 ++++++++++++++++++++++++++++ glibc.spec | 7 ++++++- 2 files changed, 34 insertions(+), 1 deletions(-) create mode 100644 glibc-arm-alignment-fix.patch diff --git a/glibc-arm-alignment-fix.patch b/glibc-arm-alignment-fix.patch new file mode 100644 index 0000000..beb49c3 --- /dev/null +++ b/glibc-arm-alignment-fix.patch @@ -0,0 +1,28 @@ +diff -dur glibc-2.11.backup/ports/sysdeps/arm/dl-machine.h glibc-2.11/ports/sysdeps/arm/dl-machine.h +--- glibc-2.11.backup/ports/sysdeps/arm/dl-machine.h 2009-11-10 08:12:18.000000000 +0100 ++++ glibc-2.11/ports/sysdeps/arm/dl-machine.h 2009-11-11 10:07:48.030872826 +0100 +@@ -585,13 +585,22 @@ + } + # endif + ++union arm_unaligned_data { ++ Elf32_Addr l_addr; ++} __attribute__ ((packed)); ++ + auto inline void + __attribute__ ((always_inline)) + elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rel *reloc, + void *const reloc_addr_arg) + { +- Elf32_Addr *const reloc_addr = reloc_addr_arg; +- *reloc_addr += l_addr; ++ if (((long)reloc_addr_arg) & 0x3) { ++ union arm_unaligned_data *const lpdata = reloc_addr_arg; ++ lpdata->l_addr += l_addr; ++ } else { ++ Elf32_Addr *const reloc_addr = reloc_addr_arg; ++ *reloc_addr += l_addr; ++ } + } + + # ifndef RTLD_BOOTSTRAP diff --git a/glibc.spec b/glibc.spec index 2c8ed0d..9552a25 100644 --- a/glibc.spec +++ b/glibc.spec @@ -27,7 +27,7 @@ Summary: The GNU libc libraries Name: glibc Version: %{glibcversion} -Release: 2.fa2 +Release: 2.fa3 # 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 @@ -42,6 +42,7 @@ Source2: glibc-ports-%{glibcportsdate}.tar.bz2 Patch0: %{name}-fedora.patch Patch1: %{name}-ia64-lib64.patch Patch2: tzdata-update.c.arm.patch +Patch3: glibc-arm-alignment-fix.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Obsoletes: glibc-profile < 2.4 Provides: ldconfig @@ -251,6 +252,7 @@ mv glibc-ports-%{glibcportsdate} ports %ifarch %{arm} %patch2 -p1 +%patch3 -p1 %endif # A lot of programs still misuse memcpy when they have to use # memmove. The memcpy implementation below is not tolerant at @@ -1051,6 +1053,9 @@ rm -f *.filelist* %endif %changelog +* Wed Nov 11 2009 Jitesh Shah - 2.11-2.fa3 +- Add a temp patch for alignment error in the dynamic linker. http://sourceware.org/ml/crossgcc/2009-11/msg00008.html + * Tue Nov 10 2009 Jitesh Shah - 2.11-2.fa2 - Add tzdata patch -- 1.5.5.6