[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#228375: hppa glibc, elf_machine_runtime_setup() segv, with patch



On Sun, Jan 25, 2004 at 04:23:20AM +0900, GOTO Masanori wrote:
> Carlos, could you look at this report?
> 
> Regards,
> -- gotom

Richard,

Can you try out these changes and tell me if this fixes the issue?

http://www.parisc-linux.org/~carlos/glibc-2.3.2-debs-2004-01-25/

It's against glibc 2.3.2-ds1-10, with two point changes that are in my
own tree. The first is a fix for profiling, already in -ds1-11, and the
second is the change you requested.

Cheers,
Carlos.

----
#! /bin/sh -e

# All lines beginning with `# DP:' are a description of the patch.
# DP: Description: If no DT_PLTREL is present, do not setup lazy linking structures 
# DP: Related bugs: debian installer breaks on hppa.
# DP: Author: Carlos O'Donell (Reported by Richard Hirst)
# DP: Upstream status: Pending
# DP: Status Details: This file has a lot of changes going upstream.
# DP: Date: 2004-01-24

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 --no-backup-if-mismatch -p1 < $0;;
    -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
    *)
	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
	exit 1
esac
exit 0

# append the patch here and adjust the -p? flag in the patch calls.
--- glibc-2.3.2/sysdeps/hppa/dl-machine.h	2004-01-06 21:39:22.000000000 -0500
+++ glibc-2.3.2/sysdeps/hppa/dl-machine.h.new	2004-01-24 16:02:02.000000000 -0500
@@ -143,7 +143,15 @@
 {
   extern void _dl_runtime_resolve (void);
   extern void _dl_runtime_profile (void);
-  Elf32_Addr jmprel = D_PTR(l, l_info[DT_JMPREL]);
+  Elf32_Addr jmprel = l->l_info[DT_JMPREL];
+  
+  if(__builtin_expect (jmprel == NULL,0))
+    {
+      /* No lazy linking possible without a PLT */
+      return 0;
+    }
+  
+  jmprel = D_PTR(l, l_info[DT_JMPREL]);
 
   if (lazy && jmprel)
     {



Reply to: