From patchwork Fri Jan 16 16:47:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Durigan Junior X-Patchwork-Id: 4714 Received: (qmail 19439 invoked by alias); 16 Jan 2015 16:47:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 19430 invoked by uid 89); 16 Jan 2015 16:47:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 16 Jan 2015 16:47:21 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0GGlFde028963 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 16 Jan 2015 11:47:15 -0500 Received: from localhost (dhcp-10-15-16-169.yyz.redhat.com [10.15.16.169]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t0GGlFhH003603 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Fri, 16 Jan 2015 11:47:15 -0500 From: Sergio Durigan Junior To: "Ulrich Weigand" Cc: gdb-patches@sourceware.org (GDB Patches), palves@redhat.com (Pedro Alves), gbenson@redhat.com (Gary Benson) Subject: [PATCH][commit] Fix regression on RHEL-5 systems (was: Re: [PATCH 2/2] Move code to disable ASR to nat/) References: <201501161538.t0GFclYf021559@d03av02.boulder.ibm.com> X-URL: http://blog.sergiodj.net Date: Fri, 16 Jan 2015 11:47:14 -0500 In-Reply-To: <201501161538.t0GFclYf021559@d03av02.boulder.ibm.com> (Ulrich Weigand's message of "Fri, 16 Jan 2015 16:38:46 +0100 (CET)") Message-ID: <871tmu8ygd.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes On Friday, January 16 2015, Ulrich Weigand wrote: > Sergio Durigan Junior wrote: > >> This patch moves the shared code present on >> gdb/linux-nat.c:linux_nat_create_inferior and >> gdb/gdbserver/linux-low.c:linux_create_inferior to >> nat/linux-personality.c. This code is responsible for disabling >> address space randomization based on user setting, and using >> to do that. I decided to put the prototype of the >> maybe_disable_address_space_randomization on nat/linux-osdata.h >> because it seemed the best place to put it. > > This breaks building on my RHEL 5 machine: > > /home/uweigand/dailybuild/spu-tc-2015-01-15/binutils-gdb-head/binutils-gdb/gdb/nat/linux-personality.c: In function 'maybe_disable_address_space_randomization': > /home/uweigand/dailybuild/spu-tc-2015-01-15/binutils-gdb-head/binutils-gdb/gdb/nat/linux-personality.c:80: error: 'ADDR_NO_RANDOMIZE' undeclared (first use in this function) > /home/uweigand/dailybuild/spu-tc-2015-01-15/binutils-gdb-head/binutils-gdb/gdb/nat/linux-personality.c:80: error: (Each undeclared identifier is reported only once > /home/uweigand/dailybuild/spu-tc-2015-01-15/binutils-gdb-head/binutils-gdb/gdb/nat/linux-personality.c:80: error: for each function it appears in.) Ops. Thanks for letting me know, Ulrich. > It looks like this is because you replaced: >> -# if !HAVE_DECL_ADDR_NO_RANDOMIZE > by: >> +# ifndef HAVE_DECL_ADDR_NO_RANDOMIZE > > but config.h on my machine without ADDR_NO_RANDOMIZE contains: > #define HAVE_DECL_ADDR_NO_RANDOMIZE 0 I took the liberty to go ahead and push the following patch as obvious. Please let me know if there is anything else needed. Thanks, diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b7ba1b2..b95abdc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2015-01-16 Sergio Durigan Junior + + * nat/linux-personality.c: Replace "#ifndef + HAVE_DECL_ADDR_NO_RANDOMIZE" by "#if + !HAVE_DECL_ADDR_NO_RANDOMIZE", fixing a regression in RHEL-5 + systems. + 2015-01-16 Eli Zaretskii * tui/tui-win.c (tui_rehighlight_all, tui_set_var_cmd): New diff --git a/gdb/nat/linux-personality.c b/gdb/nat/linux-personality.c index f61a2c6..3ea8755 100644 --- a/gdb/nat/linux-personality.c +++ b/gdb/nat/linux-personality.c @@ -22,7 +22,7 @@ #ifdef HAVE_PERSONALITY # include -# ifndef HAVE_DECL_ADDR_NO_RANDOMIZE +# if !HAVE_DECL_ADDR_NO_RANDOMIZE # define ADDR_NO_RANDOMIZE 0x0040000 # endif /* ! HAVE_DECL_ADDR_NO_RANDOMIZE */ #endif /* HAVE_PERSONALITY */