From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 344 invoked by alias); 20 Jul 2009 01:55:56 -0000 Received: (qmail 32734 invoked by uid 22791); 20 Jul 2009 01:55:55 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from qw-out-1920.google.com (HELO qw-out-1920.google.com) (74.125.92.147) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 20 Jul 2009 01:55:49 +0000 Received: by qw-out-1920.google.com with SMTP id 5so855442qwf.24 for ; Sun, 19 Jul 2009 18:55:46 -0700 (PDT) Received: by 10.224.28.130 with SMTP id m2mr2355675qac.52.1248054946616; Sun, 19 Jul 2009 18:55:46 -0700 (PDT) Received: from hotblack.localnet ([189.4.46.16]) by mx.google.com with ESMTPS id 7sm3791573qwf.48.2009.07.19.18.55.44 (version=SSLv3 cipher=RC4-MD5); Sun, 19 Jul 2009 18:55:45 -0700 (PDT) From: Thiago Jung Bauermann To: gdb@sourceware.org Subject: [7.0] PR/9723: gdb breakpoints silently fail on PIE binaries Date: Mon, 20 Jul 2009 01:55:00 -0000 User-Agent: KMail/1.11.4 (Linux/2.6.30-1-amd64; KDE/4.2.4; x86_64; ; ) Cc: Joel Brobecker MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907192257.08197.thiago.bauermann@gmail.com> 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/msg00131.txt.bz2 Hi, One painful aspect of GDB right now is that it doesn't handle PIE (Position Independent Executable) and doesn't even recognize a PIE binary when it sees one. I have an action item for 7.0 which is to make GDB at least complain that it is being given such a binary and warn the user appropriately. That would be enough to close the bugzilla in the subject and ship 7.0 (as we have discussed before in this mailing list). Then for 7.1 somebody could push upstream one of the two circulating patches which implement PIE support, and close PR/9174 (gdb can't handle PIE). 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. -- []'s Thiago Jung Bauermann