[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

Gotom,

I had a conversation with Richard about this and his conclusions were
correct. If there is no DT_PLTREL section then elf_machine_runtime_setup
has nothing to do, it's only purpose is to point PLT slots to fixup or
setup gp in the slot.

I've created a .dpatch with a variant of this patch, I'm building some
testing deb's and I'll hand these to Richard. If he says it works for
him then I'll give them to you for application to patches/. That is also
if they pass the test-suite without regression ;)

I'm currently building with the patch below, and testing.

> > --- glibc-2.3.2/sysdeps/hppa/dl-machine.h-	2004-01-18 16:22:44.000000000 +0000
> > +++ glibc-2.3.2/sysdeps/hppa/dl-machine.h	2004-01-18 16:24:00.000000000 +0000
> > @@ -143,10 +143,10 @@
> >  {
> >    extern void _dl_runtime_resolve (void);
> >    extern void _dl_runtime_profile (void);
> > -  Elf32_Addr jmprel = D_PTR(l, l_info[DT_JMPREL]);
> >  
> > -  if (lazy && jmprel)
> > +  if (l->l_info[DT_JMPREL] && lazy)
> >      {
> > +      Elf32_Addr jmprel = D_PTR(l, l_info[DT_JMPREL]);
> >        Elf32_Addr *got = NULL;
> >        Elf32_Addr l_addr;
> >        Elf32_Addr end_jmprel;

I think I might use something like this...

--- 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)
     {


Cheers,
Carlos.




Reply to: