From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11557 invoked by alias); 5 Jul 2010 17:06:33 -0000 Received: (qmail 11485 invoked by uid 22791); 5 Jul 2010 17:06:31 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Jul 2010 17:06:18 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 1B0A22BAC4F; Mon, 5 Jul 2010 13:06:16 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id YbFnXQyCu8zb; Mon, 5 Jul 2010 13:06:16 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id DF1B42BAC45; Mon, 5 Jul 2010 13:06:15 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 8086EF5895; Mon, 5 Jul 2010 10:06:02 -0700 (PDT) Date: Mon, 05 Jul 2010 17:06:00 -0000 From: Joel Brobecker To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: ping: [patch 1/6] PIE: Attach binary even after re-prelinked underneath Message-ID: <20100705170602.GY2595@adacore.com> References: <20100329153031.GA31671@host0.dyn.jankratochvil.net> <20100609150753.GA7183@host0.dyn.jankratochvil.net> <20100629174216.GR2595@adacore.com> <20100704101635.GA6875@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100704101635.GA6875@host0.dyn.jankratochvil.net> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-07/txt/msg00077.txt.bz2 > gdb/ > 2010-07-02 Jan Kratochvil > Joel Brobecker > > Fix attaching to PIEs prelinked on the disk after the process was > started. > * solib-svr4.c (svr4_exec_displacement): New variable arch_size. > Verify it against bfd_get_arch_size. Try to match arbitrary > displacement for the phdrs comparison. > > gdb/testsuite/ > 2010-07-02 Jan Kratochvil > Joel Brobecker > > * gdb.base/break-interp.exp: Run $binpie with new value "ATTACH", new > code for it. New variable relink_args. > (prelinkYES): Call prelinkNO. > (test_attach): Accept new parameter relink_args. Re-prelink the binary > in such case. Move the core code to ... > (test_attach_gdb): ... a new function. Send GDB command "file". > Extend expected "Attaching to " string. This is OK, with one English error in one of my suggestions (mea culpa). I also still have a question, but this should not prevent the patch to go in as is. > + /* DISPLACEMENT could be found easier by the difference of ^^^^^^ more easily Same thing for the 64bit case. > + /* PT_GNU_STACK is an exception by being never relocated by > + prelink as its addresses are always zero. */ I understand why you mean, now, about the PT_GNU_STACK entry not being changed during the prelink. But I don't get the relationship between this comment and the code surrounding it. Can you explain that? -- Joel