From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26408 invoked by alias); 8 Jul 2010 20:32:06 -0000 Received: (qmail 26399 invoked by uid 22791); 8 Jul 2010 20:32:05 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 08 Jul 2010 20:32:01 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o68KVvHF032499 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 8 Jul 2010 16:31:57 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o68KVuSv032712; Thu, 8 Jul 2010 16:31:56 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o68KVsWf009363; Thu, 8 Jul 2010 16:31:55 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id B58253784FB; Thu, 8 Jul 2010 14:31:54 -0600 (MDT) From: Tom Tromey To: Mathieu Lacage Cc: gdb-patches@sourceware.org Subject: Re: impossible to resolve symbols in same binary loaded twice with dlmopen References: <1278528582.10151.23.camel@localhost.localdomain> Date: Thu, 08 Jul 2010 20:32:00 -0000 In-Reply-To: <1278528582.10151.23.camel@localhost.localdomain> (Mathieu Lacage's message of "Wed, 07 Jul 2010 20:49:42 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2010-07/txt/msg00161.txt.bz2 >>>>> "Mathieu" == Mathieu Lacage writes: Mathieu> 2010-XX-XX Mathieu Lacage Mathieu> Fix PR/gdb 11766: gdb does not resolve correctly symbols in Mathieu> binaries loaded twice with dlmopen I think this is a reasonable idea. First, I'm curious: does gdb detect dlmopen calls automatically? I thought there was some missing glibc feature here. I haven't looked into it too much since I wasn't aware of anybody really using dlmopen. If gdb cannot do this, please file a bug report. I am not completely sure that this patch is sufficient. It doesn't seem like it would handle PIE properly. I think you would have to modify objfile_relocate as well. I was wondering if there is a possible bug with a program dlmopen()ing itself, but after thinking about it my guess is no. Otherwise it seems reasonable to me. Once you have this patch, does it really work? It seems like it would work ok for some things, like backtraces, but not other things. E.g., does symbol lookup work properly in the dlmopen case? I would imagine that it does or does not depending on the ordering of objfiles in gdb's internal list. Tom