From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4151 invoked by alias); 29 Aug 2006 12:47:20 -0000 Received: (qmail 4137 invoked by uid 22791); 29 Aug 2006 12:47:19 -0000 X-Spam-Check-By: sourceware.org Received: from fra-del-04.spheriq.net (HELO fra-del-04.spheriq.net) (195.46.51.100) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 29 Aug 2006 12:47:09 +0000 Received: from fra-out-02.spheriq.net (fra-out-02.spheriq.net [195.46.51.130]) by fra-del-04.spheriq.net with ESMTP id k7TCl6YJ032507 for ; Tue, 29 Aug 2006 12:47:06 GMT Received: from fra-cus-02.spheriq.net (fra-cus-02.spheriq.net [195.46.51.38]) by fra-out-02.spheriq.net with ESMTP id k7TCl1il008555 for ; Tue, 29 Aug 2006 12:47:05 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by fra-cus-02.spheriq.net with ESMTP id k7TCkwSc027857 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Tue, 29 Aug 2006 12:47:01 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9A836DA44; Tue, 29 Aug 2006 12:46:50 +0000 (GMT) Received: from mail1.cro.st.com (mail1.cro.st.com [164.129.40.131]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 6346A47441; Tue, 29 Aug 2006 12:46:50 +0000 (GMT) Received: from crx549.cro.st.com (crx549.cro.st.com [164.129.44.49]) by mail1.cro.st.com (MOS 3.5.8-GR) with ESMTP id CIH66234 (AUTH "frederic riss"); Tue, 29 Aug 2006 14:46:49 +0200 (CEST) Subject: Re: What exactly does "info sharedlibrary" command show? From: Frederic RISS To: chen free Cc: gdb@sources.redhat.com In-Reply-To: References: Content-Type: text/plain Date: Tue, 29 Aug 2006 12:47:00 -0000 Message-Id: <1156855634.3429.197.camel@crx549.cro.st.com> Mime-Version: 1.0 X-Mailer: Evolution 2.6.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-08/txt/msg00211.txt.bz2 On Tue, 2006-08-29 at 20:03 +0800, chen free wrote: > Recently I'm looking for a proper method of finding the memory usage > of shared library of a specific program, This is a tough job, I'm not sure looking at info sharedlibrary will help you much. > and from the manual of GDB, I > found "info sharedlibrary" command. > > However, I'm curious about the display of its result. Does anyone know > the meaning of memory address reported by GDB? Something like: > ============ > > >From To Syms Read Shared Object Library > 0x005cfc00 0x006bf800 Yes /lib/tls/libc.so.6 > 0x0059e7a0 0x005b010f Yes /lib/ld-linux.so.2 > > ============ > I believe they are not the physical address, right? They are the start/end (virtual) addresses of the library .text section. > ============ > Contents of "maps" > 0x005bb000 0x006de000 r-xp 00000000 fd:00 3605643 /lib/tls/libc-2.3.4.so If you take this as an example, you should find out that 0x005cfc00 - 0x005bb000 gives you the .text section load addr (check in the elf file using objdump -h or readelf -s). Fred.