From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20637 invoked by alias); 10 Feb 2010 02:41:44 -0000 Received: (qmail 20581 invoked by uid 22791); 10 Feb 2010 02:41:43 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-pz0-f183.google.com (HELO mail-pz0-f183.google.com) (209.85.222.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 10 Feb 2010 02:41:39 +0000 Received: by pzk13 with SMTP id 13so6728398pzk.24 for ; Tue, 09 Feb 2010 18:41:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.143.26.38 with SMTP id d38mr1998399wfj.218.1265769697272; Tue, 09 Feb 2010 18:41:37 -0800 (PST) In-Reply-To: <7b8592a1002091400y5b901e90s8cb26f75c057ffab@mail.gmail.com> References: <7b8592a1002091400y5b901e90s8cb26f75c057ffab@mail.gmail.com> From: Hui Zhu Date: Wed, 10 Feb 2010 02:41:00 -0000 Message-ID: Subject: Re: reconstructing process memory map from core To: ineya ineya Cc: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-02/txt/msg00056.txt.bz2 Try ".dynamic" for linux. Hui On Wed, Feb 10, 2010 at 06:00, ineya ineya wrote: > How is symbol loading handled when shared libraries come to play? > > This is my story: > I have a mips embedded device, which has little memory. So I decided > to dump the heap as the last thing, so in case there is little space > left on device, I would get at least stack, .got, etc. from binary and > shared libraries, and heap would be incomplete. I thought, that having > stack, .got, .dynsym, etc. would be enough for gdb to load symbols > from all binaries and shared libraries, and I could at least resolve > symbols from registers or stack. > > But it doesn't work, gdb is trying to read something from heap, and if > this fails, no symbols are loaded. So I was wondering why gdb needs to > access heap? Or more generally how are symbols loaded / how is the > process memory map reconstructed from core file? > > I thought all that is needed is to have: > - list of external function - in .dynsym I guess > - .got from runtime > and the address where shared library was in memory is computed by data > present in .got and relative position of function in .so. > > Thank you for any hints. >