From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12341 invoked by alias); 20 Jul 2009 04:13:12 -0000 Received: (qmail 12331 invoked by uid 22791); 20 Jul 2009 04:13:10 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 20 Jul 2009 04:13:06 +0000 Received: from wpaz9.hot.corp.google.com (wpaz9.hot.corp.google.com [172.24.198.73]) by smtp-out.google.com with ESMTP id n6K4D3ZU031281 for ; Sun, 19 Jul 2009 21:13:03 -0700 Received: from qyk9 (qyk9.prod.google.com [10.241.83.137]) by wpaz9.hot.corp.google.com with ESMTP id n6K4ChdV023873 for ; Sun, 19 Jul 2009 21:13:01 -0700 Received: by qyk9 with SMTP id 9so1976587qyk.2 for ; Sun, 19 Jul 2009 21:13:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.110.21 with SMTP id l21mr717143qcp.26.1248063180700; Sun, 19 Jul 2009 21:13:00 -0700 (PDT) In-Reply-To: <200907192257.08197.thiago.bauermann@gmail.com> References: <200907192257.08197.thiago.bauermann@gmail.com> Date: Mon, 20 Jul 2009 04:13:00 -0000 Message-ID: <8ac60eac0907192113s54f996a7m2fac203e07687272@mail.gmail.com> Subject: Re: [7.0] PR/9723: gdb breakpoints silently fail on PIE binaries From: Paul Pluzhnikov To: Thiago Jung Bauermann Cc: gdb@sourceware.org, Joel Brobecker Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-System-Of-Record: true 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: 2009-07/txt/msg00133.txt.bz2 On Sun, Jul 19, 2009 at 6:57 PM, Thiago Jung Bauermann wrote: > All this to say: can somebody save me some research time and tell in high > level how can I recognize from looking at an ELF file that I'm dealing with a > PIE binary (NOT a PIC library, of course)? Something like "see if the frob bit > in the bozo section is set") is enough, I can go from there. Elf*_Ehdr.e_type == ET_DYN for the main executable? Elf*_Phdr.p_vaddr == 0 for the first PT_LOAD segment? [This one is only true for non-prelinked -pie executable.] Cheers, -- Paul Pluzhnikov