From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13317 invoked by alias); 11 May 2009 21:09:43 -0000 Received: (qmail 13305 invoked by uid 22791); 11 May 2009 21:09:42 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_12,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 May 2009 21:09:37 +0000 Received: (qmail 3197 invoked from network); 11 May 2009 21:09:34 -0000 Received: from unknown (HELO orlando) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 11 May 2009 21:09:34 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [patch][rfc] Allow GDB to search for the right libthread_db.so.1 Date: Mon, 11 May 2009 21:09:00 -0000 User-Agent: KMail/1.9.10 Cc: Paul Pluzhnikov , Joel Brobecker , Hui Zhu , tromey@redhat.com, Thiago Jung Bauermann , Eli Zaretskii , Daniel Jacobowitz References: <8ac60eac0904201019g7ba8056bx5e84e6bfdf5935d8@mail.gmail.com> <200905111412.59493.pedro@codesourcery.com> <8ac60eac0905111108g26096302lb902cd414b5a6790@mail.gmail.com> In-Reply-To: <8ac60eac0905111108g26096302lb902cd414b5a6790@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905112209.38085.pedro@codesourcery.com> 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: 2009-05/txt/msg00228.txt.bz2 On Monday 11 May 2009 19:08:46, Paul Pluzhnikov wrote: > On Mon, May 11, 2009 at 6:12 AM, Pedro Alves wrote: > > >> handle = dlopen (library, RTLD_NOW); > > > > I wonder if making this RTLD_LAZY until you found the correct one > > wouldn't make sense? > > I don't believe so. > > AFAICT, the reason for RTLD_NOW is to make sure that this > libthread_db is really compatible with this GDB (doesn't require > any symbols GDB doesn't provide); and also to prevent GDB from > dying half way through with "unable to resolve symbol ...". Yeah. > Both of these still apply to whatever the "final" libthread_db is > going to be. > > Why would we want to dlopen(... RTLD_LAZY) and try to initialize > libthread_db if we are going to reject it as unusable in the end? To avoid immediate binding of random libc's, but yeah, brain f*rt. -- Pedro Alves