From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24845 invoked by alias); 26 Jan 2011 01:58:26 -0000 Received: (qmail 24834 invoked by uid 22791); 26 Jan 2011 01:58:25 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e24smtp04.br.ibm.com (HELO e24smtp04.br.ibm.com) (32.104.18.25) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 26 Jan 2011 01:58:20 +0000 Received: from /spool/local by e24smtp04.br.ibm.com with XMail ESMTP for from ; Tue, 25 Jan 2011 23:58:16 -0200 Received: from mailhub3.br.ibm.com ([9.18.232.110]) by e24smtp04.br.ibm.com ([10.172.0.140]) with XMail ESMTP; Tue, 25 Jan 2011 23:58:14 -0200 Received: from d24av05.br.ibm.com (d24av05.br.ibm.com [9.18.232.44]) by mailhub3.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p0Q24srE2769118 for ; Wed, 26 Jan 2011 00:04:54 -0200 Received: from d24av05.br.ibm.com (loopback [127.0.0.1]) by d24av05.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p0Q1uwiU014533 for ; Tue, 25 Jan 2011 23:56:59 -0200 Received: from [9.78.135.182] ([9.78.135.182]) by d24av05.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p0Q1uw3T014530; Tue, 25 Jan 2011 23:56:58 -0200 Subject: Re: impossible to resolve symbols in same binary loaded twice with dlmopen From: Thiago Jung Bauermann To: Mathieu Lacage Cc: Tom Tromey , gdb-patches@sourceware.org In-Reply-To: References: <1278528582.10151.23.camel@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" Date: Wed, 26 Jan 2011 10:52:00 -0000 Message-ID: <1296007016.17530.17.camel@hactar> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit x-cbid: 11012601-8936-0000-0000-000000350692 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-01/txt/msg00510.txt.bz2 Hi, On Thu, 2011-01-20 at 13:05 +0100, Mathieu Lacage wrote: > On Sun, Jul 25, 2010 at 14:24, Mathieu Lacage 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 PR/symtab 11766: * gdb/objfiles.h (struct objfile) : 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); }