From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28993 invoked by alias); 15 Dec 2004 17:14:02 -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 12971 invoked from network); 15 Dec 2004 16:57:43 -0000 Received: from unknown (HELO smtp8.wanadoo.fr) (193.252.22.23) by sourceware.org with SMTP; 15 Dec 2004 16:57:43 -0000 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf0804.wanadoo.fr (SMTP Server) with SMTP id E1E391C0039B; Wed, 15 Dec 2004 17:57:42 +0100 (CET) Received: from takamaka.act-europe.fr (ABoulogne-102-1-3-174.w193-253.abo.wanadoo.fr [193.253.180.174]) by mwinf0804.wanadoo.fr (SMTP Server) with ESMTP id 7A82D1C0038D; Wed, 15 Dec 2004 17:57:42 +0100 (CET) Received: by takamaka.act-europe.fr (Postfix, from userid 507) id F0BE047DAD; Wed, 15 Dec 2004 20:57:38 +0400 (RET) Date: Wed, 15 Dec 2004 17:23:00 -0000 From: Joel Brobecker To: Randolph Chung Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA/hpux] SEGV when running program using dlopen Message-ID: <20041215165738.GQ964@adacore.com> References: <20041215073206.GM964@adacore.com> <20041215163628.GY29171@tausq.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041215163628.GY29171@tausq.org> User-Agent: Mutt/1.4i X-SW-Source: 2004-12/txt/msg00385.txt.bz2 > since we are already doing this in an ALL_OBJFILES loop, how come we > don't find the right symbol? 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. 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? > i also notice that the problem only occurs when you link in end.o; > what does that do? AFAIK, it provides some help in debugging by exporting some specified symbols. The only use I know of if with shared libraries... -- Joel