From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28873 invoked by alias); 21 Dec 2007 16:27:45 -0000 Received: (qmail 28864 invoked by uid 22791); 21 Dec 2007 16:27:44 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 21 Dec 2007 16:27:35 +0000 Received: from sunsite.mff.cuni.cz (localhost.localdomain [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.8/8.13.8) with ESMTP id lBLGXR3E027175; Fri, 21 Dec 2007 17:33:27 +0100 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.13.8/8.13.8/Submit) id lBLGXRcC027174; Fri, 21 Dec 2007 17:33:27 +0100 Date: Fri, 21 Dec 2007 16:27:00 -0000 From: Jakub Jelinek To: Nick Clifton Cc: Manuel Arriaga , binutils@sourceware.org Subject: Re: identifying symbol versions available to dlvsym Message-ID: <20071221163326.GH2947@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek References: <43d106a20712030948x2ec458f6j7564cb6db41fa018@mail.gmail.com> <43d106a20712031014t559cbbbaid13be33547e7a9c3@mail.gmail.com> <476BE851.6040705@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <476BE851.6040705@redhat.com> User-Agent: Mutt/1.4.2.2i Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2007-12/txt/msg00126.txt.bz2 On Fri, Dec 21, 2007 at 04:22:41PM +0000, Nick Clifton wrote: > I am sorry that it has taken so long for us to reply to your posts. > > >OK, so some experimentation and additional searching showed me that > >GNU libc's fopen does not necessarily reside on /lib/libc.so.6. By > >looking into a different shared lib, one reads > > > >$ readelf -s /lib64/libc.so.6 |grep " fopen@" > > 162: 000000000005f4c0 10 FUNC GLOBAL DEFAULT 12 > > fopen@@GLIBC_2.2.5 > > > >which is precisely the version number that works with dlvsym(). > > > >How could I have found this programatically? To identify the version > >of fopen being used, can I do better than > > > >1) running ldd on an executable containing a call to fopen(); > >2) run readelf -s | grep fopen on each of the libs listed; and > >3) using the first version string I find in 2) in my calls to dlvsym? Well, usually you don't want the first version, but the default version (the one with @@ instead of just @), because that matches the headers of the library and what you'd normally get if you directly linked against the library rather than using dlvsym. Jakub