From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15235 invoked by alias); 12 Mar 2014 07:17:15 -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 15216 invoked by uid 89); 12 Mar 2014 07:17:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-pd0-f178.google.com Received: from mail-pd0-f178.google.com (HELO mail-pd0-f178.google.com) (209.85.192.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 12 Mar 2014 07:17:10 +0000 Received: by mail-pd0-f178.google.com with SMTP id x10so683715pdj.23 for ; Wed, 12 Mar 2014 00:17:08 -0700 (PDT) X-Received: by 10.68.181.165 with SMTP id dx5mr3057717pbc.38.1394608627987; Wed, 12 Mar 2014 00:17:07 -0700 (PDT) Received: from bubble.grove.modra.org ([101.166.26.37]) by mx.google.com with ESMTPSA id x9sm4112156pbu.1.2014.03.12.00.17.05 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 00:17:07 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 3AC47EA00D2; Wed, 12 Mar 2014 17:47:02 +1030 (CST) Date: Wed, 12 Mar 2014 07:17:00 -0000 From: Alan Modra To: "Metzger, Markus T" Cc: "gdb@sourceware.org" , "binutils@sourceware.org" Subject: Re: vdso handling Message-ID: <20140312071701.GW26922@bubble.grove.modra.org> Mail-Followup-To: "Metzger, Markus T" , "gdb@sourceware.org" , "binutils@sourceware.org" References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-03/txt/msg00016.txt.bz2 On Mon, Mar 10, 2014 at 01:04:33PM +0000, Metzger, Markus T wrote: > I noticed that the BFD created for the VDSO (system-provided in-memory > DSO) does not contain any BFD sections. Is this intentional? Or has > there just been no need for them? [snip] > The vdso is processed in symbol_file_add_from_memory at > gdb/symfile-mem.c:84. It calls bfd_from_remote_memory to create a BFD > for the vdso and then processes it. The underlying cause is that you're trying to debug an ELF binary that only contains the execution view. The linking view (of which the sections are a part) is not loaded, so bfd_from_remote_memory does not have this information. See elfcode.h bfd_from_remote_memory. You can see similar breakage of gdb and binutils if you zap e_shoff, e_shnum, and e_shstrndx of your favourite hello world program. I suppose one way to provide something that gdb and other tools expect would be to treat the vdso like a core file, and create fake sections corresponding to the program headers. I'm not really keen on the idea though, since I know that will open up a can of worms. Can't you point gdb at a file image for the vdso? -- Alan Modra Australia Development Lab, IBM