From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3881 invoked by alias); 15 Dec 2004 17:23:13 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 17781 invoked from network); 15 Dec 2004 17:06:04 -0000 Received: from unknown (HELO arwen.tausq.org) (64.81.244.109) by sourceware.org with SMTP; 15 Dec 2004 17:06:04 -0000 Received: by arwen.tausq.org (Postfix, from userid 1000) id A574E6BE7E; Wed, 15 Dec 2004 09:06:02 -0800 (PST) Date: Wed, 15 Dec 2004 17:27:00 -0000 From: Randolph Chung To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA/hpux] SEGV when running program using dlopen Message-ID: <20041215170602.GB29171@tausq.org> Reply-To: Randolph Chung References: <20041215073206.GM964@adacore.com> <20041215163628.GY29171@tausq.org> <20041215165738.GQ964@adacore.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041215165738.GQ964@adacore.com> X-GPG: for GPG key, see http://www.tausq.org/gpg.txt User-Agent: Mutt/1.5.6+20040722i X-SW-Source: 2004-12/txt/msg00386.txt.bz2 > The answer is in the body of lookup_minimal_symbol_solib_trampoline(). > > It iterates over all msymbols of the objfile, and returns the first > one whose name matches *and* whose ``MSYMBOL_TYPE (msymbol) == > mst_solib_trampoline''. See minsyms.c, around line 353. > > Since in our case, the symbol we're looking for is not inside > a shared library, the lookup always fails. hrm, i see.... > I was also wondering whether the current code might be working > by pure luck in the other case. Assuming that the objfile contains > two symbols (one stub, one function) in the shared library, what > guaranty do we have that the lookup will find the one we're looking > for? yeah, seems a bit bogus :) i think it works only because export stubs normally occur earlier in a file than the real function; but i suppose that doesn't have to be the case. > AFAIK, it provides some help in debugging by exporting some specified > symbols. The only use I know of if with shared libraries... ok, thanks. your patch looks good; i'm still wondering if we should have unified logic to search for (export|import) stubs... but that's for later. thanks, randolph -- Randolph Chung Debian GNU/Linux Developer, hppa/ia64 ports http://www.tausq.org/