mumble: fix SEGV on musl.

Closes: #7509 [via git-merge-pr]
This commit is contained in:
Matthias von Faber 2017-08-28 00:17:20 +02:00 committed by Jürgen Buchmüller
parent 7be306f3f0
commit 92ff82a0d3
2 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,30 @@
--- overlay_gl/overlay.c
+++ overlay_gl/overlay.c
@@ -690,19 +690,24 @@ static void initializeLibrary() {
int nchains = 0;
ElfW(Sym) *symtab = NULL;
const char *strtab = NULL;
+#ifdef __GLIBC__
+ const ElfW(Addr) base = 0;
+#else
+ const ElfW(Addr) base = lm->l_addr;
+#endif
ElfW(Dyn) *dyn = lm->l_ld;
while (dyn->d_tag) {
switch (dyn->d_tag) {
case DT_HASH:
- nchains = *(int *)(dyn->d_un.d_ptr + 4);
+ nchains = *(int *)(base + dyn->d_un.d_ptr + 4);
break;
case DT_STRTAB:
- strtab = (const char *) dyn->d_un.d_ptr;
+ strtab = (const char *)(base + dyn->d_un.d_ptr);
break;
case DT_SYMTAB:
- symtab = (ElfW(Sym) *) dyn->d_un.d_ptr;
+ symtab = (ElfW(Sym) *)(base + dyn->d_un.d_ptr);
break;
}
dyn ++;

View File

@ -1,7 +1,7 @@
# Template file for 'mumble'
pkgname=mumble
version=1.2.19
revision=4
revision=5
hostmakedepends="pkg-config qt-host-tools qt-qmake protobuf Ice"
makedepends="
libcap-devel Ice-devel protobuf-devel libXi-devel qt-devel libressl-devel