From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9117 invoked by alias); 31 Mar 2014 22:57:06 -0000 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 Received: (qmail 9106 invoked by uid 89); 31 Mar 2014 22:57:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: smtp.smtpout.orange.fr Received: from smtp10.smtpout.orange.fr (HELO smtp.smtpout.orange.fr) (80.12.242.132) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 31 Mar 2014 22:57:03 +0000 Received: from beldin ([82.125.28.20]) by mwinf5d33 with ME id kNwz1n0080S25PW03Nwz73; Tue, 01 Apr 2014 00:57:01 +0200 From: Robert Jarzmik To: Jan Kratochvil Cc: gdb@sourceware.org, robert.jarzmik@intel.com Subject: Re: Gdb, PIE and scan_dyntag(DT_DEBUG) References: <87bnwuuhzp.fsf@free.fr> <20140331184724.GA6038@host2.jankratochvil.net> X-URL: http://belgarath.falguerolles.org/ Date: Mon, 31 Mar 2014 22:57:00 -0000 In-Reply-To: <20140331184724.GA6038@host2.jankratochvil.net> (Jan Kratochvil's message of "Mon, 31 Mar 2014 20:47:24 +0200") Message-ID: <877g7augck.fsf@free.fr> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2014-03/txt/msg00074.txt.bz2 Jan Kratochvil writes: > On Tue, 25 Mar 2014 21:43:22 +0100, Robert Jarzmik wrote: >> I have a problem with gdb not finding the shared library list when analyzing a >> core dump of an ELF-X86-64 binary on Linux. > > The problem is it works for me. Tested on Fedora 20 x86_64 although I am not > aware of any distro-specific stuff which could affect this functionality. > It is also relevant to know prelink status but I have tested this > functionality now even with unprelinked ld.so and libc.so: OK, you're right. I finally found the culprit : in my case, it was the linker and strip discrepency. To be more precise, the ELF program headers of the unstripped binary and the stripped binary didn't match, as in the unstripped one the .bss section was aligned (fileoffset wise) on 8 bytes, while in the stripped version it was aligned on 4 (as the .bss section alignement). This was creating different filesizes for the segment containing the .bss section, and therefore gdb's svr4_relocate_*() function was lost and did not relocate my PIE executable. GDB was right, it's the linker which was faulty in my case. Cheers. -- Robert