This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: impossible to resolve symbols in same binary loaded twice with dlmopen
- From: Thiago Jung Bauermann <bauerman at br dot ibm dot com>
- To: Mathieu Lacage <mathieu dot lacage at gmail dot com>
- Cc: Tom Tromey <tromey at redhat dot com>, gdb-patches at sourceware dot org
- Date: Tue, 25 Jan 2011 23:56:56 -0200
- Subject: Re: impossible to resolve symbols in same binary loaded twice with dlmopen
- References: <1278528582.10151.23.camel@localhost.localdomain> <m3zky14sw5.fsf@fleche.redhat.com> <AANLkTikX8KmJl6_gcsIEWfuJ5m3NS0LHvEZPVuS2iAJ4@mail.gmail.com> <m31vayaqqb.fsf@fleche.redhat.com> <AANLkTimZ1TQqbEVrkaFYwp-Hn0RzRFppgXn3CU6yUHd8@mail.gmail.com> <AANLkTik0zptGgNwwVk3M7yzJ_YHohs5NBHg3U-JiYj_m@mail.gmail.com>
Hi,
On Thu, 2011-01-20 at 13:05 +0100, Mathieu Lacage wrote:
> On Sun, Jul 25, 2010 at 14:24, Mathieu Lacage <mathieu.lacage@gmail.com> wrote:
>
> >> Anyway, AFAICT, your patch won't break anything, and it is a step in the
> >> right direction. So, please check it in.
> >
> > I don't have commit rights, and, really, it's better for you if I don't :)
>
> Would someone commit this patch for me ? It's been a couple of months now...
I'm not a maintainer, but given that the patch was already approved, I
committed the following.
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center
2011-01-25 Mathieu Lacage <mathieu.lacage@inria.fr>
PR/symtab 11766:
* gdb/objfiles.h (struct objfile) <addr_low>: New field.
* gdb/solib.c (solib_read_symbols): Check for addr_low in
equality test for objfile, initialize addr_low if needed.
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index c44517f..759c2f9 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -194,6 +194,8 @@ struct objfile
char *name;
+ CORE_ADDR addr_low;
+
/* Some flag bits for this objfile. */
unsigned short flags;
diff --git a/gdb/solib.c b/gdb/solib.c
index 909a23b..6748d87 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -638,7 +638,8 @@ solib_read_symbols (struct so_list *so, int flags)
/* Have we already loaded this shared object? */
ALL_OBJFILES (so->objfile)
{
- if (strcmp (so->objfile->name, so->so_name) == 0)
+ if (strcmp (so->objfile->name, so->so_name) == 0
+ && so->objfile->addr_low == so->addr_low)
break;
}
if (so->objfile != NULL)
@@ -648,6 +649,7 @@ solib_read_symbols (struct so_list *so, int flags)
so->sections_end);
so->objfile = symbol_file_add_from_bfd (so->abfd,
flags, sap, OBJF_SHARED);
+ so->objfile->addr_low = so->addr_low;
free_section_addr_info (sap);
}