Bug#40479: libc6: NMU patch for ARM
Package: libc6
Version: 2.1.1-12.1
Severity: normal
Apologies if I sent this twice - I think my first try didn't go through.
Attached is an NMU patch to get glibc to work on ARM.
Cheers,
- Jim
diff -urN old-deb/glibc-2.1.1/debian/changelog glibc-2.1.1/debian/changelog
--- old-deb/glibc-2.1.1/debian/changelog Tue Jun 29 10:42:01 1999
+++ glibc-2.1.1/debian/changelog Thu Jun 17 21:12:15 1999
@@ -1,3 +1,10 @@
+glibc (2.1.1-12.1) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Include patch for ARM to fix dynamic linker.
+
+ -- Jim Pick <jim@jimpick.com> Thu, 17 Jun 1999 21:11:59 -0700
+
glibc (2.1.1-12) unstable; urgency=low
* debian/rules: Use /var/lib/misc here too.
diff -urN old-deb/glibc-2.1.1/debian/patches/arm-dynamiclinker.dpatch glibc-2.1.1/debian/patches/arm-dynamiclinker.dpatch
--- old-deb/glibc-2.1.1/debian/patches/arm-dynamiclinker.dpatch Wed Dec 31 16:00:00 1969
+++ glibc-2.1.1/debian/patches/arm-dynamiclinker.dpatch Thu Jun 17 21:11:07 1999
@@ -0,0 +1,74 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DPATCH:' are a description of the patch.
+# DP: Patch from philb to fix dynamic linker
+
+if [ $# -ne 2 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch -d "$2" -f -p0 < $0;;
+ -unpatch) patch -d "$2" -f -R -p0 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+
+From: Philip Blundell <philb@gnu.org>
+Subject: patch for dynamic linker
+To: drepper@cygnus.com, scottb@netwinder.org
+Cc: jim@jimpick.com, stewart@nexus.carleton.ca
+Date: Sun, 06 Jun 1999 00:50:33 +0100
+
+Hi,
+
+This patch corrects a long-standing problem that caused ld.so to segfault when
+glibc was compiled with -O2 or higher on the ARM. The old code relied on
+addressing the GOT from inside the asm, but because the compiler couldn't
+see this it was tending to reschedule instructions so that the PIC register
+wasn't loaded until later in the function.
+
+Uli, could you check this in please? It should probably go into the glibc 2.1
+branch as well as the mainline.
+
+Thanks
+
+p.
+
+1999-06-05 Philip Blundell <philb@gnu.org>
+
+ * sysdeps/arm/dl-machine.h (elf_machine_load_address): Fix
+ problems with GOT addressing.
+
+--- sysdeps/arm/dl-machine.h~ Sun May 9 11:39:24 1999
++++ sysdeps/arm/dl-machine.h Sat Jun 5 19:33:09 1999
+@@ -52,22 +52,14 @@
+
+
+ /* Return the run-time load address of the shared object. */
+-// patb
+ static inline Elf32_Addr __attribute__ ((unused))
+ elf_machine_load_address (void)
+ {
+- Elf32_Addr addr;
+- asm (" ldr ip,.L1
+- ldr r3,.L3
+- add r3, r3, sl
+- ldr ip,[sl, ip]
+- sub ip, r3, ip
+- b .L2
+- .L1: .word _dl_start(GOT)
+- .L3: .word _dl_start(GOTOFF)
+- .L2: mov %0, ip"
+- : "=r" (addr) : : "ip", "r3");
+- return addr;
++ extern void __dl_start asm ("_dl_start");
++ Elf32_Addr got_addr = (Elf32_Addr) &__dl_start;
++ Elf32_Addr pcrel_addr;
++ asm ("adr %0, _dl_start" : "=r" (pcrel_addr));
++ return pcrel_addr - got_addr;
+ }
+
diff -urN old-deb/glibc-2.1.1/debian/patches/arm-osabi.dpatch glibc-2.1.1/debian/patches/arm-osabi.dpatch
--- old-deb/glibc-2.1.1/debian/patches/arm-osabi.dpatch Wed Dec 31 16:00:00 1969
+++ glibc-2.1.1/debian/patches/arm-osabi.dpatch Sun Jun 20 11:03:12 1999
@@ -0,0 +1,40 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DPATCH:' are a description of the patch.
+# DP: A small patch to remove OSABI check on ELF executables so that
+# DP: ldd doesn't trip on new value in ELF header for ARM.
+
+if [ $# -ne 2 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch -d "$2" -f -p0 < $0;;
+ -unpatch) patch -d "$2" -f -R -p0 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+
+--- elf/dl-load.c.backup Sun Jun 20 10:57:41 1999
++++ elf/dl-load.c Sun Jun 20 10:59:31 1999
+@@ -746,11 +746,12 @@
+ LOSE (0, "ELF file version ident not " STRING(EV_CURRENT));
+ /* XXX We should be able so set system specific versions which are
+ allowed here. */
+- if (header->e_ident[EI_OSABI] != ELFOSABI_SYSV)
+- LOSE (0, "ELF file OS ABI not " STRING(ELFOSABI_SYSV));
++ /* if (header->e_ident[EI_OSABI] != ELFOSABI_SYSV)
++ LOSE (0, "ELF file OS ABI not " STRING(ELFOSABI_SYSV)); */
+ if (header->e_ident[EI_ABIVERSION] != 0)
+ LOSE (0, "ELF file ABI version not 0");
+- LOSE (0, "internal error");
++ if (header->e_ident[EI_OSABI] == ELFOSABI_SYSV)
++ LOSE (0, "internal error");
+ }
+
+ if (header->e_version != EV_CURRENT)
+
+
diff -urN old-deb/glibc-2.1.1/debian/patches/arm-sysctl.dpatch glibc-2.1.1/debian/patches/arm-sysctl.dpatch
--- old-deb/glibc-2.1.1/debian/patches/arm-sysctl.dpatch Tue Jun 29 10:42:03 1999
+++ glibc-2.1.1/debian/patches/arm-sysctl.dpatch Wed Dec 31 16:00:00 1969
@@ -1,54 +0,0 @@
-#! /bin/sh -e
-
-# All lines beginning with `# DPATCH:' are a description of the patch.
-# DP: ARM 2.0 kernels don't have sysctl - this is a stub implementation
-
-if [ $# -ne 2 ]; then
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1
-fi
-case "$1" in
- -patch) patch -d "$2" -f -p1 < $0;;
- -unpatch) patch -d "$2" -f -R -p1 < $0;;
- *)
- echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
- exit 1
-esac
-exit 0
-
-diff -urN glibc-pre2.1-2.0.100/sysdeps/unix/sysv/linux/arm/sysctl.c glibc-pre2.1-2.0.100.jim/sysdeps/unix/sysv/linux/arm/sysctl.c
---- glibc-pre2.1-2.0.100/sysdeps/unix/sysv/linux/arm/sysctl.c Wed Dec 31 16:00:00 1969
-+++ glibc-pre2.1-2.0.100.jim/sysdeps/unix/sysv/linux/arm/sysctl.c Sun Nov 22 19:27:46 1998
-@@ -0,0 +1,32 @@
-+/* sysctl - Read or write system information. Linux version.
-+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Library General Public License as
-+ published by the Free Software Foundation; either version 2 of the
-+ License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Library General Public License for more details.
-+
-+ You should have received a copy of the GNU Library General Public
-+ License along with the GNU C Library; see the file COPYING.LIB. If not,
-+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ Boston, MA 02111-1307, USA. */
-+
-+#include <sys/sysctl.h>
-+
-+/* sysctl is not yet implemented in ArmLinux */
-+extern int __syscall_error(int);
-+#include <asm/errno.h>
-+
-+int
-+sysctl (int *name, int nlen, void *oldval, size_t *oldlenp,
-+ void *newval, size_t newlen)
-+{
-+
-+ return __syscall_error(ENOSYS);
-+}
diff -urN old-deb/glibc-2.1.1/debian/rules glibc-2.1.1/debian/rules
--- old-deb/glibc-2.1.1/debian/rules Tue Jun 29 10:42:01 1999
+++ glibc-2.1.1/debian/rules Sun Jun 20 11:03:42 1999
@@ -786,7 +786,7 @@
ifeq ($(kernel),linux)
debian_patches += fhs
ifeq ($(ARCH),arm)
- debian_patches += arm-string arm-sysctl
+ debian_patches += arm-string arm-dynamiclinker arm-osabi
else
ifeq ($(ARCH),sparc)
debian_patches += sparc32-chown
-- System Information
Debian Release: potato
Kernel Version: Linux fleming 2.2.4 #1 Tue Mar 23 19:41:42 PST 1999 i586 unknown
Versions of the packages libc6 depends on:
ii ldso 1.9.11-2 The Linux dynamic linker, library and utilit
Reply to: