From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24654 invoked by alias); 9 Feb 2010 22:00:42 -0000 Received: (qmail 24644 invoked by uid 22791); 9 Feb 2010 22:00:41 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-fx0-f215.google.com (HELO mail-fx0-f215.google.com) (209.85.220.215) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 09 Feb 2010 22:00:37 +0000 Received: by fxm7 with SMTP id 7so685365fxm.8 for ; Tue, 09 Feb 2010 14:00:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.143.82 with SMTP id t18mr5808271fau.52.1265752834109; Tue, 09 Feb 2010 14:00:34 -0800 (PST) Date: Tue, 09 Feb 2010 22:00:00 -0000 Message-ID: <7b8592a1002091400y5b901e90s8cb26f75c057ffab@mail.gmail.com> Subject: reconstructing process memory map from core From: ineya ineya To: 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/msg00054.txt.bz2 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.