summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-05-05 14:33:28 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-05-05 14:33:28 +0000
commit9b25ff0e9150514954931bd07cfb516f9c29230a (patch)
treed96536e3a4c990e844e49aa4ac6d126ba6232c17
parentdd68b7623003428eec081c3654214ab2aa481c5a (diff)
downloadaports-9b25ff0e9150514954931bd07cfb516f9c29230a.tar.bz2
aports-9b25ff0e9150514954931bd07cfb516f9c29230a.tar.xz
core/uclibc: fix segfault in ldd
-rw-r--r--core/uclibc/0001-ldd-segfault-fix.patch49
-rw-r--r--core/uclibc/APKBUILD4
2 files changed, 52 insertions, 1 deletions
diff --git a/core/uclibc/0001-ldd-segfault-fix.patch b/core/uclibc/0001-ldd-segfault-fix.patch
new file mode 100644
index 00000000..4384fa54
--- /dev/null
+++ b/core/uclibc/0001-ldd-segfault-fix.patch
@@ -0,0 +1,49 @@
+From f29b6882327573ec4e694c1c852307c957d544b9 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Tue, 5 May 2009 14:10:42 +0000
+Subject: [PATCH] ldd segfault fix
+
+Fixes ldd segfault on this testcase:
+
+extern void _dl_getenv(void);
+void foo(void)
+{
+ printf("foo: %x\n", &_dl_getenv);
+}
+
+linked as -shared
+---
+ utils/ldd.c | 8 +++++---
+ 1 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/utils/ldd.c b/utils/ldd.c
+index 1f1dc25..2cd173c 100644
+--- a/utils/ldd.c
++++ b/utils/ldd.c
+@@ -576,18 +576,20 @@ static struct library *find_elf_interpreter(ElfW(Ehdr) *ehdr)
+ }
+ newlib->name = NULL;
+ newlib->path = NULL;
+- return NULL;
++ break;
+ }
+ }
+- if (newlib == NULL)
++ if (newlib == NULL) {
+ newlib = malloc(sizeof(struct library));
++ if (newlib)
++ newlib->next = NULL;
++ }
+ if (!newlib)
+ return NULL;
+ newlib->name = malloc(strlen(s) + 1);
+ strcpy(newlib->name, s);
+ newlib->path = strdup(newlib->name);
+ newlib->resolved = 1;
+- newlib->next = NULL;
+
+ #if 0
+ /*printf("find_elf_interpreter is adding '%s' to '%s'\n", newlib->name, newlib->path); */
+--
+1.6.2.3
+
diff --git a/core/uclibc/APKBUILD b/core/uclibc/APKBUILD
index cab1cb38..836dff1b 100644
--- a/core/uclibc/APKBUILD
+++ b/core/uclibc/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=uclibc
pkgver=0.9.30.1
-pkgrel=4
+pkgrel=5
pkgdesc="C library for developing embedded Linux systems"
url=http://uclibc.org
license="LGPL-2"
@@ -13,6 +13,7 @@ depends_dev="linux-headers"
source="http://uclibc.org/downloads/$_mynamever.tar.bz2
$pkgname-0.9.30.1-resolv.patch
uclibc-0.9.30.1-pthread_getattr_np.patch
+ 0001-ldd-segfault-fix.patch
uclibcconfig
"
@@ -46,4 +47,5 @@ build() {
md5sums="1a4b84e5536ad8170563ffa88c34679c uClibc-0.9.30.1.tar.bz2
ea91460617601b6e084ead66bc3948f5 uclibc-0.9.30.1-resolv.patch
cf80c0d44a41e02f389be427ee615d61 uclibc-0.9.30.1-pthread_getattr_np.patch
+4079b20c763727863bc53408e4988434 0001-ldd-segfault-fix.patch
a4512d5594f1b450ffbf2ff9eda6263b uclibcconfig"